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 f01cce2..e03cf1d 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 @@ -10,14 +10,15 @@ //Is needed for the BT off workaround #include "wm_wifi.h" -bool ble_modem_on(bool startService) +bool ble_modem_on(bool bluetoothOnly, bool startService) { int status = BLE_HS_ENOERR; bool serviceStartSuccess = true; uint8_t uart_no = 0xFF; tls_appl_trace_level = TLS_BT_LOG_VERBOSE; //Should be set with a config define - if(bt_adapter_state == WM_BT_STATE_ON) { + if(bt_adapter_state == WM_BT_STATE_ON) + { TLS_BT_APPL_TRACE_VERBOSE("ble modem already on"NEW_LINE); return true; } @@ -26,9 +27,14 @@ bool ble_modem_on(bool startService) tls_appl_trace_level); status = tls_bt_init(uart_no); - if((status != BLE_HS_ENOERR) && (status != BLE_HS_EALREADY)) { + if((status != BLE_HS_ENOERR) && (status != BLE_HS_EALREADY)) + { 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. + { + 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()) diff --git a/src/W800_SDK_v1.00.10/app/ble/ble_modem.h b/src/W800_SDK_v1.00.10/app/ble/ble_modem.h index 9c4c186..e63b946 100644 --- a/src/W800_SDK_v1.00.10/app/ble/ble_modem.h +++ b/src/W800_SDK_v1.00.10/app/ble/ble_modem.h @@ -10,7 +10,7 @@ * @return true on success * @return false on failure */ -bool ble_modem_on(bool startService); +bool ble_modem_on(bool bluetoothOnly, bool startService); /** * @brief Turns the BLE modem off