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

Device Name Missing from Advertising Response

I'm trying to build a quick application to scan for all devices in the vicinity and print out their details (device name, manf data, RSSI, and BLE address). I am parsing the p_scan_evt->params.p_not_found object to do this. It looks like it's working to read manufacturing info and address of all devices, however the packets appear to be missing the device name. The length of the data packet confirms this.

If I scan in the nRF Connect Android app, I am able to verify the same data my nRF52 does, but the raw advertising packet data has additional data. It contains the buffer the nRF52 sees and the device name in addition.

Do I need to issue a scan request from the device? If so how do I do that? I tried to handle the NRF_BLE_SCAN_EVT_SCAN_REQ_REPORT event but I never enter that case.

Any other suggestions?

static void scan_evt_handler(scan_evt_t const * p_scan_evt)
{
    ret_code_t err_code;

    switch(p_scan_evt->scan_evt_id)
    {
         case NRF_BLE_SCAN_EVT_NOT_FOUND:
             device_found(p_scan_evt->params.p_not_found);
             break;

          case NRF_BLE_SCAN_EVT_SCAN_REQ_REPORT:          
              NRF_LOG_INFO("--------------------- SCAN REQ--------------");
              break;
    }
}

Parents
  • Hi again

    Thank you for specifying. I didn't realize you were developing the scanning device, sorry about that. In that case, you can check out the ble_app_uart_c example, and its ble_evt_handler, which handles the received advertising data.

    If your peripheral and central connect "right away" like the ble_app_uart and ble_app_uart_c examples do, that might be the reason you don't get the scan response, as the devices might connect before a scan response is sent at all. 

    Best regards,

    Simon

Reply
  • Hi again

    Thank you for specifying. I didn't realize you were developing the scanning device, sorry about that. In that case, you can check out the ble_app_uart_c example, and its ble_evt_handler, which handles the received advertising data.

    If your peripheral and central connect "right away" like the ble_app_uart and ble_app_uart_c examples do, that might be the reason you don't get the scan response, as the devices might connect before a scan response is sent at all. 

    Best regards,

    Simon

Children
Related