modem-helpers: port creg response parser to use object logging

This commit is contained in:
Aleksander Morgado
2020-04-08 16:35:09 +02:00
parent 39dd4c166d
commit ef1a570afe
4 changed files with 22 additions and 18 deletions
+2
View File
@@ -4565,6 +4565,7 @@ registration_state_changed (MMPortSerialAt *port,
GError *error = NULL;
if (!mm_3gpp_parse_creg_response (match_info,
self,
&state,
&lac,
&cell_id,
@@ -4968,6 +4969,7 @@ registration_status_check_ready (MMBroadbandModem *self,
lac = 0;
cid = 0;
parsed = mm_3gpp_parse_creg_response (match_info,
self,
&state,
&lac,
&cid,
+10 -9
View File
@@ -1942,14 +1942,15 @@ item_is_lac_not_stat (GMatchInfo *info, guint32 item)
}
gboolean
mm_3gpp_parse_creg_response (GMatchInfo *info,
MMModem3gppRegistrationState *out_reg_state,
gulong *out_lac,
gulong *out_ci,
MMModemAccessTechnology *out_act,
gboolean *out_cgreg,
gboolean *out_cereg,
GError **error)
mm_3gpp_parse_creg_response (GMatchInfo *info,
gpointer log_object,
MMModem3gppRegistrationState *out_reg_state,
gulong *out_lac,
gulong *out_ci,
MMModemAccessTechnology *out_act,
gboolean *out_cgreg,
gboolean *out_cereg,
GError **error)
{
gboolean success = FALSE, foo;
gint n_matches, act = -1;
@@ -2057,7 +2058,7 @@ mm_3gpp_parse_creg_response (GMatchInfo *info,
/* '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);
mm_obj_warn (log_object, "unknown registration state value '%lu'", stat);
stat = MM_MODEM_3GPP_REGISTRATION_STATE_UNKNOWN;
}
+9 -8
View File
@@ -217,14 +217,15 @@ GList *mm_3gpp_parse_cgact_read_response (const gchar *reply,
GError **error);
/* CREG/CGREG response/unsolicited message parser */
gboolean mm_3gpp_parse_creg_response (GMatchInfo *info,
MMModem3gppRegistrationState *out_reg_state,
gulong *out_lac,
gulong *out_ci,
MMModemAccessTechnology *out_act,
gboolean *out_cgreg,
gboolean *out_cereg,
GError **error);
gboolean mm_3gpp_parse_creg_response (GMatchInfo *info,
gpointer log_object,
MMModem3gppRegistrationState *out_reg_state,
gulong *out_lac,
gulong *out_ci,
MMModemAccessTechnology *out_act,
gboolean *out_cgreg,
gboolean *out_cereg,
GError **error);
/* AT+CMGF=? (SMS message format) response parser */
gboolean mm_3gpp_parse_cmgf_test_response (const gchar *reply,
+1 -1
View File
@@ -1143,7 +1143,7 @@ test_creg_match (const char *test,
g_assert (info != NULL);
g_assert_cmpuint (regex_num, ==, result->regex_num);
success = mm_3gpp_parse_creg_response (info, &state, &lac, &ci, &access_tech, &cgreg, &cereg, &error);
success = mm_3gpp_parse_creg_response (info, NULL, &state, &lac, &ci, &access_tech, &cgreg, &cereg, &error);
g_match_info_free (info);
g_assert (success);
g_assert_no_error (error);