-
Notifications
You must be signed in to change notification settings - Fork 3k
BLE: Fix advertising start and stop #14672
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
BLE: Fix advertising start and stop #14672
Conversation
29c2466
to
d825244
Compare
d825244
to
ab123d3
Compare
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 could help for general case but I'm not sure it helps if the user, for example, start advertising sets with different parameters in a for loop as the configuration will change multiple times before extended_advertising_enable
is actually called. That would lead to subtle bugs.
Have you considered the option where the user is responsible to start and stop advertising sequentially ? We can return an error if a request is pending and indicate its status on AdvertisingStartEvent
or AdvertisingEndEvent
.
@paul-szczepanek-arm, thank you for your changes. |
If he calls start advertising multiple times then the first one will succeed and the subsequent ones will fail. Don't see the subtle bug. |
/* stop all advertising sets */ | ||
for (size_t i = 0; i < BLE_GAP_MAX_ADVERTISING_SETS; ++i) { | ||
if (_active_sets.get(i)) { | ||
_pal_gap.extended_advertising_enable( |
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 redundant since the controller clears the sets
Note to self: fixes #14650 |
Another bug in If you disable See my patch commit here: @paul-szczepanek-arm Making note of this for you, this should be fixed as you refactor the GAP implementation. |
Thanks, looks like there are quite a few places where observer flag is missing. |
Please ignore that request for this fix, it will be logged in Jira. |
Pull request has been modified.
The set end event is currently issued incorrectly but that will be a new PR so this is good to go. |
@pan- could you re-review to make sure you are happy with all the changes ? |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
The start and stop commands for advertising need to complete before the next one is issued. Serialise commands to start and stop advertising. Introduces a new event since the command is now async.
I have also simplified the reset since it doesn't need to start or stop anything - it should rely on the controller to clear the sets.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers