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.
Does it make any sense if I want to output some value via advertising package to use manufacturer specific data? if so, then
typedef union {
uint8_t adv_manuf_data_data[1];
int16_t val;
} actual_data_u;
/*****/
static void advertising_init(uint8_t adv_flags, int16_t val)
{
actual_data_u my_data;
/****/
actual_data.val = val;
adv_manuf_data_array.p_data = my_data.adv_manuf_data_data;
adv_manuf_data_array.size = sizeof(adv_manuf_data_data);
/****/
}
When I need to change then I'll call this function again.
Thank you.
If you're asking whether you can update your manufacturer specific data by calling advertising_init(adv_flags, new_data_val) then yes, you can do it like this.
Does it make sense to output data in such way?
Yes, you can send data like this. If your data is related to some service then you can send it as service data (for example send current battery state info related to battery service). See this: devzone.nordicsemi.com/.../
Hi,
Is it possible to make custom service and advertise instead of Manufacturer Specific Data? we don't have 16bit company identifier.