abstract class BluetoothGattCallback
This abstract class is used to implement BluetoothGatt callbacks.
Summary
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| open Unit |
Callback triggered as a result of a remote characteristic notification. |
| open Unit |
Callback triggered as a result of a remote characteristic notification. |
| open Unit |
Callback reporting the result of a characteristic read operation. |
| open Unit |
Callback reporting the result of a characteristic read operation. |
| open Unit |
Callback indicating the result of a characteristic write operation. |
| open Unit |
Callback indicating when GATT client has connected/disconnected to/from a remote GATT server. |
| open Unit |
Callback reporting the result of a descriptor read operation. |
| open Unit |
Callback reporting the result of a descriptor read operation. |
| open Unit |
Callback indicating the result of a descriptor write operation. |
| open Unit |
Callback indicating the MTU for a given device connection has changed. |
| open Unit |
Callback triggered as result of |
| open Unit |
Callback triggered as result of |
| open Unit |
Callback reporting the RSSI for a remote device connection. |
| open Unit |
Callback invoked when a reliable write transaction has been completed. |
| open Unit |
Callback indicating service changed event is received |
| open Unit |
Callback invoked when the list of remote services, characteristics and descriptors for the remote device have been updated, ie new services have been discovered. |
| open Unit |
Callback indicating LE connection's subrate parameters have changed. |
Public constructors
BluetoothGattCallback
BluetoothGattCallback()
Public methods
onCharacteristicChanged
open funonCharacteristicChanged(
gatt: BluetoothGatt!,
characteristic: BluetoothGattCharacteristic!
): Unit
Deprecated: Use BluetoothGattCallback.onCharacteristicChanged(BluetoothGatt,BluetoothGattCharacteristic,byte[]) as it is memory safe by providing the characteristic value at the time of notification.
Callback triggered as a result of a remote characteristic notification.
| Parameters | |
|---|---|
gatt |
BluetoothGatt!: GATT client the characteristic is associated with |
characteristic |
BluetoothGattCharacteristic!: Characteristic that has been updated as a result of a remote notification event. |
onCharacteristicChanged
open fun onCharacteristicChanged(
gatt: BluetoothGatt,
characteristic: BluetoothGattCharacteristic,
value: ByteArray
): Unit
Callback triggered as a result of a remote characteristic notification. Note that the value within the characteristic object may have changed since receiving the remote characteristic notification, so check the parameter value for the value at the time of notification.
| Parameters | |
|---|---|
gatt |
BluetoothGatt: GATT client the characteristic is associated with. This value cannot be null. |
characteristic |
BluetoothGattCharacteristic: Characteristic that has been updated as a result of a remote notification event. This value cannot be null. |
value |
ByteArray: notified characteristic value. This value cannot be null. |
onServiceChanged
open fun onServiceChanged(gatt: BluetoothGatt): Unit
Callback indicating service changed event is received
Receiving this event means that the GATT database is out of sync with the remote device. BluetoothGatt.discoverServices should be called to re-discover the services.
| Parameters | |
|---|---|
gatt |
BluetoothGatt: GATT client involved. This value cannot be null. |