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

    Have you defined a device name, included the device name in your gap_params_init(), and set the advdata.name_type to BLE_ADVDATA_FULL_NAME in your advertising_init()? You can, for example, see the ble_app_uart example for reference as to how to set up your device to advertise with its name.

    If it doesn't appear in your advertising packet after these steps are in order, that means that the advertising packet is filled up, and does not have room for the device name, in which case you will have to either cut some of the advertising data or add scan response data with the additional information (like the device name). The ble_app_uart also includes scan response data as seen in the srdata calls in advertising_init(). You can also check out the BLE service tutorial for details on how to add scan response data to your advertisements.

    Best regards,

    Simon

Reply
  • Hi

    Have you defined a device name, included the device name in your gap_params_init(), and set the advdata.name_type to BLE_ADVDATA_FULL_NAME in your advertising_init()? You can, for example, see the ble_app_uart example for reference as to how to set up your device to advertise with its name.

    If it doesn't appear in your advertising packet after these steps are in order, that means that the advertising packet is filled up, and does not have room for the device name, in which case you will have to either cut some of the advertising data or add scan response data with the additional information (like the device name). The ble_app_uart also includes scan response data as seen in the srdata calls in advertising_init(). You can also check out the BLE service tutorial for details on how to add scan response data to your advertisements.

    Best regards,

    Simon

Children
  • Hi Simon, thanks for the info, that gives me a few things to look into.

    That being said, I'm actually not working on the peripheral device at all just the scanner so I don't have control over what data is being advertised.

    I think the crux of the issue is that I can see all the fields in the nRF Connect Android app, but not with my nRF52 scanner. So the device must be advertising correctly, however I'm unable to read all the data from it correctly.

Related