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

BLE_GAP_EVT_SCAN_REQ_REPORT not working

I'm trying to have an nRF52 DK detect the RSSI value from phones nearby.

In principle, we need to enable scan request notification, then we can collect the rssi value of the phone.

case BLE_GAP_EVT_SCAN_REQ_REPORT:

rssi = p_ble_evt->evt.gap_evt.params.scan_req_report.rssi;

But I'm having problems with both SDK V11 and V15 to enable scan request notification.

I'm using SoftDevice s132 with nRF52DK.

SDK V11: I added the following lines durinhg the initialization (copied from another thread):

uint32_t opt_id = BLE_GAP_OPT_SCAN_REQ_REPORT;
ble_opt_t ble_options;
ble_options.gap_opt.scan_req_report.enable = 1;
ble_stack_init();
err_code = sd_ble_opt_set(opt_id, &ble_options);
But when I added those lines, the device doesn't advertise at all.
It will advertise again once those lines are removed.

SDK V15: I set scan_req_notification to 1 in advertising_init(): adv_params.scan_req_notification = 1;
I used the phone to scan and detect, then pair with the device.
From the terminal I can see those activities(connect, connection secured, etc..
But I don't see any activity at case BLE_GAP_EVT_SCAN_REQ_REPORT in ble_evt_handler.

I would appreciate suggestions to this issue. Thanks.

Parents
  • Hi,

    Sorry for the late reply.

    Y̶o̶u̶ ̶c̶a̶n̶ ̶s̶e̶t̶ ̶i̶t̶ ̶i̶n̶ ̶a̶d̶v̶e̶r̶t̶i̶s̶i̶n̶g̶_̶i̶n̶i̶t̶() by:adding the line  m_advertising.adv_params.scan_req_notification = 1;

    or you can also do it directly in ble_advertising.c by addling  adv_params.scan_req_notification = 1; to the ble_advertising_init function

    Jared

Reply
  • Hi,

    Sorry for the late reply.

    Y̶o̶u̶ ̶c̶a̶n̶ ̶s̶e̶t̶ ̶i̶t̶ ̶i̶n̶ ̶a̶d̶v̶e̶r̶t̶i̶s̶i̶n̶g̶_̶i̶n̶i̶t̶() by:adding the line  m_advertising.adv_params.scan_req_notification = 1;

    or you can also do it directly in ble_advertising.c by addling  adv_params.scan_req_notification = 1; to the ble_advertising_init function

    Jared

Children
Related