manolofdez / AsyncBluetooth

A small library that adds concurrency to CoreBluetooth APIs.
MIT License
160 stars 30 forks source link

Peripheral.setNotifyValue is not called when we write value manually #39

Closed grhashmi5 closed 9 months ago

grhashmi5 commented 9 months ago

Hello, Is there a way that setNotifyValue for a specific character is called when we change/ write the value manually? It only gets called when the value is changed from the device.

If not, then please tell me how I can get this update. The problem is that one characteristic is subscribed on many screens, when I write the value to that characteristic manually, all the places where that characteristic is subscribed, should be notified.

Thanks

manolofdez commented 9 months ago

Hi! The problem is that the peripheral:didUpdateValueForCharacteristic:error: delegate from CoreBluetooth doesn't get called after calling writeValue on the peripheral. It should however get called after you do a readValue. So you could make sure to call readValue after doing a writeValue. Let me know if that works out for you!