Closed manishbansal8843 closed 1 year ago
Hi, thank you for opening this issue. That's indeed a weird behavior! Will merge your PR asap.
Hi @manishbansal8843 sorry I couldn't merge your PR as it breaks the demo app when using the Thingy52 device. Can you try again with the new v7.0.0 release of the lib and lmk.
cheers.
I am trying to build one application for a MI smart band. This application reads the pedometer data. Now, after pairing devices, it fails to read the characteristics value. Post that, once it dispatches notifications of value changed, characteristic values starts to flow in.
Further, this failure is happening only in 90%cases. Once in a while, failure does not happen. It works perfectly fine the very first time.
Now, what i feel is, when we read the characteristics by calling ble.getCharacteristic$(), it returns the promise which generally gets settled before starting the notification on that characteristics. In such case, when we try to read value out of this characteristics, it fails.
Now, in 10 % case, char.startNotifications() gets settled before the above mentioned promise. Hence, the issue do not come while reading the value.
Logs in 10% cases where it works fine.
Logs in 90% cases when it fails