mirror of git://git.sysmocom.de/ofono
qmimodem: ensure the modem is registered by check cs and ps state
The modem tells to early it's registered even it hasn't yet received a location update complete.
This commit is contained in:
parent
4925c0af99
commit
c2c3492f3b
|
@ -102,7 +102,23 @@ static bool extract_ss_info(struct qmi_result *result, int *status,
|
|||
if (!ss)
|
||||
return false;
|
||||
|
||||
*status = ss->status;
|
||||
/* When connecting to a cell, the modem tells to early it's registered,
|
||||
* event it hasn't yet received a location update complete */
|
||||
switch (ss->status) {
|
||||
case NETWORK_REGISTRATION_STATUS_REGISTERED:
|
||||
case NETWORK_REGISTRATION_STATUS_ROAMING:
|
||||
if (ss->cs_state == 0 && ss->ps_state == 0)
|
||||
*status = NETWORK_REGISTRATION_STATUS_SEARCHING;
|
||||
else
|
||||
*status = ss->status;
|
||||
break;
|
||||
case NETWORK_REGISTRATION_STATUS_DENIED:
|
||||
case NETWORK_REGISTRATION_STATUS_NOT_REGISTERED:
|
||||
case NETWORK_REGISTRATION_STATUS_SEARCHING:
|
||||
case NETWORK_REGISTRATION_STATUS_UNKNOWN:
|
||||
*status = ss->status;
|
||||
break;
|
||||
}
|
||||
|
||||
DBG("serving system status %d", ss->status);
|
||||
|
||||
|
|
Loading…
Reference in New Issue