modem-helpers: use MMModem3gppRegistrationState when parsing C(G)REG responses
This commit is contained in:
@@ -373,7 +373,7 @@ item_is_lac_not_stat (GMatchInfo *info, guint32 item)
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_gsm_parse_creg_response (GMatchInfo *info,
|
mm_gsm_parse_creg_response (GMatchInfo *info,
|
||||||
guint32 *out_reg_state,
|
MMModem3gppRegistrationState *out_reg_state,
|
||||||
gulong *out_lac,
|
gulong *out_lac,
|
||||||
gulong *out_ci,
|
gulong *out_ci,
|
||||||
gint *out_act,
|
gint *out_act,
|
||||||
@@ -485,8 +485,14 @@ mm_gsm_parse_creg_response (GMatchInfo *info,
|
|||||||
act = -1;
|
act = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*out_reg_state = (guint32) stat;
|
/* 'roaming' is the last valid state */
|
||||||
if (stat != 4) {
|
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 */
|
/* Don't fill in lac/ci/act if the device's state is unknown */
|
||||||
*out_lac = lac;
|
*out_lac = lac;
|
||||||
*out_ci = ci;
|
*out_ci = ci;
|
||||||
|
@@ -37,7 +37,7 @@ GPtrArray *mm_gsm_creg_regex_get (gboolean solicited);
|
|||||||
void mm_gsm_creg_regex_destroy (GPtrArray *array);
|
void mm_gsm_creg_regex_destroy (GPtrArray *array);
|
||||||
|
|
||||||
gboolean mm_gsm_parse_creg_response (GMatchInfo *info,
|
gboolean mm_gsm_parse_creg_response (GMatchInfo *info,
|
||||||
guint32 *out_reg_state,
|
MMModem3gppRegistrationState *out_reg_state,
|
||||||
gulong *out_lac,
|
gulong *out_lac,
|
||||||
gulong *out_ci,
|
gulong *out_ci,
|
||||||
gint *out_act,
|
gint *out_act,
|
||||||
@@ -86,4 +86,3 @@ gint cind_response_get_max (CindResponse *r);
|
|||||||
GByteArray *mm_parse_cind_query_response(const char *reply, GError **error);
|
GByteArray *mm_parse_cind_query_response(const char *reply, GError **error);
|
||||||
|
|
||||||
#endif /* MM_MODEM_HELPERS_H */
|
#endif /* MM_MODEM_HELPERS_H */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user