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; } };