大家可以先看一下starkoverflow的一个讨论(时间是两年前的):
http://stackoverflow.com/questions/17910322/android-ble-api-gatt-notification-not-received
大致内容就是安卓上的app明显调用了
public boolean setCharacteristicNotification (BluetoothGattCharacteristic characteristic, boolean enable)
的接口,却收不到gatt server发过来的notification。
让我们先看看这个接口的解释:
Enable or disable notifications/indications for a given characteristic.
Once notifications are enabled for a characteristic, a onCharacteristicChanged(BluetoothGatt, BluetoothGattCharacteristic) callback will be triggered if the remote device indicates that the given characteristic has changed.
Requires BLUETOOTH permission.
Parameters
characteristic The characteristic for which to enable notifications
enable Set to true to enable notifications/indications
Returns
true, if the requested notif