You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I try to set characteristic notification with: BluetoothLEController.getInstance().setReadCharacteristic(MY_CHARACTERISTIC_UUID_AS_STRING);
But that doesn't work, onDataChanged(BluetoothCharacteristic characteristic) is not called.
Following the Bluetooth Smart standard on Android, you also need to write to the descriptor which is not done in the library.
I've downloaded the library from Github and did the following modification: for (BluetoothGattDescriptor descriptor : descriptors) { if (descriptor.getUuid().equals(Descriptor.CLIENT_CHARACTERISTIC_CONFIGURATION)) { BluetoothLEController.getInstance().setReadCharacteristic(MY_CHARACTERISTIC_UUID_AS_STRING); descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); mBluetoothGatt.writeDescriptor(descriptor); } }
And then I become the notifications. Either you should change this directly in the library or you could send back mBluetoothGatt in onDiscoveringCharacteristics so we can write to the descriptor ourselves.
Let me know what you think about it.
Best,
JB
The text was updated successfully, but these errors were encountered:
Hi,
I try to set characteristic notification with:
BluetoothLEController.getInstance().setReadCharacteristic(MY_CHARACTERISTIC_UUID_AS_STRING);
But that doesn't work,
onDataChanged(BluetoothCharacteristic characteristic)
is not called.Following the Bluetooth Smart standard on Android, you also need to write to the descriptor which is not done in the library.
I've downloaded the library from Github and did the following modification:
for (BluetoothGattDescriptor descriptor : descriptors) { if (descriptor.getUuid().equals(Descriptor.CLIENT_CHARACTERISTIC_CONFIGURATION)) { BluetoothLEController.getInstance().setReadCharacteristic(MY_CHARACTERISTIC_UUID_AS_STRING); descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); mBluetoothGatt.writeDescriptor(descriptor); } }
And then I become the notifications. Either you should change this directly in the library or you could send back mBluetoothGatt in onDiscoveringCharacteristics so we can write to the descriptor ourselves.
Let me know what you think about it.
Best,
JB
The text was updated successfully, but these errors were encountered: