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

Extended Advertising Scannable

Hi

with SDK15 SD140 6.1.0. I'm trying to use BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED with CODED physical.

I run the following code

      static ble_gap_adv_data_t m_adv_beacon_data =
    {
        .adv_data =
            {
                .p_data = NULL,
                .len    = 0
            },
        .scan_rsp_data =
            {
                .p_data = m_becaon_rsdata,
                .len = BLE_GAP_SCAN_BUFFER_EXTENDED_MIN,

            }};
      
      ret_code_t err_code;
      ble_advdata_t const adv_data =
    {
        .name_type          = BLE_ADVDATA_FULL_NAME,
        .flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE,
        .include_appearance = false
    };

      err_code = ble_advdata_encode(&adv_data, m_adv_beacon_data.scan_rsp_data.p_data, &m_adv_beacon_data.scan_rsp_data.len);
      APP_ERROR_CHECK(err_code);
      
      ble_gap_adv_params_t adv_params;

      memset(&adv_params, 0, sizeof(adv_params));

      adv_params.primary_phy = BLE_GAP_PHY_CODED;
      adv_params.secondary_phy = BLE_GAP_PHY_CODED;
      adv_params.p_peer_addr   = NULL,
      adv_params.duration = 0;
      adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED;
      adv_params.scan_req_notification = 1;
      adv_params.interval = APP_ADV_FAST_INTERVAL;
      adv_params.filter_policy = BLE_GAP_ADV_FP_ANY;
      err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &m_adv_beacon_data, &adv_params);
      APP_ERROR_CHECK(err_code);
     

and getting error 10: NRF_ERROR_INVALID_FLAGS . 

the idea is to have a scan response on CODED, so the peripheral can know it was being scanned.

the code is based on this link, although the next lines are commented there:

        else if(m_adv_scan_type_selected == SELECTION_NON_CONNECTABLE)
        {
            NRF_LOG_INFO("Advertising type set to EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED ");
            adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED;
            
//            ret = ble_advdata_encode(&adv_data, m_adv_data_ext.scan_rsp_data.p_data, &m_adv_data_ext.scan_rsp_data.len);
//            APP_ERROR_CHECK(ret);

I would love to get explanation.

thanks...

Parents Reply Children
No Data
Related