Skip to content

Instantly share code, notes, and snippets.

@tdcolvin
Created January 8, 2024 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdcolvin/d8da22b6514974dfc76f3454403e2394 to your computer and use it in GitHub Desktop.
Save tdcolvin/d8da22b6514974dfc76f3454403e2394 to your computer and use it in GitHub Desktop.
private val callback = object: BluetoothGattCallback() {
override fun onDescriptorWrite(
gatt: BluetoothGatt?,
descriptor: BluetoothGattDescriptor,
status: Int
) {
super.onDescriptorWrite(gatt, descriptor, status)
if (status == BluetoothGatt.GATT_SUCCESS) {
Log.v("bluetooth", "Descriptor ${descriptor.uuid} of characteristic ${descriptor.characteristic.uuid}: write success")
}
else {
Log.v("bluetooth", "Descriptor ${descriptor.uuid} of characteristic ${descriptor.characteristic.uuid}: write fail (status=$status)")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment