Skip to content

Add MAC accessor for returning the MAC in the usual format#397

Merged
deadprogram merged 1 commit into
devfrom
mac-address-accessor
Dec 6, 2025
Merged

Add MAC accessor for returning the MAC in the usual format#397
deadprogram merged 1 commit into
devfrom
mac-address-accessor

Conversation

@aykevl

@aykevl aykevl commented Nov 27, 2025

Copy link
Copy Markdown
Member

The MAC address in the bluetooth.MAC type is little endian, the reverse of what is commonly used. The usual way a MAC address is printed is big endian. To simplify code, the Address() method will return the address in the usual (big endian) format.

Feel free to bikeshed on the name, I don't know whether Address really captures it well. Also, perhaps we should make the underlying data type private at some point? Though that may break existing users.

The MAC address in the bluetooth.MAC type is little endian, the reverse
of what is commonly used. The usual way a MAC address is printed is big
endian. To simplify code, the Address() method will return the address
in the usual (big endian) format.
@deadprogram

Copy link
Copy Markdown
Member

I needed exactly this, thanks @aykevl

Naming is fine for me, not going to bikeshed it. Now merging.

@deadprogram
deadprogram merged commit dbd5524 into dev Dec 6, 2025
4 checks passed
@deadprogram
deadprogram deleted the mac-address-accessor branch December 6, 2025 08:34
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