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

Strange beahaviour with size of 'manufacturer data'

I was unaware that the 'manufacturer data' in the advertising packets is limited to less than a full payload. However, whenever I set it to >6 the program "crashes".


#define MANUFACTURER_DATA_LEN                7
...
    ble_advdata_manuf_data_t adv_manuf_data;
    uint8_array_t            adv_manuf_data_array;
    uint8_t                  adv_manuf_data_data[MANUFACTURER_DATA_LEN];

    adv_manuf_data_data = [ assign actual data ];

    adv_manuf_data_array.p_data = adv_manuf_data_data;
    adv_manuf_data_array.size = MANUFACTURER_DATA_LEN;
    
    adv_manuf_data.company_identifier = COMPANY_IDENTIFIER;
    adv_manuf_data.data = adv_manuf_data_array;
    
    advdata.p_manuf_specific_data = &adv_manuf_data;

Again, any value of 6 or smaller works, above six doesn't. What limit am I hitting? Could this be a bug?

Thanks!

Parents
  • Hi sd,

    the manufacturer data isn't limited to less than a full advertising packet payload as far as I know. However, if you have other items in your advertising data (such as device name, flags, local services etc.) the space available for manufacturer data is limited.

    The total available payload is 31 bytes. You can use the debugger and step to the constructed advertising packet and see what the actual length is. Maybe that will give some clues.

Reply
  • Hi sd,

    the manufacturer data isn't limited to less than a full advertising packet payload as far as I know. However, if you have other items in your advertising data (such as device name, flags, local services etc.) the space available for manufacturer data is limited.

    The total available payload is 31 bytes. You can use the debugger and step to the constructed advertising packet and see what the actual length is. Maybe that will give some clues.

Children
Related