how to set the connection interval and timeout

Hi there,

I have developed an APP on android with flutter and ble_reative package. I am using the notification mode and the communication between our sensor (via nRF52840 eval board) and the APP is all right.


Now it is time to optimize the round trip time (RTT), one effort is to reduce the connection interval. But no matter which mode we choose in the ble_reactive, the connection interval is always 50ms in end of the connection stage.

for example, when we look for a shorter connection interval by using the following in APP:

    _ble.requestConnectionPriority(deviceId: _deviceId, priority: ConnectionPriority.highPerformance);

The printed logs from the 52840 is:

sensor login user
sensor login service
Connection parameters updated: interval 7.500 ms, latency 0 intervals, timeout 5000 ms
MTU exchanged tx=247 rx=247 -> max notification 243 bytes
Connection parameters updated: interval 50.000 ms, latency 0 intervals, timeout 5000 ms
Connection parameters updated: interval 15.000 ms, latency 0 intervals, timeout 5000 ms
Notification has been turned on
Connection parameters updated: interval 50.000 ms, latency 0 intervals, timeout 5000 ms

From there we can see the connection interval on the board was set as 7.5ms in the begining, but then is changed to 50 ms in the end, we suspect the board has a mechanism to adapt the connection interval, but i don't know how and where to manipulate it.

By the way, I also tried to set the timeout parameter in the ble_reactive function 'connectToDevice', but it doesn't work. 

I appreciate any hints! Thanks!

Parents
  • Hi,

    Which version of the SDK do you use?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd, sorry for the confusions.

    I said in the previous reply that I noticed the connection interval is successfully set, but it is not true. The last line of log appears one second latter (I didn't notice it yesterday somehow), which shows the interval is restored to 50 ms.





    The ble_reactive commands I used is: 

    _ble.requestConnectionPriority(deviceId: _deviceId, priority: ConnectionPriority.highPerformance);

    afterwards I called commands to stop scanning.

    My question is, does Nordic BLE or zephyr have some mechanism to adjust the interval back to 50 ms? or is this 50ms interval by default but could be changed with certain macros?

    I appreciate any suggestions.

    thanks!

Reply
  • Hi Sigurd, sorry for the confusions.

    I said in the previous reply that I noticed the connection interval is successfully set, but it is not true. The last line of log appears one second latter (I didn't notice it yesterday somehow), which shows the interval is restored to 50 ms.





    The ble_reactive commands I used is: 

    _ble.requestConnectionPriority(deviceId: _deviceId, priority: ConnectionPriority.highPerformance);

    afterwards I called commands to stop scanning.

    My question is, does Nordic BLE or zephyr have some mechanism to adjust the interval back to 50 ms? or is this 50ms interval by default but could be changed with certain macros?

    I appreciate any suggestions.

    thanks!

Children
Related