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

Ergonomics of UUID::B128(u8vec) #33

Open
osynge opened this issue May 9, 2019 · 2 comments
Open

Ergonomics of UUID::B128(u8vec) #33

osynge opened this issue May 9, 2019 · 2 comments

Comments

@osynge
Copy link

osynge commented May 9, 2019

As I understand it UUID::B128(u8vec) takes a vector of u8 in the reverse order to that displayed. This is confusing an not ergonomic.

for example the code:

let authcharuuid : [u8; 16] = [ 0x67, 0xDF , 0xD1, 0x30, 0x42, 0x16, 0x39, 0x89, 0xE4, 0x11, 0xE9, 0x47, 0x30, 0xEE , 0xE9, 0x47];
println!("UUID:{}",  UUID::B128(authcharuuid)); 

produces the output:

UUID:47:E9:EE:30:47:E9:11:E4:89:39:16:42:30:D1:DF:67
@JJJollyjim
Copy link

FWIW, this behavior matches the other BLE API I have used, for the ESP32:

https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_server_service_table/main/gatts_table_creat_demo.c#L88

I definitely found it confusing when using that library

@visceralfield
Copy link

This behaviour is also found in Nordic Semiconductor's BLE libraries - it's about host vs. network byte order.

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

No branches or pull requests

3 participants