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

SoftDevice s110 AND s130 have issues with scanResponse in advertisement?

I know that SoftDevice 110 is old but I am stuck with it as it is on a production device with nRF51822. For some reason when I call sd_ble_gap_adv_data_set() with a non NULL value of the parameter uint8_t const * const p_sr_data which is the scan response, no advertisements are sent. In the sd_ble_gap_adv_start(ble_gap_adv_params_t const * const p_adv_params)) I do try with the type set to BLE_GAP_ADV_TYPE_ADV_SCAN_IND. If I set the scan response to NULL and the type to BLE_GAP_ADV_TYPE_ADV_IND then I do get advertisements.

The application is using the bond manager which may have something to do with it. I do not know what version of the SDK is being used, though I have asked and will hopefully get an answer. Is there a known issue with s110 and scan responses?

Now I have moved to s130 and the same issue is present. I have duplicated the flags and local mane in the scan response data and still it does not work. However, if I set the scan response data to NULL and the length to 0 advertisements DO work. The response to a scan request happens, but it is empty. 

I have tried in the start method using both g_adv_params.type = BLE_GAP_ADV_TYPE_ADV_IND;  and g_adv_params.type = BLE_GAP_ADV_TYPE_ADV_SCAN_IND; 

Neither work if the set function  sd_ble_gap_adv_data_set(uint8_t const *p_data, uint8_t dlen, uint8_t const *p_sr_data, uint8_t srdlen)

is

sd_ble_gap_adv_data_set(data_buffer, index, scan_rsp_buffer, scan_index);

Both work if the set function is

sd_ble_gap_adv_data_set(data_buffer, index, NULL, 0);

Parents
  • Hi.

    Is it possible for you to upload your code? We can turn the ticket private first, if you don't want to upload your code on the public forum.

    Atleast the code related to advertising and your main() could be useful.

    I don't know of any known issues regarding scan response on s110.

    Br,
    Joakim

  • Turns out I read the documentation backwards. The docs say 

    Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and
    * duplicating the local name in the advertising data and scan response data.

    I read that as the limitation was that you had to do that (something I would not normally do). But when I looked in the SDK code I saw text which was much clearer. It said simply that you "do not allow flags in scan response' next to an 'if' statement. Removing the flags and the name from the scan response solved the problem --- at least for s130.

Reply
  • Turns out I read the documentation backwards. The docs say 

    Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and
    * duplicating the local name in the advertising data and scan response data.

    I read that as the limitation was that you had to do that (something I would not normally do). But when I looked in the SDK code I saw text which was much clearer. It said simply that you "do not allow flags in scan response' next to an 'if' statement. Removing the flags and the name from the scan response solved the problem --- at least for s130.

Children
Related