- Removed extra whitespaces from AT prefix definitions. The format is modem specific and AT handler is handling whitespaces in case they are present

- Reverted the "smaller thread stack size for dispatcher thread". 1KB is not enough, was causing CMSIS-RTOS error: Stack underflow.
pull/6082/head
Mirela Chirica 2018-02-15 10:16:25 +02:00 committed by Ari Parkkila
parent 4a3541ef60
commit a35e1f8d6c
4 changed files with 11 additions and 11 deletions

View File

@ -456,7 +456,7 @@ nsapi_error_t CellularConnectionUtil::start_dispatch()
MBED_ASSERT(!_queue_thread); MBED_ASSERT(!_queue_thread);
_queue_thread = new rtos::Thread(osPriorityNormal, 1024); _queue_thread = new rtos::Thread;
if (!_queue_thread) { if (!_queue_thread) {
stop(); stop();
return NSAPI_ERROR_NO_MEMORY; return NSAPI_ERROR_NO_MEMORY;

View File

@ -398,7 +398,7 @@ nsapi_error_t AT_CellularNetwork::get_registration_status(RegistrationType type,
RegistrationType reg_types[] = { C_EREG, C_GREG, C_REG}; RegistrationType reg_types[] = { C_EREG, C_GREG, C_REG};
const char *cmd[] = { "AT+CEREG", "AT+CGREG", "AT+CREG"}; const char *cmd[] = { "AT+CEREG", "AT+CGREG", "AT+CREG"};
const char *rsp[] = { "+CEREG: ", "+CGREG: ", "+CREG: "}; const char *rsp[] = { "+CEREG:", "+CGREG:", "+CREG:"};
const int LAC_LENGTH = 5, CELL_ID_LENGTH = 9; const int LAC_LENGTH = 5, CELL_ID_LENGTH = 9;
char lac_string[LAC_LENGTH] = {0}, cell_id_string[CELL_ID_LENGTH] = {0}; char lac_string[LAC_LENGTH] = {0}, cell_id_string[CELL_ID_LENGTH] = {0};
@ -874,7 +874,7 @@ nsapi_error_t AT_CellularNetwork::get_operator_params(int &format, operator_t &o
_at.cmd_start("AT+COPS?"); _at.cmd_start("AT+COPS?");
_at.cmd_stop(); _at.cmd_stop();
_at.resp_start("+COPS: "); _at.resp_start("+COPS:");
_at.read_int(); //ignore mode _at.read_int(); //ignore mode
format = _at.read_int(); format = _at.read_int();

View File

@ -177,8 +177,8 @@ AT_CellularSMS::AT_CellularSMS(ATHandler &at) : AT_CellularBase(at), _cb(0), _mo
_use_8bit_encoding(false), _sim_wait_time(0), _sms_message_ref_number(1), _sms_info(NULL) _use_8bit_encoding(false), _sim_wait_time(0), _sms_message_ref_number(1), _sms_info(NULL)
{ {
/* URCs, handled out of band */ /* URCs, handled out of band */
_at.set_urc_handler("+CMTI: ", callback(this, &AT_CellularSMS::cmti_urc)); _at.set_urc_handler("+CMTI:", callback(this, &AT_CellularSMS::cmti_urc));
_at.set_urc_handler("+CMT: ", callback(this, &AT_CellularSMS::cmt_urc)); _at.set_urc_handler("+CMT:", callback(this, &AT_CellularSMS::cmt_urc));
} }
AT_CellularSMS::~AT_CellularSMS() AT_CellularSMS::~AT_CellularSMS()
@ -457,7 +457,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char* phone_number, const c
// <ctrl-Z> (IRA 26) must be used to indicate the ending of the message body. // <ctrl-Z> (IRA 26) must be used to indicate the ending of the message body.
_at.cmd_start(CTRL_Z); _at.cmd_start(CTRL_Z);
_at.cmd_stop(); _at.cmd_stop();
_at.resp_start("+CMGS: "); _at.resp_start("+CMGS:");
_at.resp_stop(); _at.resp_stop();
} }
} else { } else {
@ -520,7 +520,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char* phone_number, const c
// <ctrl-Z> (IRA 26) must be used to indicate the ending of the message body. // <ctrl-Z> (IRA 26) must be used to indicate the ending of the message body.
_at.cmd_start(CTRL_Z); _at.cmd_start(CTRL_Z);
_at.cmd_stop(); _at.cmd_stop();
_at.resp_start("+CMGS: "); _at.resp_start("+CMGS:");
_at.resp_stop(); _at.resp_stop();
} }
free(pdu_str); free(pdu_str);
@ -630,7 +630,7 @@ nsapi_size_or_error_t AT_CellularSMS::read_sms_from_index(int msg_index, char* b
if (_at.get_last_error() == NSAPI_ERROR_OK) { if (_at.get_last_error() == NSAPI_ERROR_OK) {
char status[SMS_STATUS_SIZE]; char status[SMS_STATUS_SIZE];
// first we read msg status and with that we can decide how the rest of message format // first we read msg status and with that we can decide how the rest of message format
_at.resp_start("+CMGR: "); _at.resp_start("+CMGR:");
if (_at.info_resp()) { if (_at.info_resp()) {
_at.read_string(status, SMS_STATUS_SIZE); _at.read_string(status, SMS_STATUS_SIZE);
@ -678,7 +678,7 @@ nsapi_size_or_error_t AT_CellularSMS::read_sms(sms_info_t* sms, char* buf, char*
_at.cmd_start("AT+CMGR="); _at.cmd_start("AT+CMGR=");
_at.write_int(sms->msg_index[i]); _at.write_int(sms->msg_index[i]);
_at.cmd_stop(); _at.cmd_stop();
_at.resp_start("+CMGR: "); _at.resp_start("+CMGR:");
if (_at.info_resp()) { if (_at.info_resp()) {
status = _at.read_int(); status = _at.read_int();
@ -1057,7 +1057,7 @@ nsapi_error_t AT_CellularSMS::list_messages()
int length = 0; int length = 0;
char *pdu = NULL; char *pdu = NULL;
_at.resp_start("+CMGL: "); _at.resp_start("+CMGL:");
while (_at.info_resp()) { while (_at.info_resp()) {
info = new sms_info_t(); info = new sms_info_t();
if (!info) { if (!info) {

View File

@ -22,7 +22,7 @@ using namespace mbed;
QUECTEL_BG96_CellularStack::QUECTEL_BG96_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type) : AT_CellularStack(atHandler, cid, stack_type) QUECTEL_BG96_CellularStack::QUECTEL_BG96_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type) : AT_CellularStack(atHandler, cid, stack_type)
{ {
_at.set_urc_handler("+QIURC: ", mbed::Callback<void()>(this, &QUECTEL_BG96_CellularStack::urc_qiurc)); _at.set_urc_handler("+QIURC:", mbed::Callback<void()>(this, &QUECTEL_BG96_CellularStack::urc_qiurc));
} }
QUECTEL_BG96_CellularStack::~QUECTEL_BG96_CellularStack() QUECTEL_BG96_CellularStack::~QUECTEL_BG96_CellularStack()