aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-04-03 16:05:17 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-04-08 16:35:09 +0200
commit740827bde1d03c5f8b187f70be8ffb6ae3ca1785 (patch)
tree36969d71f5051da7b9276e7d1fb646184094db27
parentf76489cd8179000c1f4e6bc7b72d60933a6c08b9 (diff)
modem-helpers: parse cgdcont test parser to use object logging
-rw-r--r--src/mm-broadband-bearer.c2
-rw-r--r--src/mm-broadband-modem.c2
-rw-r--r--src/mm-modem-helpers.c11
-rw-r--r--src/mm-modem-helpers.h5
-rw-r--r--src/tests/test-modem-helpers.c4
5 files changed, 13 insertions, 11 deletions
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index d5917706..004ef1f0 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -828,7 +828,7 @@ cgdcont_test_ready (MMBaseModem *modem,
goto out;
}
- ctx->context_format_list = mm_3gpp_parse_cgdcont_test_response (response, &error);
+ ctx->context_format_list = mm_3gpp_parse_cgdcont_test_response (response, self, &error);
if (error) {
mm_obj_dbg (self, "error parsing +CGDCONT test response: %s", error->message);
g_clear_error (&error);
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index be0c9992..1c244519 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -1906,7 +1906,7 @@ supported_ip_families_cgdcont_test_ready (MMBaseModem *self,
if (response) {
GList *formats, *l;
- formats = mm_3gpp_parse_cgdcont_test_response (response, &error);
+ formats = mm_3gpp_parse_cgdcont_test_response (response, self, &error);
for (l = formats; l; l = g_list_next (l))
mask |= ((MM3gppPdpContextFormat *)(l->data))->pdp_type;
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 347ee06f..1bc9db52 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -1688,8 +1688,9 @@ mm_3gpp_pdp_context_format_list_free (GList *pdp_format_list)
}
GList *
-mm_3gpp_parse_cgdcont_test_response (const gchar *response,
- GError **error)
+mm_3gpp_parse_cgdcont_test_response (const gchar *response,
+ gpointer log_object,
+ GError **error)
{
GRegex *r;
GMatchInfo *match_info;
@@ -1717,11 +1718,11 @@ mm_3gpp_parse_cgdcont_test_response (const gchar *response,
pdp_type_str = mm_get_string_unquoted_from_match_info (match_info, 3);
pdp_type = mm_3gpp_get_ip_family_from_pdp_type (pdp_type_str);
if (pdp_type == MM_BEARER_IP_FAMILY_NONE)
- mm_dbg ("Unhandled PDP type in CGDCONT=? reply: '%s'", pdp_type_str);
+ mm_obj_dbg (log_object, "unhandled PDP type in CGDCONT=? reply: '%s'", pdp_type_str);
else {
/* Read min CID */
if (!mm_get_uint_from_match_info (match_info, 1, &min_cid))
- mm_warn ("Invalid min CID in CGDCONT=? reply for PDP type '%s'", pdp_type_str);
+ mm_obj_warn (log_object, "invalid min CID in CGDCONT=? reply for PDP type '%s'", pdp_type_str);
else {
MM3gppPdpContextFormat *format;
@@ -1746,7 +1747,7 @@ mm_3gpp_parse_cgdcont_test_response (const gchar *response,
g_regex_unref (r);
if (inner_error) {
- mm_warn ("Unexpected error matching +CGDCONT response: '%s'", inner_error->message);
+ mm_obj_warn (log_object, "unexpected error matching +CGDCONT response: '%s'", inner_error->message);
g_error_free (inner_error);
}
diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h
index ee36309b..9a92a79b 100644
--- a/src/mm-modem-helpers.h
+++ b/src/mm-modem-helpers.h
@@ -184,8 +184,9 @@ typedef struct {
MMBearerIpFamily pdp_type;
} MM3gppPdpContextFormat;
void mm_3gpp_pdp_context_format_list_free (GList *pdp_format_list);
-GList *mm_3gpp_parse_cgdcont_test_response (const gchar *reply,
- GError **error);
+GList *mm_3gpp_parse_cgdcont_test_response (const gchar *reply,
+ gpointer log_object,
+ GError **error);
/* AT+CGDCONT? (PDP context query) response parser */
typedef struct {
diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c
index 3968850a..f4947904 100644
--- a/src/tests/test-modem-helpers.c
+++ b/src/tests/test-modem-helpers.c
@@ -2440,7 +2440,7 @@ test_cgdcont_test_results (const gchar *desc,
g_debug ("Testing %s +CGDCONT test response...", desc);
- results = mm_3gpp_parse_cgdcont_test_response (reply, &error);
+ results = mm_3gpp_parse_cgdcont_test_response (reply, NULL, &error);
g_assert (results);
g_assert_no_error (error);
g_assert_cmpuint (g_list_length (results), ==, expected_results_len);
@@ -2859,7 +2859,7 @@ test_cid_selection (void)
test = &cid_selection_tests[i];
- context_format_list = test->cgdcont_test ? mm_3gpp_parse_cgdcont_test_response (test->cgdcont_test, NULL) : NULL;
+ context_format_list = test->cgdcont_test ? mm_3gpp_parse_cgdcont_test_response (test->cgdcont_test, NULL, NULL) : NULL;
context_list = test->cgdcont_query ? mm_3gpp_parse_cgdcont_read_response (test->cgdcont_query, NULL) : NULL;
cid = mm_3gpp_select_best_cid (test->apn, test->ip_family,