This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

128-bit UUID byte swap problem

I'm implementing a custom service with one characteristic and 128-bit UUID.

I am able to set the custom base UUID using sd_ble_uuid_vs_add() but the resulting bytes look swapped in nRF MCP Android application. This is on Softdevice 7.0.0 and SDK 6.1.0.

#define BASE_UUID {0xAB, 0xCD, .., 0x12, 0x34}

the resulting UUID I see is first and last 2 octets swapped, also within themselves like this;

{0x34, 0x12, .., 0xCD, 0xAB}

All the octets in between these 4 are fine.

Any idea what could cause this behavior?

EDIT Attaching screenshot from Android MCP: image description

Parents
  • There's nothing wrong with that, the bytes are little-endian and the number is displayed in the MCP as a big-endian number.

    You say all the octets between those are fine ... well all the octets between those are all 0x00 so you wouldn't be able to tell which order they were in.

    Why are they all zero by the way, it's probably a legal UUID but certainly not one you randomly generated.

  • I understand the reason is the reverse endianness between nrf51-dk and MCU Android app, fine. What i dont understand is why? I dont remember anything about this even though i used MCP quite a lot so far for displaying various diffrent UUIDs. It feels strange that i never noticed such behavior.

Reply Children
No Data
Related