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

Custom Scan Request, Scan Response

Dear Nordic Team and Community!

I have again a question concerning advertising. Currently I am working with the devices nRF52840Dongle (Advertising, S140, 10059) and nRF52840DK (Scanning, S140, 10056). My advertising works / should work like the following structure, because I want to save energy:

Currently, step 1 and step 2 are implemented. Now I want to:

  1. send on the Scanner Side (Step 3) a custom scan request with custom data
  2. read this data on the Advertising Side (Step 4) with a report
  3. send no scan response on the Advertising (Peripheral) Side

Is this possible? How can I read the Scan Request? How can I jump over the Scan Response?

Thank you for your help!

Kind Regards

Parents
  • Hello,

    Is this possible? How can I read the Scan Request? How can I jump over the Scan Response?

    I get the impression from your diagram that you intend to transfer data from the central to your peripheral through the scan request, is this correct?
    If so, please know that the Scan Request packet can not contain any custom data payload.
    This is a result of the BLE Specification, which defines scan requests to only contain the address of the scanner and the address of the receiver. You may read more about this in the BLE Core specification Version 5.2, VOL 6, Part B, Section 2.3.2. Note the last line of section 2.3.2.1, which notes that these scan request payloads contains no host data, which is why it is handled completely by the SoftDevice. 

    send no scan response on the Advertising (Peripheral) Side

    If I understand you correctly and you wish to not send a scan response packet from your peripheral, then you can advertise as NONSCANNABLE, which will mean that the peripheral does not listen for a scan request following an advertisement.

    My advertising works / should work like the following structure, because I want to save energy:

    Is power saving the reason why you would like to communicate through advertisements rather than over a connection?
    If so, please know that you can set the connection interval to up to 4 s, which may end up saving you power compared to the advertisements - since advertisements are in no way acknowledged, and data may therefore be lost.

    Please do not hesitate to ask if any part of this still should be unclear!

    Best regards,
    Karl

Reply
  • Hello,

    Is this possible? How can I read the Scan Request? How can I jump over the Scan Response?

    I get the impression from your diagram that you intend to transfer data from the central to your peripheral through the scan request, is this correct?
    If so, please know that the Scan Request packet can not contain any custom data payload.
    This is a result of the BLE Specification, which defines scan requests to only contain the address of the scanner and the address of the receiver. You may read more about this in the BLE Core specification Version 5.2, VOL 6, Part B, Section 2.3.2. Note the last line of section 2.3.2.1, which notes that these scan request payloads contains no host data, which is why it is handled completely by the SoftDevice. 

    send no scan response on the Advertising (Peripheral) Side

    If I understand you correctly and you wish to not send a scan response packet from your peripheral, then you can advertise as NONSCANNABLE, which will mean that the peripheral does not listen for a scan request following an advertisement.

    My advertising works / should work like the following structure, because I want to save energy:

    Is power saving the reason why you would like to communicate through advertisements rather than over a connection?
    If so, please know that you can set the connection interval to up to 4 s, which may end up saving you power compared to the advertisements - since advertisements are in no way acknowledged, and data may therefore be lost.

    Please do not hesitate to ask if any part of this still should be unclear!

    Best regards,
    Karl

Children
  • Thank you for your very fast response. I have already experimented with different advertising intervals and these structure should save even more power.

    I see, that my current system must be adapted and I have already some ideas which I might share in the future for others, if I have some success with that. 

    Unfortunately I have an other question concerning the scan request, I hope, I don't take too much time.

    I know, that it is possible to read the Scan Request on the peripheral/beacon/dongle, even if I cannot modify it. This should be possible with the case: (S140, nRF52840Dongle, 10059)

    case: BLE_GAP_EVT_SCAN_REQ_REPORT

    For testing purposes I switched back to a demo example (ble_app_blinky) to do not destroy my current project. Although I tried many suggestions from different posts, I am not able to receive the Scan Request Report (the case doesn't trigger).

    On the Central/Scanner Side I

    • activated active Scanning by setting it to 1
    • sending scannable packages

    On the Peripheral/Advertising Side I

    • activated scanning reports (adv_params.scan_req_notification = 1)
    • added the case

    Maybe you know anything that I have forgotten or other reasons for my problem.
    Thank you for your time and the nice support!

    Kind Regards

  • In ble-advertising.c in ble_advertising_start(() please try add green line:
    case BLE_ADV_MODE_FAST:
    p_advertising->adv_params.scan_req_notification = 1;
    ret = set_adv_mode_fast(p_advertising, &p_advertising->adv_params);
    break;

    Regards

    Andrzej

Related