mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #11490 from AriParkkila/cell-bg96-ifc
Cellular: Add flow control (IFC) in BG96 AT driverpull/11523/head
commit
185e380233
|
@ -1368,7 +1368,7 @@ TEST_F(TestATHandler, test_ATHandler_sync)
|
||||||
EXPECT_EQ(false, at.sync(100));
|
EXPECT_EQ(false, at.sync(100));
|
||||||
|
|
||||||
fh1.size_value = 8;
|
fh1.size_value = 8;
|
||||||
char table[] = "OK\r\n\0";
|
char table[] = "+CMEE: 1\r\nOK\r\n\0";
|
||||||
filehandle_stub_table = table;
|
filehandle_stub_table = table;
|
||||||
|
|
||||||
at.flush();
|
at.flush();
|
||||||
|
|
|
@ -1574,7 +1574,13 @@ bool ATHandler::sync(int timeout_ms)
|
||||||
// especially a common response like OK could be response to previous request.
|
// especially a common response like OK could be response to previous request.
|
||||||
clear_error();
|
clear_error();
|
||||||
_start_time = rtos::Kernel::get_ms_count();
|
_start_time = rtos::Kernel::get_ms_count();
|
||||||
at_cmd_discard("+CMEE", "?");
|
cmd_start("AT+CMEE?");
|
||||||
|
cmd_stop();
|
||||||
|
resp_start();
|
||||||
|
set_stop_tag("+CMEE:");
|
||||||
|
consume_to_stop_tag();
|
||||||
|
set_stop_tag(OK);
|
||||||
|
consume_to_stop_tag();
|
||||||
if (!_last_err) {
|
if (!_last_err) {
|
||||||
_at_timeout = timeout;
|
_at_timeout = timeout;
|
||||||
unlock();
|
unlock();
|
||||||
|
|
|
@ -102,16 +102,22 @@ nsapi_error_t QUECTEL_BG96::soft_power_on()
|
||||||
if (_pwr.is_connected()) {
|
if (_pwr.is_connected()) {
|
||||||
tr_info("QUECTEL_BG96::soft_power_on");
|
tr_info("QUECTEL_BG96::soft_power_on");
|
||||||
// check if modem was powered on already
|
// check if modem was powered on already
|
||||||
if (wake_up()) {
|
if (!wake_up()) {
|
||||||
return NSAPI_ERROR_OK;
|
if (!wake_up(true)) {
|
||||||
}
|
tr_error("Modem not responding");
|
||||||
if (!wake_up(true)) {
|
soft_power_off();
|
||||||
tr_error("Modem not responding");
|
return NSAPI_ERROR_DEVICE_ERROR;
|
||||||
soft_power_off();
|
}
|
||||||
return NSAPI_ERROR_DEVICE_ERROR;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (MBED_CONF_QUECTEL_BG96_RTS) && defined(MBED_CONF_QUECTEL_BG96_CTS)
|
||||||
|
if (_at->at_cmd_discard("+IFC", "=", "%d%d", 2, 2) != NSAPI_ERROR_OK) {
|
||||||
|
tr_warn("Set flow control failed");
|
||||||
|
return NSAPI_ERROR_DEVICE_ERROR;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return NSAPI_ERROR_OK;
|
return NSAPI_ERROR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue