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!

Related