Does KW38 handle connection events during active scan window?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does KW38 handle connection events during active scan window?

1,718 Views
FedericoWegher
Contributor III

Hello.

I am using KW38 as central and peripheral devices. MCUXpresso SDK is 2.6.6.

The central is able to connect to up to multiple peripheral devices. The scan window is 1000ms, while the scan interval is 2000ms (scan duty cycle is 50%). The central is capable of connecting to multiple peripherals serially, where the flow is: scan is started, device found scan event is received, scan is stopped, connection is performed, and back to the beginning.

So, multiple connections are maintained in parallel during scanning. The connection interval is 600ms.

I am observing that, if I set supervisor timeout equal to 1220 seconds (something more that 2*connection interval), it can happen that connections times out. Instead, if I set it to 1830 (3*connInt), they do not time out.

I checked that, if scan is disabled after devices' connections, timeout does not occur.

So my question is: is KW38 capable of managing connections events during active scan window?

From my tests, it seems it does not: in worst case, inside a 1 second long scan window there could be up to 2 connection events. If they are not served, the third connection event will be. This means the supervisor timeout must be at least 3 * connection interval.  

Labels (1)
5 Replies

1,554 Views
anca_codreanu
NXP Employee
NXP Employee

Hi @FedericoWegher,

I did some tests and I reproduced the issue observed by you. I have opened and internal ticket for further investigations. I will come back to you with details as soon as I will have any news.

Best regards,

Anca

0 Kudos

1,489 Views
FedericoWegher
Contributor III

Hello. Do you have any update?

Thank you,

Federico

0 Kudos

1,560 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Federico, I hope you're doing well!

 

The Supervision Timeout is defined like so in the Bluetooth Core Specification V5.0:

The connSupervisionTimeout shall be a multiple

of 10 ms in the range of 100 ms to 32.0 s and it shall be larger than

(1 + connSlaveLatency) * connInterval * 2.

Where the Slave Latency is defined as:

The connSlaveLatency parameter defines the number of consecutive connection events that the slave device is not required to listen to the master.

It should increase every time a new device connects to the central, starting at 0 when there's only one connected device.

 

So, for a single connection (Slave Latency of 0) with a connection interval of 600 ms the formula would result in:

((1 + 0)*600*2)=1,200 ms

 

Please let me know if you need any more information.

 

Best regards,

Sebastian

1,560 Views
FedericoWegher
Contributor III

Hi Sebastian.

Thank you for your reply, but it does not reply to my question.

I already know the Supervision timeout definition, as given that I am using 0 for latency, the 1220ms value I use is compliant to the standard.

My question was: is a connection event handled by central device in case it occurs during its active scan window?

0 Kudos

1,560 Views
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Federico,

 

The BLE stack implemented in the KW38 is designed to manage the timing requirements of the Bluetooth Low Energy protocol.

The supervision timeout should be updated to prevent possible disconnections caused by scheduling conflicts. The stack then takes this interval to correctly schedule event handling and other stack necessities.

 

For more information and development recommendations, could you please take a look at the BLE Application Developer's Guide, included in the KW38's documentation package:

<…\SDK_2.6.6_FRDM-KW38_doc\docs\wireless\Bluetooth\Bluetooth Low Energy Application Developer's Guide.pdf>

 

Please let me know if you need any more information.

 

Best regards,

Sebastian