Cellular: review fixes to cellularfsm and cellularnetwork.

pull/6629/head
Teppo Järvelin 2018-04-18 12:35:38 +03:00
parent 1990f63382
commit 55f4360680
3 changed files with 12 additions and 8 deletions

View File

@ -338,10 +338,9 @@ bool CellularConnectionFSM::is_registered_to_plmn()
if (strcmp(_plmn, op_names->numeric)) {
names_list.delete_all();
return true;
} else {
names_list.delete_all();
return false;
}
names_list.delete_all();
return false;
}
}
}

View File

@ -141,7 +141,7 @@ public:
void set_retry_timeout_array(uint16_t timeout[], int array_len);
/** Sets the operator plmn which is used when registering to a network specified by plmn. If plmn is not set then automatic
* registering is used when registering to a cellular network.
* registering is used when registering to a cellular network. Does not start any operations.
*
* @param plmn operator in numeric format. See more from 3GPP TS 27.007 chapter 7.3.
*/

View File

@ -902,8 +902,10 @@ nsapi_error_t AT_CellularNetwork::scan_plmn(operList_t &operators, int &opsCount
if (!op) {
tr_warn("Could not allocate new operator");
_at.resp_stop();
opsCount = idx;
return _at.unlock_return_error();
_at.unlock();
operators.delete_all();
opsCount = 0;
return NSAPI_ERROR_NO_MEMORY;
}
op->op_status = (operator_t::Status)_at.read_int();
@ -1037,8 +1039,9 @@ nsapi_error_t AT_CellularNetwork::get_pdpcontext_params(pdpContextList_t& params
params = params_list.add_new();
if (!params) {
tr_warn("Could not allocate new pdpcontext_params_t");
params_list.delete_all();
_at.resp_stop();
_at.unlock();
params_list.delete_all();
free(temp);
free(ipv6_and_subnetmask);
return NSAPI_ERROR_NO_MEMORY;
@ -1194,7 +1197,9 @@ nsapi_error_t AT_CellularNetwork::get_operator_names(operator_names_list &op_nam
if (!names) {
tr_warn("Could not allocate new operator_names_t");
_at.resp_stop();
return _at.unlock_return_error();
_at.unlock();
op_names.delete_all();
return NSAPI_ERROR_NO_MEMORY;
}
_at.read_string(names->numeric, sizeof(names->numeric));
_at.read_string(names->alpha, sizeof(names->alpha));