Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Why big-endian for Eddystone Configuration GATT Service? #138

Closed
beaufortfrancois opened this issue Apr 19, 2016 · 4 comments
Closed

Why big-endian for Eddystone Configuration GATT Service? #138

beaufortfrancois opened this issue Apr 19, 2016 · 4 comments

Comments

@beaufortfrancois
Copy link
Member

I've been asked this question and I'm not sure why big-endian was chosen there.

@roywant
Copy link
Contributor

roywant commented Apr 19, 2016

The reason is consistency with what was already happening in the beacon community. Other major players, before Google's Eddsystone release, had already chosen to use big endian parameters (e.g. IDs) in their beacon ADV packets. Google's Eddsystone ADV packets followed suit in its July 2015 release. Now in April 2016 Google released its EID beacon format and the Eddystone GATT Configuration Service, also in big endian format for consistency.

@Vudentz
Copy link

Vudentz commented Apr 20, 2016

For the record both GATT and ADV headers are in fact encoded in little endian, so it is not consistent in any way.

@mashbridge
Copy link
Contributor

The BLE elements -- UUID and such -- are little-endian of course. Roy was referring to the "user data", if that's not an overly broad term. Other players used network byte order for their service data and/or manufacturer data elements, so we tried to be consistent with that. It's an arbitrary choice to be sure, but it's a choice that was made. On many systems writing and reading the values is less work (sorry iOS), but if you're working down at this level we don't expect swapping bytes to pose much of a challenge. Please do say if there's anywhere in the documentation where it's not clear how something is supposed to be read/written.

@Vudentz
Copy link

Vudentz commented Apr 20, 2016

Looks like it is not conforming to the CSS in case of advertising packets: https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=291904

Supplement to Bluetooth Core Specification page 9 of 37:
"All numerical multi-byte entities and values associated with the following data
types shall use little-endian byte order."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants