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

ble_app_hrs connection timeout

Hello,

I am testing the ble_app_hrs project on two eval boards, with s110 and s120. Everything works. If I power-off the peripheral board (s110), it seems that the master board restart scanning around 5 seconds later. Is there a way to restart scanning earlier ? What is the shortest time ?

Thanks,

Olivier

Parents
  • I have read it ten times ...

    Please, can you provide me values in order to solve my use case: as soon as (few ms) the peripheral is power on, the Central connect to it (connection led on) as soon as (few ms) the peripheral is power off, the Central connect to it (scanning led is on)

    In peripheral side I have: #define MIN_CONN_INTERVAL MSEC_TO_UNITS(500, UNIT_1_25_MS) #define MAX_CONN_INTERVAL MSEC_TO_UNITS(1000, UNIT_1_25_MS) #define SLAVE_LATENCY 0
    #define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)

    In central side I have: #define CONN_MNGR_MIN_CONNECTION_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) #define CONN_MNGR_MAX_CONNECTION_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS) #define CONN_MNGR_SLAVE_LATENCY 0 #define CONN_MNGR_SUPERVISION_TIMEOUT 4000

Reply
  • I have read it ten times ...

    Please, can you provide me values in order to solve my use case: as soon as (few ms) the peripheral is power on, the Central connect to it (connection led on) as soon as (few ms) the peripheral is power off, the Central connect to it (scanning led is on)

    In peripheral side I have: #define MIN_CONN_INTERVAL MSEC_TO_UNITS(500, UNIT_1_25_MS) #define MAX_CONN_INTERVAL MSEC_TO_UNITS(1000, UNIT_1_25_MS) #define SLAVE_LATENCY 0
    #define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)

    In central side I have: #define CONN_MNGR_MIN_CONNECTION_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) #define CONN_MNGR_MAX_CONNECTION_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS) #define CONN_MNGR_SLAVE_LATENCY 0 #define CONN_MNGR_SUPERVISION_TIMEOUT 4000

Children
  • There is no magical values that I can give you that will suddenly solve your problem exactly the way you want. You will have to understand the parameters involved, and tune them for your use case.

    As far as I can see from the snippets you post here, you haven't changed the connection supervision timeout, which "determines the timeout from the last data exchange till a link is considered lost", as explained in the question I linked to. To get a quicker disconnect event to your application, you'll therefore have to reduce this.

    Also, your snippets seem to indicate that the connection interval you use on the Central side is outside the parameters that the Peripheral requests. This will hence most likely cause an error from ble_conn_params module after it has tried requesting new parameters the configured number of times. You should make sure that the connection parameters you connect with from the Central side are within what the Peripheral wants, or make sure that you handle the Connection Parameter Update Procedure. You can take a look at this MSC to see what events you get from the S120 when this happens: https://devzone.nordicsemi.com/documentation/nrf51/5.1.0/html/a00885.html

Related