Add advertiser classes and handle adv set terminated events - #366
Merged
Conversation
zxzxwu
commented
Dec 6, 2023
Collaborator
- Convert hci.OwnAddressType to enum
- Add LegacyAdvertiser and ExtendedAdvertiser classes
- Rename start/stop_advertising() => start/stop_legacy_advertising()
- Handle HCI_Advertising_Set_Terminated
- Properly restart advertisement on disconnection
Collaborator
Author
|
Maybe we should merge this request after we have a way to test extended advertising? |
barbibulle
approved these changes
Dec 7, 2023
| DEVICE_MAX_EXTENDED_ADVERTISING_SET_HANDLE + 1, | ||
| ): | ||
| if i not in self.extended_advertising_handles: | ||
| if i not in self.extended_advertisers.keys(): |
Collaborator
There was a problem hiding this comment.
nit: if i not in self.extended_advertisers should be sufficient.
Collaborator
Author
There was a problem hiding this comment.
I think this could provide a better readability?
Collaborator
There was a problem hiding this comment.
Either way is fine, but in general I think it is more readable to use the standard/idiomatic way of using collections.
For looking up a key in a dict, the recommended way in most style guides is to just use key in dict (see https://google.github.io/styleguide/pyguide.html#284-decision for example).
Collaborator
Author
There was a problem hiding this comment.
That's fair. Modified.
* Convert hci.OwnAddressType to enum * Add LegacyAdvertiser and ExtendedAdvertiser classes * Rename start/stop_advertising() => start/stop_legacy_advertising() * Handle HCI_Advertising_Set_Terminated * Properly restart advertisement on disconnection
4 tasks
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.