diff options
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r-- | src/mm-modem-helpers.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 8f208000..1d17c05d 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1428,7 +1428,7 @@ mm_3gpp_parse_creg_response (GMatchInfo *info, /* Status */ str = g_match_info_fetch (info, istat); - stat = parse_uint (str, 10, 0, 5, &success); + stat = parse_uint (str, 10, 0, G_MAXUINT, &success); g_free (str); if (!success) { g_set_error_literal (error, @@ -1437,6 +1437,12 @@ mm_3gpp_parse_creg_response (GMatchInfo *info, return FALSE; } + /* 'roaming (csfb not preferred)' is the last valid state */ + if (stat > MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING_CSFB_NOT_PREFERRED) { + mm_warn ("Registration State '%lu' is unknown", stat); + stat = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; + } + /* Location Area Code */ if (ilac) { /* FIXME: some phones apparently swap the LAC bytes (LG, SonyEricsson, @@ -1463,12 +1469,6 @@ mm_3gpp_parse_creg_response (GMatchInfo *info, act = -1; } - /* 'roaming' is the last valid state */ - if (stat > MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) { - mm_warn ("Registration State '%lu' is unknown", stat); - stat = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN; - } - *out_reg_state = (MMModem3gppRegistrationState) stat; if (stat != MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN) { /* Don't fill in lac/ci/act if the device's state is unknown */ |