Classes

The following classes are available globally.

  • CentralManager is a class implementing ReactiveX API which wraps all Core Bluetooth Manager’s functions allowing to discover, connect to remote peripheral devices and more. You can start using this class by discovering available services of nearby peripherals. Before calling any public CentralManager‘s functions you should make sure that Bluetooth is turned on and powered on. It can be done by calling and observing returned value of observeStateWithInitialValue() and then chaining it with scanForPeripherals(_:options:):

    let disposable = centralManager.observeStateWithInitialValue()
        .filter { $0 == .poweredOn }
        .take(1)
        .flatMap { centralManager.scanForPeripherals(nil) }
    

    As a result you will receive ScannedPeripheral which contains Peripheral object, AdvertisementData and peripheral’s RSSI registered during discovery. You can then establishConnection(_:options:) and do other operations. You can also simply stop scanning with just disposing it:

    disposable.dispose()
    

    Seealso

    Peripheral
    See more

    Declaration

    Swift

    public class CentralManager : ManagerType
  • Characteristic is a class implementing ReactiveX which wraps CoreBluetooth functions related to interaction with CBCharacteristic

    See more

    Declaration

    Swift

    public class Characteristic
    extension Characteristic: Equatable
  • Descriptor is a class implementing ReactiveX which wraps CoreBluetooth functions related to interaction with CBDescriptor Descriptors provide more information about a characteristic’s value.

    See more

    Declaration

    Swift

    public class Descriptor
    extension Descriptor: Equatable
  • RxBluetoothKit specific logging class which gives access to its settings.

    See more

    Declaration

    Swift

    public class RxBluetoothKitLog : ReactiveCompatible
  • Peripheral is a class implementing ReactiveX API which wraps all Core Bluetooth functions allowing to talk to peripheral like discovering characteristics, services and all of the read/write calls.

    See more

    Declaration

    Swift

    public class Peripheral
    extension Peripheral: Equatable
  • PeripheralManager is a class implementing ReactiveX API which wraps all the Core Bluetooth Peripheral’s functions, that allow to advertise, to publish L2CAP channels and more. You can start using this class by adding services and starting advertising. Before calling any public PeripheralManager‘s functions you should make sure that Bluetooth is turned on and powered on. It can be done by observeStateWithInitialValue(), observing it’s value and then chaining it with add(_:) and startAdvertising(_:):

    let disposable = centralManager.observeStateWithInitialValue()
        .filter { $0 == .poweredOn }
        .take(1)
        .flatMap { centralManager.add(myService) }
        .flatMap { centralManager.startAdvertising(myAdvertisementData) }
    

    As a result, your peripheral will start advertising. To stop advertising simply dispose it:

    disposable.dispose()
    
    See more

    Declaration

    Swift

    public class PeripheralManager : ManagerType
  • Represents instance of scanned peripheral - containing it’s advertisment data, rssi and peripheral itself. To perform further actions peripheral instance variable can be used ia. to maintain connection.

    See more

    Declaration

    Swift

    public class ScannedPeripheral
  • Service is a class implementing ReactiveX which wraps CoreBluetooth functions related to interaction with CBService

    See more

    Declaration

    Swift

    public class Service
    extension Service: Equatable