modem-helpers: parse cgdcont test parser to use object logging
This commit is contained in:
@@ -828,7 +828,7 @@ cgdcont_test_ready (MMBaseModem *modem,
|
|||||||
goto out;
|
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) {
|
if (error) {
|
||||||
mm_obj_dbg (self, "error parsing +CGDCONT test response: %s", error->message);
|
mm_obj_dbg (self, "error parsing +CGDCONT test response: %s", error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
@@ -1906,7 +1906,7 @@ supported_ip_families_cgdcont_test_ready (MMBaseModem *self,
|
|||||||
if (response) {
|
if (response) {
|
||||||
GList *formats, *l;
|
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))
|
for (l = formats; l; l = g_list_next (l))
|
||||||
mask |= ((MM3gppPdpContextFormat *)(l->data))->pdp_type;
|
mask |= ((MM3gppPdpContextFormat *)(l->data))->pdp_type;
|
||||||
|
|
||||||
|
@@ -1689,6 +1689,7 @@ mm_3gpp_pdp_context_format_list_free (GList *pdp_format_list)
|
|||||||
|
|
||||||
GList *
|
GList *
|
||||||
mm_3gpp_parse_cgdcont_test_response (const gchar *response,
|
mm_3gpp_parse_cgdcont_test_response (const gchar *response,
|
||||||
|
gpointer log_object,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GRegex *r;
|
GRegex *r;
|
||||||
@@ -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_str = mm_get_string_unquoted_from_match_info (match_info, 3);
|
||||||
pdp_type = mm_3gpp_get_ip_family_from_pdp_type (pdp_type_str);
|
pdp_type = mm_3gpp_get_ip_family_from_pdp_type (pdp_type_str);
|
||||||
if (pdp_type == MM_BEARER_IP_FAMILY_NONE)
|
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 {
|
else {
|
||||||
/* Read min CID */
|
/* Read min CID */
|
||||||
if (!mm_get_uint_from_match_info (match_info, 1, &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 {
|
else {
|
||||||
MM3gppPdpContextFormat *format;
|
MM3gppPdpContextFormat *format;
|
||||||
|
|
||||||
@@ -1746,7 +1747,7 @@ mm_3gpp_parse_cgdcont_test_response (const gchar *response,
|
|||||||
g_regex_unref (r);
|
g_regex_unref (r);
|
||||||
|
|
||||||
if (inner_error) {
|
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);
|
g_error_free (inner_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -185,6 +185,7 @@ typedef struct {
|
|||||||
} MM3gppPdpContextFormat;
|
} MM3gppPdpContextFormat;
|
||||||
void mm_3gpp_pdp_context_format_list_free (GList *pdp_format_list);
|
void mm_3gpp_pdp_context_format_list_free (GList *pdp_format_list);
|
||||||
GList *mm_3gpp_parse_cgdcont_test_response (const gchar *reply,
|
GList *mm_3gpp_parse_cgdcont_test_response (const gchar *reply,
|
||||||
|
gpointer log_object,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* AT+CGDCONT? (PDP context query) response parser */
|
/* AT+CGDCONT? (PDP context query) response parser */
|
||||||
|
@@ -2440,7 +2440,7 @@ test_cgdcont_test_results (const gchar *desc,
|
|||||||
|
|
||||||
g_debug ("Testing %s +CGDCONT test response...", 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 (results);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert_cmpuint (g_list_length (results), ==, expected_results_len);
|
g_assert_cmpuint (g_list_length (results), ==, expected_results_len);
|
||||||
@@ -2859,7 +2859,7 @@ test_cid_selection (void)
|
|||||||
|
|
||||||
test = &cid_selection_tests[i];
|
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;
|
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,
|
cid = mm_3gpp_select_best_cid (test->apn, test->ip_family,
|
||||||
|
Reference in New Issue
Block a user