About BLE supervision timeout

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KEKA_4568351
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

There is a supervision timeout that determines the disconnection of BLE, but I have three questions.

◆ QA

1. Is it ok to recognize "conn_supervision_timeout = 400" when the supervision timeout value is 4 seconds?

2. Is it all right to recognize the GATT event “GATT_CONNECTION_STATUS_EVT” 4 seconds after the BLE disconnection is detected?

3.2. In relation to, when I tried to operate with the following procedure, "GATT_CONNECTION_STATUS_EVT" event was notified about 2 seconds later.

I would like to be notified of the disconnection event 4 seconds after BLE disconnection. If there is a setting method, please let me know.

  ● Operation

  1) BLE connection from smartphone

  2) Turn off your smartphone

◆ wiced_bt_cfg.c settings

.ble_scan_cfg =

{

...

.conn_supervision_timeout = 400,

◆Environment

・WICED SDK 6.4.0

・ThreadX

0 Likes
1 Solution

Hi KEKA_4568351 ,

I hope your requirement is to set Supervision timeout to 4s . If then , you need to do the configuration depending on the device role.

.ble_scan_cfg =

{

・・・

.conn_supervision_timeout=400,

This will set the supervision timeout to 4s only if your device is in Central role.

Basically Central device will set the connection parameters like connection interval , latency , supervision timeout .

So if your device is a peripheral which connects to a Smart phone (Central) , then either you need to make sure you have set appropriate timeout at Central (say mobile app side ). Peripheral can also request for an update. For that you have to use API  wiced_bt_l2cap_update_ble_conn_params  after connection.   Refer (Code Example - Update connection parameter base on Wiced Studio )

But depending upon the Central device it may accept / reject the request .

Regards,

Anjana

View solution in original post

0 Likes
8 Replies
KEKA_4568351
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

BLEのスーパービジョンタイムアウトについて

BLEの切断を判定する、スーパービジョンタイムアウトがありますが、3点の質問があります。

◆QA

1.「conn_supervision_timeout=400」は、スーパービジョンタイムアウト値が4秒の認識で良いでしょうか。

2.BLEの切断が検知されてから、4秒後に、GATTイベント「GATT_CONNECTION_STATUS_EVT」を通知する認識で良いでしょうか。

3.2.の関連で、以下の手順で操作してみたら、2秒後ぐらいに「GATT_CONNECTION_STATUS_EVT」イベントが通知されました。

BLE切断後、4秒後に切断のイベントを通知するようにしたいのですが、設定方法があれば、教えてください。

 ●操作

 1)スマホからBLE接続する

 2)スマホの電源をOFFにする

◆wiced_bt_cfg.c 設定内容

.ble_scan_cfg =

{

・・・

.conn_supervision_timeout=400,

◆環境

・WICED SDK 6.4.0

・ThreadX

0 Likes

◆QA

4.As an additional question, I would like to confirm that the supervision timeout is 4 seconds by executing. Please tell me how to confirm.

<Japanese>

◆QA

4.追加の質問で、スーパービジョンタイムアウトが4秒であることを実行して確認したいのですが、確認方法を教えてください。

0 Likes

Hi KEKA_4568351 ,

I hope your requirement is to set Supervision timeout to 4s . If then , you need to do the configuration depending on the device role.

.ble_scan_cfg =

{

・・・

.conn_supervision_timeout=400,

This will set the supervision timeout to 4s only if your device is in Central role.

Basically Central device will set the connection parameters like connection interval , latency , supervision timeout .

So if your device is a peripheral which connects to a Smart phone (Central) , then either you need to make sure you have set appropriate timeout at Central (say mobile app side ). Peripheral can also request for an update. For that you have to use API  wiced_bt_l2cap_update_ble_conn_params  after connection.   Refer (Code Example - Update connection parameter base on Wiced Studio )

But depending upon the Central device it may accept / reject the request .

Regards,

Anjana

0 Likes

Thank you very much.

In the wiced_bt_l2cap_update_ble_conn_params function, the timeout argument is set to 400. Is recognition of 4 seconds sufficient?

◆ Example

wiced_bt_l2cap_update_ble_conn_params (p_status-> bd_addr, 16, 32, 0, 400);

<Japanese>

ありがとうございます。

wiced_bt_l2cap_update_ble_conn_params関数で、timeout の引数を400に設定していますが、4秒の認識で良いでしょうか。

◆Example

wiced_bt_l2cap_update_ble_conn_params(p_status->bd_addr, 16, 32, 0, 400);

0 Likes

There was a sample in another QA.

Thank you very much.

==================================================

Code Example - Update connection parameter base on Wiced Studio

https://community.cypress.com/message/221731#221731

Example:

    uint16_t min_int = 400; /* Minimum connection interval - 400 x 1.25 = 500 ms */

    uint16_t max_int = 400; /* Maximum connection interval - 400 x 1.25 = 500 ms */

    uint16_t latency = 0;   /* Slave latency */

    uint16_t timeout = 500; /* Supervision timeout - 500 x 10 = 5000 ms */

result = wiced_bt_l2cap_update_ble_conn_params (hello_sensor_state.remote_addr,  min_int,  max_int,  latency,  timeout);

==================================================

<Japanese>

別のQAでサンプルがありました。

ありがとうございます。

0 Likes

Hi KEKA_4568351 ,

Adding one more point. If the Central device is iOS , then it will accept the connection parameters only if it satisfies certain conditions.

Please check here: Making a BLE Device Discoverable on iOS Devices - KBA223312

Thanks ,
Anjana

0 Likes

Thanks, Do you have information for Android?

Android default supervision timeout, change method, etc.

<Japanese>

ありがとう、Androidの情報はありますか?

Androidでの、デフォルトのスーパービジョンタイムアウト、変更方法がありましたら、教えてください。

0 Likes

Hi KEKA_4568351 ,

For Android, there is no such limitations. You can send request for any numbers.

But it can accept / reject updated parameter request with respect to Phone / App specific.

Regards,

Anjana

0 Likes