onCharacteristicRead

open override fun onCharacteristicRead(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic, status: Int)

Called when a characteristic read operation completes.

This callback is invoked after BluetoothGatt.readCharacteristic completes. On success, the characteristic's value can be retrieved from the characteristic object.

Parameters

gatt

The BluetoothGatt instance for the connection.

characteristic

The BluetoothGattCharacteristic that was read. Contains the value if the read was successful.

status

BluetoothGatt.GATT_SUCCESS if the read completed successfully, or an error code if the read failed.

See also

ConnectionStateMachine.handleCharacteristicRead