Skip to content

Conversation

@gkoh
Copy link
Contributor

@gkoh gkoh commented Sep 10, 2025

Rather than searching the client list by connection address, search by connection handle.
This avoids an issue where the target device has RPA enabled and addresses will not match.

Additionally, update the client peer address with the ID address when the identity has been resolved.

@gkoh
Copy link
Contributor Author

gkoh commented Sep 10, 2025

This attempts to address #360.

I have only tested the getClientByHandle() change.

I have not tested the setPeerAddress() call after identity resolve, yet.

@gkoh
Copy link
Contributor Author

gkoh commented Sep 11, 2025

This needs more thought.
I have just realised this half reverts the onConnectFail() fixes in 8cefc0a

@gkoh
Copy link
Contributor Author

gkoh commented Sep 11, 2025

This PR went from half baked to totally unbaked 🙁
Upon testing the setPeerAddress() change, I got the very helpful:

E NimBLEClient: Cannot set peer address while connected

so, that isn't going to work either.

At this point, I think the right answer is to just add getClientByHandle() to the end of the search by addresses.
So:

  • search by ota_addr
  • search by id_addr
  • search by conn_handle

If the peer has RPA enabled, searching by address fails due to address
resolution.
If this occurs, attempt to find the client by connection handle.
@gkoh
Copy link
Contributor Author

gkoh commented Sep 12, 2025

Updated to add search by connection handle after search by address fails.

@h2zero
Copy link
Owner

h2zero commented Oct 23, 2025

Awesome, thanks @gkoh

@h2zero h2zero merged commit d163a9f into h2zero:master Oct 23, 2025
71 checks passed
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.

2 participants