-
Notifications
You must be signed in to change notification settings - Fork 3k
allow host resolved address to be used for connection #13685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow host resolved address to be used for connection #13685
Conversation
@paul-szczepanek-arm, thank you for your changes. |
#if BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION | ||
if (_connect_to_address_type != peer_address_type_t::ANONYMOUS) { | ||
ret = startScan( | ||
(scan_duration_t)connectionParams.getConnectionSupervisionTimeoutArray()[0], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably not the right value to use
3c8bfb8
to
267c360
Compare
@@ -521,6 +525,17 @@ ble_error_t Gap::connect( | |||
|
|||
ble_error_t ret = BLE_ERROR_INTERNAL_STACK_FAILURE; | |||
|
|||
#if BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION | |||
if (_ready_to_connect_to_host_resolved_address) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me some time to understand what this exactly does. Using a state enum would make the code more readable and prevent multiple calls to connect
that may lead to memory leak.
(scan_period_t)0 | ||
); | ||
if (ret == BLE_ERROR_NONE) { | ||
_connection_parameters = new ConnectionParameters(connectionParams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you release it in reset
Thanks, I added an enum and used the extra 3rd state to avoid having an internal connect since the connect is called synchronously from the scan result so I can use that state to know it's an internal call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -532,15 +528,26 @@ ble_error_t Gap::connect( | |||
ble_error_t ret = BLE_ERROR_INTERNAL_STACK_FAILURE; | |||
|
|||
#if BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION | |||
/* if host resolution is used we need to connect in two passes, first we scan for addresses to find |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the comment
Summary of changes
Search for RPA in advertising so we can connect using resolved address.
Impact of changes
Migration actions required
Documentation
none
Pull request type
Test results
Reviewers
@pan-