Android 如何禁用setCharacteristicNotification
我正在尝试构建一个应用程序,通过BLE从加速度计获取数据。 根据安卓开发者网站,我正在使用函数Android 如何禁用setCharacteristicNotification,android,bluetooth-lowenergy,data-stream,Android,Bluetooth Lowenergy,Data Stream,我正在尝试构建一个应用程序,通过BLE从加速度计获取数据。 根据安卓开发者网站,我正在使用函数setCharacteristicNotification(characteristic,true)从设备启动数据流。 但是当调用setCharacteristicNotification(characteristic,false)停止数据流时,它有时工作,有时不工作。 我不知道出了什么问题,因为我正在根据中给出的信息做每件事 任何人都可以给出停止数据流的确切过程,即如何成功setCharacteris
setCharacteristicNotification(characteristic,true)
从设备启动数据流。
但是当调用setCharacteristicNotification(characteristic,false)
停止数据流时,它有时工作,有时不工作。
我不知道出了什么问题,因为我正在根据中给出的信息做每件事
任何人都可以给出停止数据流的确切过程,即如何成功setCharacteristicNotification(characteristic,false)
提前感谢。如果Android中的蓝牙堆栈应将通知/指示转发到应用程序,则
setCharacteristicNotification
方法仅会告知蓝牙堆栈。您还需要将配置写入客户机特征配置描述符。请参阅,然后使用。如果Android中的蓝牙堆栈应将通知/指示转发到应用程序,则setCharacteristicNotification
方法仅会告知蓝牙堆栈。您还需要将配置写入客户机特征配置描述符。请参阅,然后使用