Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Accuracy of advertising duration and BLE_GAP_EVT_ADV_SET_TERMINATED

Hello,

Using sd_ble_gap_adv_set_configure() with ble_gap_adv_params_t I observe that the actual time when the BLE_GAP_EVT_ADV_SET_TERMINATED event is raised is earlier to the duration that I specified in ble_gap_adv_params_t.

For example if i set duration to 2000ms (duration set to 200) and the interval to 500ms, the terminated event comes after around 1517ms... or if I use a duration of 2000ms and interval of 1000ms, the terminated event may come after 1007ms... if i use smaller values for interval, the timeout gets more accurate.

It seems the SoftDevice is stopping the advertising as soon as no next beacon fits into the duration time span... i just wanted to confirm this understanding with someone who has insight into the SoftDevice to make sure I don't have it wrong. Thanks.

Parents
  • Hello,

    Yes, the advertising set will get terminated after the last advertising event has been processed by the stack. Also, the reason you got 3 and not 4 packets with the duration set to 2000 ms is that each adv. event are prefixed with a random 3-13 ms delay as required by the spec, so the actual interval ends up being between 503-513 ms (see  "Advertiser timing").

    Best regards,

    Vidar

       

Reply
  • Hello,

    Yes, the advertising set will get terminated after the last advertising event has been processed by the stack. Also, the reason you got 3 and not 4 packets with the duration set to 2000 ms is that each adv. event are prefixed with a random 3-13 ms delay as required by the spec, so the actual interval ends up being between 503-513 ms (see  "Advertiser timing").

    Best regards,

    Vidar

       

Children
No Data
Related