The BTLE specification does allow user/custom data to be added to the advertising packets. Which field in the advertising data structure is the right place for adding such data? I'd like to avoid hacks, so prefer to do it only where appropriate.
The BTLE specification does allow user/custom data to be added to the advertising packets. Which field in the advertising data structure is the right place for adding such data? I'd like to avoid hacks, so prefer to do it only where appropriate.
The best place to add user/custom data is in the field Service Data (GAP 11.1.10) if you have a 16bit UUID service or in the Manufacturer Specific (Data GAP 11.1.4) if you have a 16 bit company identifier
Thanks! Will changes to these fields be reflected immediately, or a stop/resume of advertising be needed?
It should be reflected immediately if I recall it correctly
Are there an example of this working? I can't find any use of these structures in the SDK. My attempts so far don't work.
uint8_t adv_data[] = {0x07, 0xFF, (COMPANY_ID & 0xFF), ((COMPANY_ID >> 8) & 0xFF), 0x01, 0x02, 0x03, 0x04, 0x05};
this is Manufacturer Specific Data, data length 5, don't think we have any examples using this