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

Advdata packet sequence

Hello all

I am trying to better understand the sequence in which all the data is encoded in to the advdata structure. This includes device name, company identifier, manuf specific data, UUID's etc. Is there any documentation which details in which sequence all of this data is encoded?

Best Prasanna

Parents
  • It is always [Length (1 byte), Type (1 byte), Data ( bytes)] repeated over and over. The length byte is not included in the total length. The example you posted would be read as 9 bytes, type 8 (Shortened Local Name), (9-1) bytes of name in non-null-terminated UTF-8 "HHHHHHHH". The next part is 3 bytes long, type 25 (Appearance), 2 bytes of appearance (0x0000 = Unknown), etc. Go by the numbers found here and the descriptions found in the Core Spec Supplement.

Reply
  • It is always [Length (1 byte), Type (1 byte), Data ( bytes)] repeated over and over. The length byte is not included in the total length. The example you posted would be read as 9 bytes, type 8 (Shortened Local Name), (9-1) bytes of name in non-null-terminated UTF-8 "HHHHHHHH". The next part is 3 bytes long, type 25 (Appearance), 2 bytes of appearance (0x0000 = Unknown), etc. Go by the numbers found here and the descriptions found in the Core Spec Supplement.

Children
Related