Hello.
I am using KW38 BLE with SDK 2.6.6 on both central and peripheral devices. The central device is used to update connection interval with the following function:
void BleApp_SetConnectionInterval(deviceId_t peerDeviceId, uint32_t interval)
{
uint16_t timeout;
timeout = interval * 5 / 10U;
interval /= 1.25;
Gap_UpdateConnectionParameters(peerDeviceId, interval, interval, gConnReqParams.connLatency, timeout, gConnReqParams.connEventLengthMin, gConnReqParams.connEventLengthMax);
}
The central calls this function 3 times:
1) right after connection to peripheral: it sets interval to 600ms
2) after some time, upon an external event: it sets interval to 4 seconds
3) after 1 minute since case 2: it sets interval back to 600ms
The problem is that the third interval setting is applied after 30-40 seconds from function call!
Please notice:
- the connection interval is always updated properly in all 3 cases, because central receives the following event with success:
case gConnEvtParameterUpdateComplete_c:
{
if (connectionEvent->eventData.connectionUpdateComplete.status == gBleSuccess_c)
{
LOG_I("connection parameters updated: interval %d, timeout %d", connectionEvent->eventData.connectionUpdateComplete.connInterval, connectionEvent->eventData.connectionUpdateComplete.supervisionTimeout);
}
}
The problem is that it takes so long to get this event!
- Peripheral is set to always accept incoming update requests, by setting
/* Accept/refuse connection updates automatically */
#define gConnUpdateAlwaysAccept_d 1
Question: how long should the connection parameter update take, in theory?
I think at most 1 old connection interval (for the command to go) + 1 new connection interval (for the response to be received). In case 3, I would expect about 4.6 seconds, not 40.
Thank you,
Federico