enable Notifications
Enables notifications for a GATT characteristic.
This method performs the following steps:
Enables local notification listening via BluetoothGatt.setCharacteristicNotification.
Writes the BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE to the Client Characteristic Configuration Descriptor (CCCD) to enable server-side notifications.
Once enabled, the onNotification callback will be invoked each time the device sends a notification with the updated characteristic value.
The state machine must be in ConnectionState.Ready for this operation to succeed. The characteristic must support notifications (have a CCCD descriptor).
Parameters
The UUID of the GATT service containing the characteristic.
The UUID of the characteristic to enable notifications for.
Callback invoked with the new value each time a notification is received. This callback may be called multiple times until notifications are disabled.
Invoked once when the notification setup completes. BluetoothGatt.GATT_SUCCESS indicates notifications are now active.
See also
Throws
if Bluetooth permissions are not granted.