From 3faa1162e23da4d8d3fcb56fadc38fc5c8bb69a1 Mon Sep 17 00:00:00 2001 From: anschrammh Date: Sun, 26 Mar 2023 22:52:47 +0200 Subject: [PATCH] Reworked the timeout waiting for the ble service to stop which was too short --- app/ble/ble_modem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/ble/ble_modem.c b/app/ble/ble_modem.c index 7ae9c0a..f01cce2 100644 --- a/app/ble/ble_modem.c +++ b/app/ble/ble_modem.c @@ -58,13 +58,13 @@ bool ble_modem_off(void) uint8_t timeout = 0; while(ble_service_is_started()) { - tls_os_time_delay(pdMS_TO_TICKS(1)); + tls_os_time_delay(pdMS_TO_TICKS(5)); - // Service is stuck ? - if(++timeout > 10) + // Service is stuck ? waiting up to 300 ms for it to stop + if(++timeout > 60) { - serviceStopSuccess = false; - break; + TLS_BT_APPL_TRACE_ERROR("%s, ble_service_stop timeout "NEW_LINE, __FUNCTION__); + return serviceStopSuccess; } };