diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2011-11-29 11:02:11 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 14:14:29 +0100 |
commit | 430878c452177a9dbb129025f413ae43c9226b3b (patch) | |
tree | cffd7e8029e604cc28169d577aa23294e3464e81 /src/mm-modem-helpers.c | |
parent | c636cdb27ffd23378c793bb3b4f2ce889d2a0da3 (diff) |
modem-helpers: use MMModem3gppRegistrationState when parsing C(G)REG responses
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r-- | src/mm-modem-helpers.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index e10fdd3c..3ec701e3 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -373,7 +373,7 @@ item_is_lac_not_stat (GMatchInfo *info, guint32 item) gboolean mm_gsm_parse_creg_response (GMatchInfo *info, - guint32 *out_reg_state, + MMModem3gppRegistrationState *out_reg_state, gulong *out_lac, gulong *out_ci, gint *out_act, @@ -485,8 +485,14 @@ mm_gsm_parse_creg_response (GMatchInfo *info, act = -1; } - *out_reg_state = (guint32) stat; - if (stat != 4) { + /* '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 */ *out_lac = lac; *out_ci = ci; |