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

sd_ble_gap_adv_data_set

i want to modify advertising data by calling sd_ble_gap_adv_data_set, the advertising data include advertising data flag and Manufacturer specific data,the format of advertising data was define in the following:

p_data[31]={0x02,0x01,0x05,0x1b,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xF7,0xDB,0x34,0xC4,0x03,0x8E,0x5C,0x0B,0xAA,0x97,0x30,0X56,0xE6};

then ,i call sd_ble_gap_adv_data_set:

err_code=sd_ble_gap_adv_data_set(p_data,31,NULL,0);
err_code=NRF_ERROR_INVALID_LENGTH.

if the advertising data just include Manufacturer specific data ,the format of advertising data was define in the following:

p_data[31]={0x1e,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x67,0xF7,0xDB,0x34,0xC4,0x03,0x8E,0x5C,0x0B,0xAA,0x97,0x30,0X56,0xE6};

i call sd_ble_gap_adv_data_set:

err_code=sd_ble_gap_adv_data_set(p_data,31,NULL,0);
err_code=NRF_SUCCESS .

i want to ask whether advertising data can't include advertising data flag and Manufacturer specific data at the same time.

Parents
  • Hi,

    I have tried your code and your first line doesn't work for me either. The weird thing is that I get the error NRF_ERROR_INVALID_PARAM not NRF_ERROR_INVALID_LENGTH as you do. What SoftDevice version are you using? I am trying SD S110 8.0.0. Maybe there is a bug in sd_ble_gap_adv_data_set() similar to this. Are you aware that you are putting your device in limited discovery mode? If I set the device to general discovery mode like this: p_data[31]={0x02,0x01,0x06,..... it works for me.

    I wrote a somewhat detailed answer regarding advertising packets and bytes in this thread earlier today that might be helpful to you.

    BTW: I tried your suggestion, RK, and it looks like nothing gets added. Here is a screenshot of the sniffer log:

    image description

    It is just three zeroes appended at the end.

Reply
  • Hi,

    I have tried your code and your first line doesn't work for me either. The weird thing is that I get the error NRF_ERROR_INVALID_PARAM not NRF_ERROR_INVALID_LENGTH as you do. What SoftDevice version are you using? I am trying SD S110 8.0.0. Maybe there is a bug in sd_ble_gap_adv_data_set() similar to this. Are you aware that you are putting your device in limited discovery mode? If I set the device to general discovery mode like this: p_data[31]={0x02,0x01,0x06,..... it works for me.

    I wrote a somewhat detailed answer regarding advertising packets and bytes in this thread earlier today that might be helpful to you.

    BTW: I tried your suggestion, RK, and it looks like nothing gets added. Here is a screenshot of the sniffer log:

    image description

    It is just three zeroes appended at the end.

Children
No Data
Related