-
Notifications
You must be signed in to change notification settings - Fork 39
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
suggestion: equal processing for both 16- and 128-bit Uuids // WIP #259
base: main
Are you sure you want to change the base?
Changes from all commits
63648d3
085a5b1
2f0eb92
20d939d
3b6c69a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,10 @@ mod common; | |
const CONNECTIONS_MAX: usize = 1; | ||
const L2CAP_CHANNELS_MAX: usize = 3; | ||
|
||
const SERVICE_UUID: Uuid = Uuid::new_long([ | ||
const SERVICE_UUID: Uuid = Uuid::new_long_from_arr([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another approach is: const SERVICE_UUID: Uuid = Uuid::new_long(
0x00001000b0cd11ec871fd45ddf138840
); If turning to this, care must be taken to the endianness. Should the value be as above, or reversed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To match current behavior it should be reversed. |
||
0x00, 0x00, 0x10, 0x00, 0xb0, 0xcd, 0x11, 0xec, 0x87, 0x1f, 0xd4, 0x5d, 0xdf, 0x13, 0x88, 0x40, | ||
]); | ||
const VALUE_UUID: Uuid = Uuid::new_long([ | ||
const VALUE_UUID: Uuid = Uuid::new_long_from_arr([ | ||
0x00, 0x00, 0x10, 0x01, 0xb0, 0xcd, 0x11, 0xec, 0x87, 0x1f, 0xd4, 0x5d, 0xdf, 0x13, 0x88, 0x40, | ||
]); | ||
|
||
|
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.
Note that here, endianess conversion is non-conditional. This seems like a bug to me, but those would be removed lines in the PR.
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.
No, this is correct. The
uuid
crate stores UUIDs in big-endian order, but the bluetooth spec requires UUIDs to be transmitted in little-endian order.