Skip to content
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

Add random address generation methods #379

Merged
merged 1 commit into from
Dec 25, 2023
Merged

Add random address generation methods #379

merged 1 commit into from
Dec 25, 2023

Conversation

zxzxwu
Copy link
Collaborator

@zxzxwu zxzxwu commented Dec 22, 2023

No description provided.

bumble/hci.py Outdated
@@ -1881,6 +1883,45 @@ def parse_address_preceded_by_type(data, offset):
address_type = data[offset - 1]
return Address.parse_address_with_type(data, offset, address_type)

@classmethod
def generate_static(cls) -> Address:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to be consistent in the naming of these 3 methods.
To be very clear, even if a bit long, the full names would be:
generate_static_address, generate_non_resolvable_private_address, and generate_resolvable_private_address. (we can omit the term random here I think since we only generate random addresses).
An alternative would be to drop the _address suffix. But in any case, these methods should either all have the _address suffix, or none of them should have it.

@zxzxwu zxzxwu marked this pull request as ready for review December 24, 2023 09:57
@zxzxwu zxzxwu changed the title [WIP] Add random address generation methods Add random address generation methods Dec 24, 2023
@zxzxwu zxzxwu merged commit 8ccfc90 into google:main Dec 25, 2023
51 checks passed
@zxzxwu zxzxwu deleted the addr branch January 19, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants