Skip to content

Conversation

@cwgthornton
Copy link

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

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
@CLAassistant
Copy link

CLAassistant commented Feb 22, 2025

CLA assistant check
All committers have signed the CLA.

@philips77
Copy link
Member

philips77 commented Jun 5, 2025

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.

@philips77 philips77 self-assigned this Jun 5, 2025
@cwgthornton
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sometimes onServiceDiscoverd is not called when connecting.

3 participants