Updating BLE connection interval back and forth takes too much on KW38

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Updating BLE connection interval back and forth takes too much on KW38

1,715件の閲覧回数
FedericoWegher
Contributor III

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

0 件の賞賛
返信
2 返答(返信)

1,673件の閲覧回数
anca_codreanu
NXP Employee
NXP Employee

Hi @FedericoWegher ,

I reproduced the issue that you reported and I opened an internal discussion. I will come back with updates.

Best regards,

Anca

0 件の賞賛
返信

1,637件の閲覧回数
anca_codreanu
NXP Employee
NXP Employee

Hi @FedericoWegher ,

According to Core Spec, in a procedure which involves a PDU with an Instant field the master should allow a minimum of 6 connection events that the slave will be listening for before the instant occurs.

instant.PNG

 

LL_CONNECTION_UPDATE_IND does have an Instant field so a delay of minimum 6 connection intervals should be expected.

In our implementation, a delay of 15 connection interval was chosen. You will receive an improved version of controller library which will use the minimum delay possible in accordance with specification(6) in top of MR2 release.

If you need more details please let us know.

Best regards, 

Anca

0 件の賞賛
返信