Bluetooh: Host: conn: Resume adv after disconn for periph role only#51256
Merged
carlescufi merged 1 commit intozephyrproject-rtos:mainfrom Oct 17, 2022
Conversation
Thalley
previously approved these changes
Oct 13, 2022
jhedberg
previously approved these changes
Oct 13, 2022
Contributor
Author
|
CI failing due to non-PR related issue. @ahmedmoheb-nordic is looking on it. |
Contributor
This test is using I created a PR which fixes this problem by combining ztest_test_skip() with a conditional 'if' statement to restore the required logic |
Zephyrs Host has by default enabled automatic resume of advertising in case of disconnection when peripheral role is enabled. The feature becomes a bit problematic in case of multirole usage. For example assume a use case where a device is working as peripheral and central, where it may establish single connection for each role. In case there are two connections established and connection in central role is dropped by peer, Host will automatically resume advertising. After that an application can resume scanning, e.g. in disconnected callback. That should not happen. If one of connections was used for central role, it should not be stolen by Host to run peripheral role. Host should verify if a disconnected connection role was peripheral and then resume advertising. This approach will not break backward compatibility and change correct resume behavior. What more, Host will follow an application decisions about use of connection objects. Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
9618878 to
372c8f2
Compare
Contributor
Author
Thalley
approved these changes
Oct 14, 2022
jhedberg
approved these changes
Oct 14, 2022
eslam-cloud2nd
added a commit
to eslam-cloud2nd/zephyr
that referenced
this pull request
Dec 30, 2022
zephyrproject-rtos#51256 Signed-off-by: Esalm Essa <eslam@cloud2gnd.com>
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.
Zephyrs Host has by default enabled automatic resume of advertising in case of disconnection when peripheral role is enabled.
The feature becomes a bit problematic in case of multirole usage. For example assume a use case where a device is working as peripheral and central, where it may establish single connection for each role.
In case there are two connections established and connection in central role is dropped by peer, Host will automatically resume advertising. After that an application can resume scanning, e.g. in disconnected callback. That should not happen.
If one of connections was used for central role, it should not be stolen by Host to run peripheral role. Host should verify if a disconnected connection role was peripheral and then resume advertising.
This approach will not break backward compatibility and change correct resume behavior. What more, Host will follow an application decisions about use of connection objects.
Partially fixes: #50438
Signed-off-by: Piotr Pryga piotr.pryga@nordicsemi.no