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

hci: implement set random MAC address #229

Closed
wants to merge 2 commits into from

Conversation

xudongzheng
Copy link

No description provided.

@aykevl
Copy link
Member

aykevl commented Jan 22, 2024

I'm a bit hesitant with this PR because it's a bit more complicated than that: there are three different kinds of random MAC addresses. See this post for details: https://novelbits.io/bluetooth-address-privacy-ble/. This PR doesn't distinguish between the three, which means the API will need to change in the future.

I plan on implementing private addresses in the bluetooth package eventually, after implementing pairing and bonding.

@xudongzheng xudongzheng marked this pull request as draft January 28, 2024 20:58
@xudongzheng xudongzheng changed the title ninafw: implement set random MAC address hci: implement set random MAC address Jan 28, 2024
@xudongzheng
Copy link
Author

That sounds reasonable. I'll mark the PR as a draft for now until there is a bit more clarity around how MAC addresses should be stored internally.

I'll keep this semi-updated as it's useful for #230.

@deadprogram
Copy link
Member

Hello @xudongzheng and @aykevl I was just looking at this PR, and thinking that it probably seems fine.

Via the linked article:

IMPORTANT NOTE: All Bluetooth devices must use one of either type: a Public Address or a Random Static Address.
The next type of address (Private Address) is optional and is solely used to address privacy concerns (i.e. device may use one of them in addition to either a Public or Random Static Address).

The HCI controller command does not distinguish between different kinds of random addresses.

See https://analog-devices-msdk.github.io/MAX-BLE-HCI/le_controller_cmds.html#set-random-address

Creating a random address that fulfills the extra requirements of private addresses can be added using an additional API of some kind, but seems like something additional. As such, this PR probably seems like a good thing.

Thoughts?

@deadprogram
Copy link
Member

@deadprogram
Copy link
Member

I resolved merge conflicts in a local branch and tested. Works as promised!

See my PR #325 and #326

@deadprogram
Copy link
Member

Closing this PR since it was replaced by your commits in #325

Thanks for working on this @xudongzheng

@deadprogram deadprogram closed this Jan 9, 2025
@xudongzheng xudongzheng deleted the hci-rand-addr-pr branch January 9, 2025 18:49
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.

3 participants