Trigger service discovery if interrupted in onConnectionUpdated#610
Open
cwgthornton wants to merge 1 commit intoNordicSemiconductor:mainfrom
Open
Trigger service discovery if interrupted in onConnectionUpdated#610cwgthornton wants to merge 1 commit intoNordicSemiconductor:mainfrom
onConnectionUpdated#610cwgthornton wants to merge 1 commit intoNordicSemiconductor:mainfrom
Conversation
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 NordicSemiconductor#536, but I was seeing this behaviour consistently when connecting to another BLE device
Member
|
Hi! |
Author
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It appears that when a service discovery is in progress and
onConnectionUpdatedis called, the service discovery callbackonServicesDiscoveredis never invoked. By checking to seeserviceDiscoverRequestedis 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