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

Is BLE data sends in LSB first and Little Endian byte order?

Hi,
I'm confused, according to Bluetooth 4.0 Specification bytes are send in Little Endian byte order, and with LSB first in every byte.
So when I receive raw data from characteristic in nRF52 device, I need to change bytes order from Little to Big Endain and reverse bits in every byte to receive "human readable" raw data but thats not true.
Data I received is in "human readable" order already.
where did I make a mistake?

Thanks :)

Parents Reply
  • I understand the confusion. Chapter 6 in volume 2 is for the BR/EDR controller while the low energy controller specification is covered by Vol. 6. I think you would be more interested in reading the GATT profile specification in volume 3, Part G. It states the following about endianess:

    "Multi-octet fields within the GATT Profile shall be sent least significant octet
    first (little endian)."

    You are right in that there are some fields that must be arranged in little-endian bit order (packet headers for instance), but that's taken care of by the Softdevice. Also, as you may know, the nRF5 ICs are configured with little-endian memory systems which mean that data is already arranged in the little-endian byte format (this is a common configuration for CPUs). 

Children
Related