Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

12/5000 How to reduce and get stable connection time?

We have set the peripheral ADV interval & central SCAN interval as below configs, we found that the connection time is unstable,  from 125ms  to 980ms, we expect to get a stable connection time < 200ms.

Could you help to support how to achieve this goal ? Thanks a lot.

Configs:

#define APP_ADV_INTERVAL 64 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */
#define APP_ADV_TIMEOUT_IN_SECONDS 40 /**< The advertising timeout (in units of seconds). */

#define SCAN_INTERVAL 16//0x00A0 /**< Determines scan interval in units of 0.625 millisecond. */
#define SCAN_WINDOW 8//0x0050 /**< Determines scan window in units of 0.625 millisecond. */
#define SCAN_TIMEOUT 0x0000 /**< Timout when scanning. 0x0000 disables timeout. */

Connection time logs:

[00000769] <info> app: Connected
[00000315] <info> app: Connected
[00000470] <info> app: Connected
[00000177] <info> app: Connected
[00000176] <info> app: Connected
[00000144] <info> app: Connected
[00000395] <info> app: Connected
[00000442] <info> app: Connected
[00000215] <info> app: Connected
[00000211] <info> app: Connected
[00000173] <info> app: Connected
[00000538] <info> app: Connected
[00000125] <info> app: Connected
[00000167] <info> app: Connected
[00000268] <info> app: Connected
[00000352] <info> app: Connected
[00000980] <info> app: Connected
[00000204] <info> app: Connected
[00000173] <info> app: Connected
[00000342] <info> app: Connected
[00000522] <info> app: Connected
[00000216] <info> app: Connected
[00000625] <info> app: Connected
[00000363] <info> app: Connected
[00000733] <info> app: Connected
[00000227] <info> app: Connected
[00000225] <info> app: Connected

Parents
  • FormerMember
    0 FormerMember

    The reason for the long connection setup time is  that the advertising interval is a multiple the scan interval. When they are a multiple of each other, you risk that the advertiser "always" will advertise when the scanner isn't scanning. If they are not a multiple of each other, the relative timing between when  the scanning and advertising will change, and thus the connection will be initiated faster.

Reply
  • FormerMember
    0 FormerMember

    The reason for the long connection setup time is  that the advertising interval is a multiple the scan interval. When they are a multiple of each other, you risk that the advertiser "always" will advertise when the scanner isn't scanning. If they are not a multiple of each other, the relative timing between when  the scanning and advertising will change, and thus the connection will be initiated faster.

Children
No Data
Related