Merge pull request #13013 from AriParkkila/cell-creg

Cellular: Fix packet data registration after CREG
pull/13069/head
Martin Kojtal 2020-06-04 15:22:57 +02:00 committed by GitHub
commit b3e8e8ad8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,6 @@ void AT_CellularNetwork::read_reg_params_and_compare(RegistrationType type)
read_reg_params(type, reg_params);
if (_at.get_last_error() == NSAPI_ERROR_OK && _connection_status_cb) {
_reg_params._type = type;
cell_callback_data_t data;
data.error = NSAPI_ERROR_OK;
if (reg_params._act != _reg_params._act) {
@ -131,7 +130,7 @@ void AT_CellularNetwork::read_reg_params_and_compare(RegistrationType type)
data.status_data = reg_params._act;
_connection_status_cb((nsapi_event_t)CellularRadioAccessTechnologyChanged, (intptr_t)&data);
}
if (reg_params._status != _reg_params._status) {
if (reg_params._status != _reg_params._status || type != _reg_params._type) {
RegistrationStatus previous_registration_status = _reg_params._status;
_reg_params._status = reg_params._status;
data.status_data = reg_params._status;
@ -151,6 +150,7 @@ void AT_CellularNetwork::read_reg_params_and_compare(RegistrationType type)
data.status_data = reg_params._cell_id;
_connection_status_cb((nsapi_event_t)CellularCellIDChanged, (intptr_t)&data);
}
_reg_params._type = type;
}
}