Subscribing for notifications from a CBCharacteristic does not work

℡╲_俬逩灬. 提交于 2019-12-05 05:48:50
app developer 27

For me the issue was that I was using another Android device as the peripheral and needed to implement configuration descriptor. See here: https://stackoverflow.com/a/25508053/599743

Having received more information from the manufacturer, I have gathered that the device is connected and sending out notifications regardless of the communicated notification state of the characteristic. Which means that even though peripheral(_, didUpdateNotificationStateForCharacteristic, error) is telling me the Characteristic is not notifying, peripheral(_, didUpdateValueForCharacteristic, error) is getting called and delivering data when the device sends it. I had not implemented that callback previously, as I did not expect data to be sent in this state.

So basically, my problem seems to have solved itself. Nevertheless, I'm still interested if the device's behaviour is according to the Bluetooth LE specifications or not; I have no insight into those lower levels of implementation but suppose that Apple wrote their docs for some reason to at least strongly imply that a change in the Characteristic's state will preceed the reception of any data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!