Is it possible that the scan function yields invalid data?
I've been working on a bug for the past days where I have tried to find out what causes my mobile app to upload incorrect battery percentages of IoT devices (developed by my team) to our backend.
Battery percentages are broadcasted by the IoT devices and are read from device that is yielded from getManager().startDeviceScan().
Usually, the reported battery percentages from the app are correct, but there are times where they are way off. I have verified that it is not the IoT devices that are broadcasting incorrect data. (I did a test with a Python script using Bluepy where I saw that the devices were not sending the incorrect battery values that the mobile app was reporting.)
I haven't been able to be connected (in debug mode) to a phone while the app sends incorrect values, as this does not happen that frequently, which makes it hard to troubleshoot. So far I've only seen the incorrect data being uploaded from the mobile app installed on iOS phones, not Android.
My question is.. is it possible that getManager().startDeviceScan() yields incorrect or old data? Or has anyone experienced a similar issue? (Any ideas on how to further troubleshoot this issue is much appreciated since I am stuck at the moment.)
React Native: 0.64.2 react-native-ble-plx: 2.0.2
Is the battery information in the device's manufacturer data or do you read it from a characteristic?
The data is broadcasted as part of the devices' Manufacturer Data.
I'm excited to inform you that we've released a new version of react-native-ble-plx. Many of the concerns and bugs have been addressed in this update.
If you encounter any issues or have further suggestions, please don't hesitate to open a new issue.