ClientBleGattCallback

class ClientBleGattCallback(bufferSize: Int, mutexWrapper: MutexWrapper) : BluetoothGattCallback

A class which maps BluetoothGattCallback methods into ClientGattEvent events.

Parameters

bufferSize

A buffer size for events emitted by BluetoothGattCallback.

Constructors

Link copied to clipboard
constructor(bufferSize: Int, mutexWrapper: MutexWrapper)

Properties

Link copied to clipboard
val event: SharedFlow<ClientGattEvent>

Functions

Link copied to clipboard
open override fun onCharacteristicChanged(gatt: BluetoothGatt?, characteristic: BluetoothGattCharacteristic?)
open override fun onCharacteristicChanged(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic, value: ByteArray)

Callback responsible for emitting an event CharacteristicChanged.

Link copied to clipboard
open override fun onCharacteristicRead(gatt: BluetoothGatt?, characteristic: BluetoothGattCharacteristic?, status: Int)
open override fun onCharacteristicRead(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic, value: ByteArray, status: Int)

Callback responsible for emitting an event CharacteristicRead.

Link copied to clipboard
open override fun onCharacteristicWrite(gatt: BluetoothGatt?, characteristic: BluetoothGattCharacteristic?, status: Int)

Callback responsible for emitting an event CharacteristicWrite.

Link copied to clipboard
open override fun onConnectionStateChange(gatt: BluetoothGatt?, status: Int, newState: Int)

Callback responsible for emitting an event ConnectionStateChanged.

Link copied to clipboard
open override fun onDescriptorRead(gatt: BluetoothGatt?, descriptor: BluetoothGattDescriptor?, status: Int)
open override fun onDescriptorRead(gatt: BluetoothGatt, descriptor: BluetoothGattDescriptor, status: Int, value: ByteArray)

Callback responsible for emitting an event DescriptorRead.

Link copied to clipboard
open override fun onDescriptorWrite(gatt: BluetoothGatt?, descriptor: BluetoothGattDescriptor?, status: Int)

Callback responsible for emitting an event DescriptorWrite.

Link copied to clipboard

Auxiliary class for propagating events. For internal use only.

Link copied to clipboard
open override fun onMtuChanged(gatt: BluetoothGatt?, mtu: Int, status: Int)

Callback responsible for emitting an event MtuChanged.

Link copied to clipboard
open override fun onPhyRead(gatt: BluetoothGatt?, txPhy: Int, rxPhy: Int, status: Int)

Callback responsible for emitting an event PhyRead.

Link copied to clipboard
open override fun onPhyUpdate(gatt: BluetoothGatt?, txPhy: Int, rxPhy: Int, status: Int)

Callback responsible for emitting an event PhyUpdate.

Link copied to clipboard
open override fun onReadRemoteRssi(gatt: BluetoothGatt?, rssi: Int, status: Int)

Callback responsible for emitting an event ReadRemoteRssi.

Link copied to clipboard
open override fun onReliableWriteCompleted(gatt: BluetoothGatt?, status: Int)

Callback responsible for emitting an event ReliableWriteCompleted.

Link copied to clipboard
open override fun onServiceChanged(gatt: BluetoothGatt)

Callback responsible for emitting an event ServiceChanged.

Link copied to clipboard
open override fun onServicesDiscovered(gatt: BluetoothGatt, status: Int)

Callback responsible for emitting an event ServicesDiscovered.