I had noticed this hex issue and attempted to convert the UUID, but none of the conversions were working. It turns out converting UUIDs to a hex value is not straight forward. Online converters (as of 10/2022) do not work.
For future reference this is how to convert a UUID to hex:
We start with the UUID: 2fa3d779-25d1-4886-8736-ed40751c9fe5
1) Remove any hyphens in the UUID
-> 2fa3d77925d148868736ed40751c9fe5
2) Split the UUID into 2-digit sequences
-> 2f, a3, d7, 79, 25, d1, 48, 86, 87, 36, ed, 40, 75, 1c, 9f, e5
3) Reverse the order, and add '0x' in front of each segment
-> 0xe5, 0x9f, 0x1c, 0x75, 0x40, 0xed, 0x36, 0x87, 0x86, 0x48, 0xd1, 0x25, 0x79, 0x37, 0xa3, 0x2f
As for Bluefruit's prefered notation, here is the final result in code:
Code: Select all
#define My_Service_UUID (const uint8_t[]) { 0xe5, 0x9f, 0x1c, 0x75, 0x40, 0xed, 0x36, 0x87, 0x86, 0x48, 0xd1, 0x25, 0x79, 0x37, 0xa3, 0x2f }
I don't understand why this works, but apparently this is the way it is done. For confirmation, you can refer to the Bluefruit sketch 'arduino_science_journal'. Hopefully this will be helpful to someone in the future