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