-
Notifications
You must be signed in to change notification settings - Fork 79
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
extended advertising v2 #382
Conversation
8a8f3ba
to
0697723
Compare
0697723
to
cb17f3b
Compare
bumble/host.py
Outdated
HCI_INQUIRY_COMPLETE_EVENT, | ||
HCI_INQUIRY_RESULT_EVENT, |
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.
Including so many items does raise my concern. It also violates Google's Python Style Guide(though it's also not compatible with Black style, and we never follow it from the beginning).
I think we may import hci module here, and add a nick name without HCI_ prefix if we want to avoid repeated HCI at each line.
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.
You're right, the list is becoming too long. I'll make the change here to just import hci
and use hci.XXX
in this file. Eventually, I'll try to push a PR later on to do the same change in other files that also import too many symbols directly. It will make the lines a bit longer, but I think it's a cleaner model.
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
1e3785a
to
8d2f37a
Compare
This is an enhanced API for extended advertising which allows:
1/ using extended advertising commands for legacy advertising (keeping the original advertising API as-is)
2/ creating advertising set objects, which can be independently started/stopped/updated, using a new API.
The new/extended API also allows creating advertisements with legacy PDUs (very typical when you want to be compatible with older devices/phones) in addition to newer ones.
The unit tests aren't complete yet, because they will be easier to write once we merge the PR with basic support for extended advertising in the local controller class. Using Host mocks isn't a great way to test, because you need the full logic of a Controller to ensure that the sequence of events (for example, you need responses for some commands, not just mocking accepting a command and mocking some events), as well as the declared/supported properties, behave correctly.
A future PR will also include a way to test with Root Canal, when available (only on some platforms), but that's out of scope for this PR.