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

Dose nRF52810 support Non connectable Scannable advertising?

Hello,

I am using custom board with nRF52810 (QCAA, QFN32), SDK14.2, and softdevice S112 v5.1.0/S132 v 51.10 according to the compatability matrix. I am programing the board to advertise as Non connectable - Scannable (BLE_GAP_ADV_TYPE_ADV_SCAN_IND). That is it would send advertising packet, then wait to receive scanning request from the observer, and then send the scan response to the observer.

It sends the advertising packet OK (I can see the data via observer UART), but it never sees the scan-req from the observer, and ble event BLE_GAP_EVT_SCAN_REQ_REPORT is never trigger.

I have tested the same design custom board that is built with nRF52832 and programmed with the same code and software, and there is no problem what ever. Packet sniffer also shows the scan request from the observer.

My question is "does nRF52810 support such a role of advertising (Non connectable - Scannable)?" If it does please give me advice and suggestions.

Regards
krirk

Parents
  • Hi,

    How does your advertising_init() function look like ? Do you place any data in the srdata field?

    In ble_app_uart example we put the UUID in the srdata like this:

    static void advertising_init(void)
    {
        uint32_t               err_code;
        ble_advertising_init_t init;
    
        memset(&init, 0, sizeof(init));
    
        init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
        init.advdata.include_appearance = false;
        init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
    
        init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        init.srdata.uuids_complete.p_uuids  = m_adv_uuids;
    
        init.config.ble_adv_fast_enabled  = true;
        init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
        init.config.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;
    
        init.evt_handler = on_adv_evt;
    
        err_code = ble_advertising_init(&m_advertising, &init);
        APP_ERROR_CHECK(err_code);
    
        ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
    }

    If you have data in srdata and doing scannable advertising, the SD will respond with the srdata to the central. You will not automatically get the event BLE_GAP_EVT_SCAN_REQ_REPORT when this happens, this is something that you need to explicitly enable, for v5.1.0, with sd_ble_opt_set(). You can e.g. put this at the end of advertising_init() function:

    ble_opt_t ble_options;
    memset(&ble_options, 0, sizeof(ble_options));
    ble_options.gap_opt.scan_req_report.enable = 1;
    err_code = sd_ble_opt_set(BLE_GAP_OPT_SCAN_REQ_REPORT, &ble_options);
    APP_ERROR_CHECK(err_code);

  • Hi,

    Many thanks to both of you. I have migrated my code to SDK15.3, and it is working as intended now.

    Regards

    krirk 

  • it is working

    Excellent! Now please verify the answer:

Reply Children
No Data
Related