class BitGattPeer
Interface representing a BLE peer (remote) device and operations that can be carried on it.
BitGattPeer(gattConnection: GattConnection, clientTransactionProvider: ClientTransactionProvider = ClientTransactionProvider())
Interface representing a BLE peer (remote) device and operations that can be carried on it. |
val fitbitDevice: FitbitBluetoothDevice
Gets the fitbitDevice associated with the peer This assumes we are connected to the peer. |
|
val gattConnection: GattConnection |
|
val isConnected: Boolean
Whether or not the GattConnection is connected |
|
val services: List<BluetoothGattService>?
Gets the list of all services on the peer. Prior to this service discovery needs to be performed. This assumes we are connected to the peer. |
fun connect(): Single<BluetoothGatt>
Establishes a BLE connection with a peer device. Returns a BluetoothGatt object. |
|
fun discoverServices(): Single<List<BluetoothGattService>>
Performs service discovery on the peer This assumes we are connected to the peer. |
|
fun getService(uuid: UUID): Maybe<BluetoothGattService>
Gets the service matching a specific UUID. Prior to this service discovery needs to be performed. This assumes we are connected to the peer. |
|
fun readDescriptor(descriptor: BluetoothGattDescriptor): Single<BluetoothGattDescriptor>
Reads the descriptor of a characteristic This assumes we are connected to the peer. |
|
fun requestConnectionPriority(priority: Int): Single<Boolean>
Requests connection priority as described in the BluetoothGatt object. This assumes we are connected to the peer. |
|
fun requestMtu(mtu: Int): Single<Int>
Requests an MTU This assumes we are connected to the peer. |
|
fun setupNotifications(characteristic: BluetoothGattCharacteristic, subscribe: Boolean, isIndication: Boolean = false): Single<BluetoothGattCharacteristic>
Combined operation to set up notifications on a characteristic (enables notifications + writes to descriptor This assumes we are connected to the peer. |