nimble/ble_hs_stop: Change hs stop procedure

This patch change a way of handling stop procedure. Before, host was
disconnecting one by one all the active connections. This could result
in long procedure time when some devices came out of range and host was
waiting as long as supervision timout takes.

Now, host is sending in the raw Disconnect Command to all the active
connections and then start graceful disconnect timeout 2s.
Host notifies that is stop when
a) all the disconnection complete events arrived within 2s
b) disconnect timeout fires
This commit is contained in:
Łukasz Rymanowski
2019-07-19 13:54:58 +02:00
parent 450b12ad2a
commit f3f06a8d6f
6 changed files with 81 additions and 40 deletions
@@ -723,6 +723,10 @@
#define MYNEWT_VAL_BLE_STORE_MAX_CCCDS (8)
#endif
#ifndef MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT
#define MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT (2000)
#endif
/*** nimble/host/services/ans */
#ifndef MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT
#define MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT (0)
@@ -723,6 +723,10 @@
#define MYNEWT_VAL_BLE_STORE_MAX_CCCDS (8)
#endif
#ifndef MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT
#define MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT (2000)
#endif
/*** nimble/host/services/ans */
#ifndef MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT
#define MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT (0)
+4
View File
@@ -723,6 +723,10 @@
#define MYNEWT_VAL_BLE_STORE_MAX_CCCDS (8)
#endif
#ifndef MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT
#define MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT (2000)
#endif
/*** nimble/host/services/ans */
#ifndef MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT
#define MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT (0)
+3
View File
@@ -933,6 +933,9 @@
#define MYNEWT_VAL_BLE_STORE_MAX_CCCDS (8)
#endif
#ifndef MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT
#define MYNEWT_VAL_BLE_HS_STOP_ON_SHUTDOWN_TIMEOUT (2000)
#endif
/*** net/nimble/host/mesh */
#ifndef MYNEWT_VAL_BLE_MESH_ADV_BUF_COUNT