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

How to read every seconds in Scan Response data in ble_app_uart_c

Hello everyone,

How to read Scan Response in contentiously in every 5 seconds in my ble_app_uart_c. i can advertise ibeacon and Scan Response data both in same code but receiver side i can't able to read scan response data in my central ble_app_uart_c code. please suggest any example code for read Scan response data. I'm using NRF52832 SDK15.2. 

Parents Reply
  • thanks for replaying Kenneth,

     I used SDK15.0 how to use this p_ble_evt->evt.gap_evt.params.adv_report.type.scan_response;

    in my code

            case BLE_GAP_EVT_ADV_REPORT:
                on_adv_report(&p_gap_evt->params.adv_report);
    				p_ble_evt->evt.gap_evt.params.adv_report.type.scan_response;
                break; // BLE_GAP_EVT_ADV_REPORT

    It shows error in my code how to use it in exactly working function

Children
  • The p_ble_evt->evt.gap_evt.params.adv_report.type.scan_response will tell whether the received advertisement report is a scan response or not. So you typically will receive two BLE_GAP_EVT_ADV_REPORT if there is a scan response available, e.g.:

    if(p_ble_evt->evt.gap_evt.params.adv_report.type.scan_response == 0)
    //This is an advertisement packet

    if(p_ble_evt->evt.gap_evt.params.adv_report.type.scan_response == 1)
    //This is an scan response packet

    Best regards,
    Kenneth

  • I have to set  ble_gap_scan_params_t .active   = 1, in my ble_app_uart_c code for scan request from central it send scan request i checked in my sniffer tool but my central can't read response data

    this condition not satisfied in my code

    if(p_ble_evt->evt.gap_evt.params.adv_report.type.scan_response == 1){

    }

    is any function need to enable for read scan response data. please share exactly working example code 

Related