2
在我的應用程序中,我使用setCharacteristicNotification爲特徵啓用了notificaito。在日誌貓我得到通知啓用true也獲得onDescriptorWrite回調成功,但回調方法onCharacteristicChanged不叫。請幫助我。在此先感謝未啓用Android BLE onCharacteristicChanged
日誌
D/BluetoothGatt(15694): setCharacteristicNotification() - uuid: 00003c01-0000-1000-8000-00805f9b34fb enable: true
代碼
mBluetoothGatt.setCharacteristicNotification(characteristic, enabled);
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(
UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG));
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
return mBluetoothGatt.writeDescriptor(descriptor);
請幫幫我。我困在這個問題上。 – user1767260 2015-04-02 06:09:46
有些想法可以幫助你。檢查藍牙設備內部的藍牙配置文件實現,它使用「通知」或「指示」發佈更新。還有一些設備具有控制描述符和特定字節來激活通知流程,也許文檔有一些關於它的內容。 – 2015-04-07 08:52:40