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.

Device disconnects before supervision timeout cc2541

Other Parts Discussed in Thread: CC2541, CC2650

Hi all,

can anyone please suggest me if there is any way to retain connection for up to 10-15sec when peripheral is busy in doing some analog processing continuously disabling all interrupts?

Here are some of my connection related defined parameters

#define DEFAULT_DESIRED_MIN_CONN_INTERVAL     10
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL    12   //set low value to increase the data throughput
#define DEFAULT_DESIRED_SLAVE_LATENCY            0
#define DEFAULT_DESIRED_CONN_TIMEOUT              1000

Suppose i want to record voice for about 5sec continuously but as supervision timeout has been set to 10 sec, so as expected it should not disconnect before 10sec because after 5sec i am stopping my voice recording and peripheral is available to continue its own stack process.

But what actually i am realizing is device disconnects after 2-4sec after i have started my recording.

1)Am i missing something? Is there any connection API which i can send just after my 5sec analog processing so that it can directly connect with central device and retain the connection. If needed i can store the central device MAC address.

2)I am not sure if this supervision timeout is defined for central(mobile in my case) device also?

  • No, this is not possible with the cc2541. It uses a single-threaded non-preempted processing loop. So if the application (or anything) is processing or disabling interrupts for longer than one connection event, the controller will not be able to process to wake up for the connection event, it won't recover, and the connection will drop.

    This will be possible with the CC2650 since it uses an RTOS. However, you still won't be able to disable interrupts since they are still needed to wake up the controller for connection events.
  • Hi,
    Thanks for your reply.
    1)What if i increase slave latency to 15? As per the definition in software developer guide, peripheral will skip the number of connection event slave latency has been set. So according to above set parameters for connection, up to 150ms connection should not drop but for this its necessary that i should not disable interrupt as per your explanation. Will i be able to achieve this?

    2)If max connection event is 4sec then how supervision timeout can be functional for 32 sec? Or is it not applicable to CC2541?

    3)If not possible, i will have to drop the connection because i have more concern about recorded voice quality. And for this i will have to disable the interrupt while recording. I want to know after i have done my analog processing, i will enable interrupt other than this what i need to do so that peripheral starts advertising as soon as possible so that it can connect with the central in as less time as possible.