This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Endianness of packets

Other Parts Discussed in Thread: CC2540

When working with the CC2540 USB module, most of the data being read is read backwards and must be reversed to make any sense (i.e. the opcodes/eventcodes and most other parameters one than one octal long). BTool does this automatically and I assume this is something to do with endianness (?).

However, this doesn't hold true for all packets. For example, BTool does not reverse the CSRK and IRK parts of the GAP_DeviceInitDone event packet. This is similar for some other packets too (I'll try to update as I find them again). Is there any rationale to this seemingly arbitrary choice or am I mistaken in my understanding of this?

  • Hi Stephen,

    Bluetooth low energy uses both Little- and Big-endian, so it might be confusing sometimes. For example, The service discovery protocol transfer multiple-byte fields in standard network byte order (Big Endian), while Multi-octet fields within the GATT Profile shall be sent least significant octet first (Little Endian). I am not sure why it is so.

    Everything is of course specified in the Core Spec, where you can find more information.

    Best Regards