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.

Faster way to dynamically switch connection interval?

Other Parts Discussed in Thread: CC2541

Hi,

I have a project that requires that the software running on the CC2541 dynamically switch between a 1-second connection interval to a 100-millisecond connection interval.  The switching works using the GAPRole_SendUpdateParam function.  But the problem is it takes too long to switch from 1-second connection interval to 100-millisecond connection interval.  I am using the BLE stack 1.4 and connecting to an iPhone 4S running iOS 7.1.  Right now it takes around 16-20 seconds to switch the connection interval.

Is there any way to make the switching go faster?


Leo

  • Hi Leo,

    There is nothing to be done about this, because the spec says the update needs to happen at least 6 'instances' in the future. In addition to the message transaction related to establishing the new parameters this can take a while with 1s interval.

    BR,
    Aslak

  • Hi Aslak,

    Thanks for the info.  If it is not that much of an inconvenience on your part, could I ask which section and page number that information is located in the Bluetooth Spec v4.1 document?

    Regards,
    Leo

  • Aslak,

    Assuming that the goal here is to extend battery life of the peripheral, can the parameter update simply be the slave latency? Would setting a connection interval of 100ms and then changing the slave latency from 10 to 0 make the transition faster? If so, do you know how much faster this could be?

    Thanks,
    Erick
  • Hi Leo,

    This is on page 2552 of the spec, Vol 6, Part B, Section 5.1.2

    BR,
    Aslak
  • Erick,

    When the connection interval and slave latency is low, switching will be fast. If long, switching will take longer.

    You can use the API HCI_EXT_SetSlaveLatencyOverrideCmd(HCI_EXT_ENABLE_SL_OVERRIDE) to temporarily disable slave latency (i.e. device wakes up on each event as if SL==0).

    Best regards,
    Aslak
  • Ok so I just ran a test using BTool/Dongle to update parameters of a peripheral device and I figured I'd share this information.

    Using Adv. Command GAP_UpdateLinkParamReq with intervalMin and intervalMax set to 80, I tested how long it would take to transition from slave latency of 10 to a latency of 0 (Effective Conn. Interval from 1s to 100ms).

    Average time it took to complete was 1.622 seconds over 10 tests.

    Keeping latency constant at 0 and transitioning from intervalMin/intervalMax of 800 to intervalMin/intervalMax of 80 took approx. 6.5 seconds each time.
  • Hi,

    In the case where the Central is the iOS device, the best way to see what is going on is to take a sniffer trace. You can then see the parameters that the peripheral is requesting, and the new values (if accepted) that are being sent by the iOS/Central device. That will at least provide some context.

    Best wishes