From c5f164d75fa03616884829188ed33cb4a3e773cf Mon Sep 17 00:00:00 2001 From: Wajahat Abbas Date: Mon, 21 Oct 2019 15:02:08 +0500 Subject: [PATCH] Ensure modem echo is off --- features/cellular/framework/AT/AT_CellularDevice.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/features/cellular/framework/AT/AT_CellularDevice.cpp b/features/cellular/framework/AT/AT_CellularDevice.cpp index 35cbab43fcc..91daa5611f5 100644 --- a/features/cellular/framework/AT/AT_CellularDevice.cpp +++ b/features/cellular/framework/AT/AT_CellularDevice.cpp @@ -454,10 +454,12 @@ nsapi_error_t AT_CellularDevice::init() _at->clear_error(); _at->flush(); _at->at_cmd_discard("E0", ""); - _at->at_cmd_discard("+CMEE", "=1"); - _at->at_cmd_discard("+CFUN", "=1"); if (_at->get_last_error() == NSAPI_ERROR_OK) { - break; + _at->at_cmd_discard("+CMEE", "=1"); + _at->at_cmd_discard("+CFUN", "=1"); + if (_at->get_last_error() == NSAPI_ERROR_OK) { + break; + } } tr_debug("Wait 100ms to init modem"); rtos::ThisThread::sleep_for(100); // let modem have time to get ready