disableNotifications

fun disableNotifications(serviceUuid: UUID, characteristicUuid: UUID, onComplete: (Int) -> Unit? = null)

Disables notifications for a GATT characteristic.

This method:

  1. Removes the local notification handler for the characteristic.

  2. Disables local notification listening via BluetoothGatt.setCharacteristicNotification.

  3. Writes BluetoothGattDescriptor.DISABLE_NOTIFICATION_VALUE to the CCCD to disable server-side notifications.

After this method completes successfully, no more notification callbacks will be received for this characteristic.

Parameters

serviceUuid

The UUID of the GATT service containing the characteristic.

characteristicUuid

The UUID of the characteristic to disable notifications for.

onComplete

Optional callback invoked when the operation completes. BluetoothGatt.GATT_SUCCESS indicates notifications are now disabled. If null, the operation is fire-and-forget.

See also

Throws

if Bluetooth permissions are not granted.