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

More information about "SKIP" and "TIMEOUT" parameters of BLE 5 advertising

Hi

I am working on an application that uses extended periodic advertising feature of BLE 5. In this sample (periodic sync):

https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/bluetooth/periodic_sync/src/main.c

There are two parameters, "skip" and "timeout" which are set before making the sync at receiver side.

sync_create_param.skip = 0;
sync_create_param.timeout = 0xa;
err = bt_le_per_adv_sync_create(&sync_create_param, &sync);

How these two parameters affect on making/termination of the sync? And what is the difference between these two?

As I can find in the documentation (of Zephyr), it describes these parameters as follow:

skip: Maximum number of periodic advertising events that can be  skipped after a successful receive.

timeout: Synchronization timeout for the periodic advertising sync.

It is not clear how the sync termination is determined, after "skipping maximum events (skip parameter)" or after "not receiving data for a while (timeout parameter)". How is it determined?

Parents
  • Hi,

    The synchronization is considered to be lost if the timeout time passes from the last successfully received periodic advertising packet.

    The skip parameter, on the other hand, allows the device to not listen for advertising events skip number of times, before it must do an attempt at listening again.

    The value of skip will be ignored (the device will listen for the advertising event anyway) if the timeout is about to run out.

    According to the Bluetooth Core specification, the valid range for skip is 0x0000 to 0x01F3. I did not find that range documented for the API call in nRF Connect SDK / Zephyr, and have filed an internal issue report.

    Regards,
    Terje

  • Thanks Terje for your fast reply.

    To clarify it, let's assume a periodic event which is 80ms, timeout is set to 200ms and skip=2, take a loot at below image.

    Now if three consecutive events are lost (for any reason are not received by the receiver), then does it timeout at point A (200ms after the last received packet), or it first skip 2 expected events and then timeout timer expires at point B which is then will not be terminated (a packet is received before timeout)?

    BR,

    Saleh

Reply
  • Thanks Terje for your fast reply.

    To clarify it, let's assume a periodic event which is 80ms, timeout is set to 200ms and skip=2, take a loot at below image.

    Now if three consecutive events are lost (for any reason are not received by the receiver), then does it timeout at point A (200ms after the last received packet), or it first skip 2 expected events and then timeout timer expires at point B which is then will not be terminated (a packet is received before timeout)?

    BR,

    Saleh

Children
  • Hi,

    The timeout should then be at point A, which is timeout (200 ms) after the last correctly received packet.

    Further, the device should listen for the advertising event at the starting point of the sketched timeout leading to point B, since waiting longer would mean waiting longer than the timeout.

    Note that using the interval and timeout from your example, the effective skip setting would be 1 for all skip values 1 or higher, since at most 1 advertising event could be skipped without overstaying the timeout.

    Note also that the advertiser itself should send advertisements on all advertising events.

    Regards,
    Terje

  • Thanks Terje,

    So as I can understand, "SKIP" parameter doesn't affect on sync termination, and only timeout parameter determines it.

    Then what is the advantages of using "SKIP"?

  • Hi,

    It could be beneficial for the listener to skip listening for certain amounts of time, in order to save power. It all depends on what contents is being broadcast and how much of it the listener needs.

    For instance, let's say we have a thermometer broadcasting the (indoor) temperature. If you want to track the general temperature development for logging and graphing, it may suffice with a couple of measurements per hour. For the purpose of controlling heating or air conditioning, on the other hand, you probably want much more frequent readings. So it all depends on the nature of the data, and the skip parameter allows you to tune the listener according to its needs.

    Now that was not a particularly good example, since for home automation you most likely want a secure mesh network such as Bluetooth mesh or Matter, and the involved devices are likely connected to mains power and so the power savings would be of no significance. But the point holds for similar relations involving battery operated listeners.

    Regards,
    Terje

  • Thanks a lot for your explanations

Related