Merge pull request #11719 from wajahat-ublox/echo_fix

Ensure modem echo is off before sending other AT commands
pull/11810/head
Martin Kojtal 2019-11-04 15:56:12 +01:00 committed by GitHub
commit 18d4adf04f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -454,10 +454,12 @@ nsapi_error_t AT_CellularDevice::init()
_at->clear_error(); _at->clear_error();
_at->flush(); _at->flush();
_at->at_cmd_discard("E0", ""); _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) { 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"); tr_debug("Wait 100ms to init modem");
rtos::ThisThread::sleep_for(100); // let modem have time to get ready rtos::ThisThread::sleep_for(100); // let modem have time to get ready