Where to find Service Data UUIDs?
Asked Answered
D

1

7

When sending an advertising packet in bluetooth LE, inside the PDU it is possible to add different type of data. Some of them are the service data types, which Data Type Value are: 0x16 Service Data - 16-bit UUID 0x20 Service Data - 32-bit UUID 0x21 Service Data - 128-bit UUID

I have seen some beacons using this type of data. For example one uses the 0x16 followed by 0x6E2A to send temperature.

I have been searching but I cannot find where is the list with the values of all of these Service Data to see the code of each type of metric.

Dunstable answered 27/8, 2019 at 23:2 Comment(6)
Its is characteristic's UUID (2A6E) (Temperature) List of characteristics is there: bluetooth.com/specifications/gatt/characteristicsCromlech
Yes! Thank you very much @Mike Petrichenko! That it is. But if beacon is a broadcast message which is part of GAP protocol. Why is data in GATT characteristics?Dunstable
I think this is just because m,anufacturewr decided to do so. There is actually no standard (it is but any vendore may do anything he wants). So vendor used standard characteristic's UUID to indicate the value and its format but "packet" it wrong (or custom) way. It happens very often with BLE devices.Cromlech
So, as far as I can understand, the Advertising Data Type indicating that data is a Service Data UUID, that UUID is no standard, each manufacturer has its own list of UUIDs for each kind of data, isn't it?Dunstable
No. There is standard. But you read data type description a bit wrong. The data types 06 16, 20, 21 just mean "List Of UUID(s)" (Complete, incomplete, 16, 32, 128 bits). It doe snot mean exactly "Service" UUIDs. Its just a UUIDs. It can describe danything: primary service, important characteristic, other thing with custom UUID (custom UUID usually used in Manufacturer Specific Data). So that is just UUID and you must know how to work with this. Thevendor has to follow standard only in case of GATT implementation (if the vendor uses standard GATT services).Cromlech
Okay. I got it. Thank you very much for your help!Dunstable
G
2

The 0x16, 0x20 and 0x21 byte values you see in advertisements are advertising "AD" types that indicate the following bytes include the GATT Service UUID of the specified length for the type, followed by service data. See here for the full list of AD type values.

In beacon advertisements it is most common to use the 16-bit UUID since that UUID length it takes up the least amount of space in the advertisement packet, leaving the most bytes remaining for data. The 16-bit service UUIDs you mention (e.g. 0x6e2A) are in theory registered with Bluetooth SIG, and there is indeed a list of them. There are a few different types:

  1. Public GATT Services
  2. Private GATT Services of Bluetooth SIG members
  3. GATT Services of standards development organizations

The first list is for public specifications that anyone can implement. The second two lists are for private specifications. The numbers are reserved, but the way thy are used are proprietary to the organization that owns the number assignment.

If you look through these lists, you'll note you will not find the 6E2A number you mention. How can that be?

There is nothing stopping people from building bluetooth devices that use 16-bit service UUIDs without registering them. Registering costs money and takes time. So lots of projects skip that step, especially in development, even if it is considered bad behavior to be frowned upon by Bluetooth SIG.

For "black market" GATT services like this, there is simply no way to find out a full list of those that exist. You can only look for them on-by-one and reverse-engineer them. Or you can beg the manufacturer for documentation.

Further, regardless of whether the Service UUIDs are registered with Bluetooth SIG, the service data bytes that follow the UUID are not standardized. The manufacturer of the device advertising the service data is allowed to encode whatever data in these bytes that he or she wishes for the specific use case. So unfortunately there is no central registry of what they mean. Meaning has to come from either documentation from the manufacturer or reverse engineering.

Gradate answered 29/8, 2019 at 23:40 Comment(4)
My understand is that @Dunstable is asking for additional data in advertising packets, not for GATT services.Trevelyan
Yeah, it may be true that @raivel33is interested in data, but he specifically asked for the meaning of the two bytes following the 0x16 AD type (which is indeed a GATT service UUID). I have edited my question to add additional detail to make this clear.Gradate
thank you Codo and davidgyoung for your help. Sorry if my question was not clear enough. Mike Petrichenko has send a link with the solution. I was referring to the meaning of the Service Data UUIDs which follow the Advertising Data Type Value (0x16).Dunstable
0x6E2A is not found because it was decoded using the wrong endianness. As a little-endian number, it is 0x2A6E which is "GATT Characteristic and Object Type" for "Temperature". So nothing black-market here.Finstad

© 2022 - 2024 — McMap. All rights reserved.