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

Can you use scan response as an acknowledgment on peripheral device?

Can a peripheral device know when the client made a scan response request? I want to use scan response as a form of acknowledgment so the peripheral device knows that the client got the payload data in the advertising and scan response packets.

I am using the nRF5 SDK and want to know if there is any flag or variable that would change on the peripheral device when the scan response request is made from the client.

Parents
  • There are 3 aspects:

    1. Yes, APP on nRF5x on top of Soft Device running GAP Peripheral role will get event when there is active scanning (See BLE_GAP_EVT_SCAN_REQ_REPORT and ble_gap_evt_scan_req_report_t in S132 Soft Device API documentation). As you see there is Scanner's MAC address and RSSI visible to GAP Peripheral app.
    2. However you won't get any callback before SCAN_RSP packet is issued by the stack so you cannot change SCAN_RSP packet structure based on Scanner's MAC or other parameter, that must be set before Adv. interval occurs.
    3. In general Advertising and Scanning are not suited for acknowledged link and unless the point 1 above solves your problem then you would need to choose some open source stack (e.g. Zephyr or Mynewt projects) and try to manage SCAN_RSP data modification within these few microseconds you have between SCAN_REQ and SCAN_RSP. But that seems close to impossible.

    Cheers Jan

  • You doesn't seem to be so much confused. Your idea make sense, you will not get full reliability or bi-directional link (that is possible only through connection) but what you propose is basically simulating what BLE is doing on LL layer during connection. I would say that using connection should be always preferred but you might achieve better power consumption with what you describe (definitely lower bandwidth and only one-way data transfer and only simple ACK in opposite direction).

    To your problem with BLE_GAP_EVT_SCAN_REQ_REPORT: you need to enable reporting from Soft Device first through SV (SD API) call. See this description(but make sure you use correct construction depending on SD type and version you are using).

Reply
  • You doesn't seem to be so much confused. Your idea make sense, you will not get full reliability or bi-directional link (that is possible only through connection) but what you propose is basically simulating what BLE is doing on LL layer during connection. I would say that using connection should be always preferred but you might achieve better power consumption with what you describe (definitely lower bandwidth and only one-way data transfer and only simple ACK in opposite direction).

    To your problem with BLE_GAP_EVT_SCAN_REQ_REPORT: you need to enable reporting from Soft Device first through SV (SD API) call. See this description(but make sure you use correct construction depending on SD type and version you are using).

Children
No Data
Related