BLE characteristic values swapped

Several of my users are reporting on at lest recent and current versions of iOS the value from one characteristic can be swapped with another.

Originally I thought this was a library issue but it doesn't happen on Android and now a user with two iPhones using the exact same app and iOS 26.3 on both has the issue on one phone but not the other.

I've gone into more detail here which also includes a little data dumping to prove the values between characteristics can be mixed up.

https://github.com/dotintent/react-native-ble-plx/issues/1316

One user reported cycling Bluetooth on/off fixed the issue but the latest user says it does not.

For the peripheral the services can only change if the device enters firmware update mode (in which case the service UUID is different). Otherwise the characteristics on a service never change. This would make it a strange one to be caching related since the cache should always be correct.

Reading through your GitHub issues, I see no indication that this would be an iOS bug, but rather a timing/race issue in your code.

A bug like this that is in the Bluetooth stack would have caused many such complaints, and at this point, this is the first time I am hearing this.

The only other explanation that would be beyond your code can be an issue with the GATT table on the accessory, perhaps due to mixing up of attribute handles.

The only way to understand whether the value sent by the accessory is the correct one vs. the wrong one reported by CoreBluetooth to your app would be to observe the traffic with a packet logger/air trace to see.

If you are able to reproduce this on your end, what would be useful is to install the Bluetooth logging profile from https://developer.apple.com/feedback-assistant/profiles-and-logs/ and then examine the Console logs for your app, or use the PacketLogger app (available at Additional Tools for Xcode) to see the traffic between your app and the peripheral, if you don't have access to a Sniffer tool.

These should help you pinpoint what read request and response you are getting between your app and the peripheral, and if what is being sent is not what you see in your app, then try to understand the root cause of the issue, where the data received might be getting mangled.

BLE characteristic values swapped
 
 
Q