From 92a275dc1c0f19063e031b3389f58704b0b187c7 Mon Sep 17 00:00:00 2001 From: anschrammh Date: Wed, 5 Apr 2023 08:08:15 +0200 Subject: [PATCH] Slight improvement in the rf modem management for BLE --- src/W800_SDK_v1.00.10/app/ble/ble_modem.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/W800_SDK_v1.00.10/app/ble/ble_modem.c b/src/W800_SDK_v1.00.10/app/ble/ble_modem.c index e03cf1d..566a52d 100644 --- a/src/W800_SDK_v1.00.10/app/ble/ble_modem.c +++ b/src/W800_SDK_v1.00.10/app/ble/ble_modem.c @@ -31,15 +31,16 @@ bool ble_modem_on(bool bluetoothOnly, bool startService) { TLS_BT_APPL_TRACE_ERROR("%s, tls_bt_init ret:%s"NEW_LINE, __FUNCTION__, tls_bt_rc_2_str(status)); } - else if(bluetoothOnly) // If we successfully started the modem, we can set it's working mode. + else { - tls_rf_bt_mode(true); + // If we successfully started the modem, we can set it's working mode. + if(bluetoothOnly) + tls_rf_bt_mode(true); + // Start the ble service if it was asked and if it is not yet started + if(startService && !ble_service_is_started()) + serviceStartSuccess = ble_service_start(); } - // Start the ble service if it was asked and if it is not yet started - if(startService && !ble_service_is_started()) - serviceStartSuccess = ble_service_start(); - return ((status == BLE_HS_ENOERR || status == BLE_HS_EALREADY) && serviceStartSuccess) ? true : false; }