This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Supervision timeout without effect

Other Parts Discussed in Thread: CC2541

Dears,

I try to use CC2541 devices in a mission critical application, where the data transfer must to be always active or in case of lost connection retry to reconnect. Currently, the peripheral device don't know when the central device turn off. In this case, when the central device restart, cannot reconnect to the device because is already in Connected state.

I'm using the BLEv1.4.0 in a Central & Peripheral application. I use a Keyfob as peripheral and a SmartRF05 board as Central.

In both devices, I use a supervision timeout of 1000ms:

#define DEFAULT_UPDATE_CONN_TIMEOUT           100

The central device is connected with the peripheral without problem. However, If the central device is turn OFF, the LED in the peripheral device continuing blinking. This will disconnect ~20 seconds later. Before that, the central device cannot reconnect with the peripheral device. 

However, in the following two (2) cases, the  the peripheral device will disconnect according with the supervision timeout (1000ms):

  • I use the method "GAPCentralRole_UpdateLink" in the central device after the connection is established.
  • I setup a notification in the peripheral device after the connection is established.

I have some questions:

- The value "DEFAULT_UPDATE_CONN_TIMEOUT" is used by the stack when the connection is established?

- Is required to update the link (GAPCentralRole_UpdateLink) every time that the peripheral is connected?

- There are other parameters that need to change? or this is an known issue?

Thanks for any advice,

JC

  • Hi Julio,

    The DEFAULT_UPDATE_CONN_TIMEOUT is only used if the DEFAULT_ENABLE_UPDATE_REQUEST is set to TRUE. This is feature related to function GAPCentralRole_UpdateLink. 

    GAPCentralRole_UpdateLink is needed when you want to update connection parameters on the fly (during connection). Note that the Central device can connect with defined GAP Parameters directly instead, have a look at GAP_SetParamValue(TGAP_CONN_EST_SUPERV_TIMEOUT, YourDesiredSupervisionTimeout); which you can define during the init, for example.

    Best Regards

    Joakim

  • Hello Joakim,

    Thanks for your suggestion. I used GAP_SetParamValue(TGAP_CONN_EST_SUPERV_TIMEOUT, 100); in the init funtion and now the peripheral device is disconnected after 1000ms.

    Regards

    Julio

  • Dear Joakim,

    I have an additional question. 

    I have many peripheral devices. When once of them shutdown I received the event "GAP_LINK_TERMINATED_EVENT" in the central device (1000ms after). If I want to restart again the connections with all the peripheral, which function you suggest to me use? Something that I can restart my application connection with all the peripherals.

    Right now, I try using the function "GAPCentralRole_TerminateLink" in all the devices, however I have some issues.

    Thanks,

    Julio

  • Hi Julio,

    On the central side, you will need to manually connect to each peripheral you want to establish a connection with. There are two way, either you scan for peripheral and you connect to them based on the advertising data or if you already know the addresses you can simply try to establish connection directly (without scanning)

    On the peripheral side, simply make sure that it's advertising once the connection is dropped.

    Best Regards

    Joakim