Why does lower high_scan_interval cause failure to connect?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

When we lower high_scan_interval, centrals gets ad received callback sooner.

But if we lower it too much, when central attempts connection (starts connUP), it gets no connUP callback.

If below 48, then faster scans but no connUP.

At 48, connUP.  Scan for ad is < 1 second.

At > 48, connUP, but scan times take longer.

At 96, scan for ad from our peripherals takes up to 5 seconds.

How does high_scan_interval at central affect connection to peripheral ??

$64,000 question:

Can we set high_scan_interval low (=1) just before we scan for peripheral ads,

and then set it high (=48) just before we connect to a peripheral, to make everything work faster????

Thanks!

0 Likes
1 Solution

Interval is how often to start scan of window duration.  If interval is 100 and window is 10 the device will be listening for 10 slots and go to sleep for 90 slots.  Then listen for 10 slots then go to sleep for 90...  Its all depends on your latency requirements and power consumption requirements.

View solution in original post

0 Likes
5 Replies
VictorZ_46
Employee
Employee
5 comments on blog 25 sign-ins 250 likes received

Setting interval less than a scan window does not make much sense and is not allowed in the spec.  Yes, you can modify

        blecen_cen_cfg.high_scan_interval,
        blecen_cen_cfg.high_scan_window,

before initiating any scan or any connection.  You should probably stop scan before attempting connection.  If your device spends all time scanning it does not have time to do anything else.  Please note that time to create connection will depend on how often your peripheral sends advertisements.  Even if you are listening all the time and peer sends advertisements once per 2 seconds, it still will take you up to 2 seconds to see the advertisement. 

Anonymous
Not applicable

Is it safe to do stop scan command from within the ad received callback?

I'm worried about doing commands to start actions from within callback functions (start/stop scan, start/stop connUp/connDown).   Is this safe?

0 Likes

It should be ok.

0 Likes
Anonymous
Not applicable

The problem was me lowering interval size below window size, because I didn't understand the two.

Interval is how many slots WITHIN window to be listening (scanning).

QUESTION:

are there advantages and risks to other configurations, like:

   interval=10 and window = 20

or:   interval = 1 and windows = 2

???

0 Likes

Interval is how often to start scan of window duration.  If interval is 100 and window is 10 the device will be listening for 10 slots and go to sleep for 90 slots.  Then listen for 10 slots then go to sleep for 90...  Its all depends on your latency requirements and power consumption requirements.

0 Likes