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

Scanning at low priority / pre-emptive scan?

I have some question about the scan timing, referring to the documentation here: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s132%2FSDS%2Fs1xx%2Fmultilink_scheduling%2Fscanner_timing_primary_channel.html

I am working on a design where the central needs to support multiple connections and stream lots of data. The setup is just like shown in Figure 2. Scanner timing - one or more connections as a Central in the infocenter page linked above.

Based on the documentation, I have understood that when a scan window is started the scan will always run for the given time, even if it would mean that it is overlapping with the upcoming connection events. In my own tests so far I noticed that using a relatively large scan window (250ms) will have a big impact on the throughput of the existing connections.

The question: is there any way to configure the scan so that it is done in a "best effort" fashion, so that the scan window would be interrupted to make room for connection events?

In my app, the first priority is to maintain steady throughput for existing connections. The central has a fixed number of peripherals it needs to talk with. In steady state, the scanning will be completely off. However, if one of the connections is dropped then the central needs to turn scanning back on to be able to restore the connection. In this scenario, the reconnection delay is not that important. The target is that there should be as little impact to the other connections as possible.

Any ideas?

Parents
  • Hi,

    For the scanning to have minimum impact on the current connections, I recommend to set scan window and interval to small values, e.g. 10ms / 10ms. The scanning will then be interleaved between active connections. This is because typically connections will have longer interval, and thereby will be able to schedule the next "slot" well ahead of when scanning will try to request the same "slot".

    Best regards,
    Kenneth

Reply
  • Hi,

    For the scanning to have minimum impact on the current connections, I recommend to set scan window and interval to small values, e.g. 10ms / 10ms. The scanning will then be interleaved between active connections. This is because typically connections will have longer interval, and thereby will be able to schedule the next "slot" well ahead of when scanning will try to request the same "slot".

    Best regards,
    Kenneth

Children
  • Ok, thanks for the fast answer. Just to verify: the 10ms/10ms scan timing means that the scan window will start at most every 10 ms? 

    If I understood right, the connection events will take higher priority and the scan is executed after connection events are handled. That would mean the actual scan interval will be much smaller than 10ms, depending on how many active connections there are. ?

  • There is no logic in the softdevice that reduce the size of the scan window or interval due to connection events. The scan event will once scheduled allocate the entire scan window. The next scan window is calculated after the previous scan window is finished, if the next calculated scan window is already taken by a connection event, then the scan window is skipped by one scan interval period (or several periods if there are multiple connections that may be active).

    By having shorter scan window and intervals than connection intervals, the connection intervals will always be able to schedule the next connection event before it can be used by the scan event.

  • Ok thank you very much, this is clear now. 

Related