Android-BLE-Library
Android-BLE-Library copied to clipboard
Trigger service discovery if interrupted in `onConnectionUpdated`
It appears that when a service discovery is in progress and onConnectionUpdated is called, the service discovery callback onServicesDiscovered is never invoked. By checking to see serviceDiscoverRequested is set, we can restart the service discovery and get a result back.
This may potentially fix #536, but I was seeing this behaviour consistently when connecting to another BLE device
Hi! Wow, I just found this PR. It has been hanging here for 4+ months now. Sorry for that! Do you still remember anything about this issue? I think I understand it, but will need some time to do some testing.
No worries - the issue I was seeing is that it looked like sometimes I would never get onServicesDiscovered called if I got an onConnectionUpdated. While this made my connection code slightly more reliable, eventually I'd just get into a state where you had to toggle the bt adatper on/off to get it to work again (I was constantly connecting/disconnecting from devices), so I ended up pivoting away for bluetooth