iOS, caching and switching from LazyCharacteristic to DiscoveredCharacteristic #1084
Replies: 1 comment
-
|
For anyone reading this - this was a bug introduced by me. The code branch that is run when reconnecting to a peripheral did not have the It was neither an iOS bug nor a kable bug. Closing this discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Not sure if any of this makes sense, but here goes:
In our Android and iOS apps, we have a notify characteristic that is used by the peripheral to send "responses". This has been working well for a while. We have been using
characteristicOf()to obtain this characteristic, which we then callperipheral.observe()to then read data.However, we observed some crashes in the wild.
characteristicOfwould crash both on Android and iOS with aNoSuchElementException, complaining that it cannot find the service.So I switched to using the
DiscoveredCharacteristicinstead ofcharacteristicOf(via theperipheral.servicesflow). On iOS, I had to use kable v0.40.0 and setforceCharacteristicEqualityByUuid = truefor this to work.Now this works well for new installs. However, on iOS, if I update the app from a previous version (which was using
characteristicOf) to the version that usesDiscoveredCharacteristic, then my app never receives the ByteArray from my characteristic. So my BLE communication just plain broken. Even after restarting the iPhone etc. I suspect that when this happens my kable never delivers the results to myDiscoveredCharacteristicDoes anyone know if there is some iOS caching at play here?
Beta Was this translation helpful? Give feedback.
All reactions