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

Slow connect in a SDK15 previously bonded peripherial device.

Hi!

I have SDK15 central (nRF52832) with previously bonded peripherial device also SDK15 (nRF52810).

All works. But sometime when power on on the peripherial device, connect establish up to 5 seconds. 

In a LOG central i see next:

0> <info> app: Starting scan.
0> <info> app: Connected ble_advertising.
0> <info> app: Connected to a previously bonded device.

In the debugging of central I have also debug in a BLE_GAP_EVT_ADV_REPORT case.

Switch on peripherial device and see above logs on the central device:

up to 5 seconds pause, when I get BLE_GAP_EVT_ADV_REPORT event, right next 

0> <info> app: Connected ble_advertising.
0> <info> app: Connected to a previously bonded device.

Why I have this delay for connect? Scan windows is:

#define SCAN_INTERVAL   0x00A0 
#define SCAN_WINDOW    0x0096
#define SCAN_DURATION 0x0000
#define SCAN_DURATION_WITELIST 0x0000

Also I have same project on a SDK13, and there is no same behavior- connect establish right after power on peripherial device.

Parents Reply Children
  • The Scanner interval and window you are using 

    Scan interval: 100ms (160 * 0.625ms)

    Scan window: 98.75ms (158 * 0.625ms) 

    means that you are effectivly scanning for 98,75% of the time, there is a 1,25ms gap between the end of one scan event and the start of the next. In addition there is also some time that the SD needs to reconfigure the RADIO frequency when swiching channels.  So if you want to increase the time it take to connect you will have to decrease the advertisement interval on the peripheral side. 

    Best regards

    Bjørn

  • Thanks, therefore, next step to increase connect time- more fast advertise on peripherial side? For ex. rfom 1 s to 500 ms? Is there all possibility to increase connect time of central?

  • Yes, reducing the advertisement interval to 500ms should result in a faster connection establishment. The timing on the central side is fixed, as stated before, a central will wait for the second adv. packet before sending the actual conn.request. After that the central and will exchange packets to exchange link layer features, agree on connection interval, etc. You can try to lower the connection interval and then increase after the connection and service discovery phase is complete. 

Related