aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-04-04 11:53:36 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-04-08 16:35:09 +0200
commit39dd4c166d2750a00dfe1a3505a02bccaaf7f755 (patch)
treeafe110b0ac5321b6f31c792c6c4b2c1facc85c85 /src
parent78cad902ef342d6da628f26e1282782aa8361316 (diff)
modem-helpers: port clcc list parser to use object logging
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-modem.c6
-rw-r--r--src/mm-modem-helpers.c7
-rw-r--r--src/mm-modem-helpers.h1
-rw-r--r--src/tests/test-modem-helpers.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 39faef42..1782253e 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -7560,7 +7560,7 @@ modem_voice_load_call_list_finish (MMIfaceModemVoice *self,
}
static void
-clcc_ready (MMBaseModem *modem,
+clcc_ready (MMBaseModem *self,
GAsyncResult *res,
GTask *task)
{
@@ -7568,8 +7568,8 @@ clcc_ready (MMBaseModem *modem,
GError *error = NULL;
GList *call_info_list = NULL;
- response = mm_base_modem_at_command_finish (modem, res, &error);
- if (!response || !mm_3gpp_parse_clcc_response (response, &call_info_list, &error))
+ response = mm_base_modem_at_command_finish (self, res, &error);
+ if (!response || !mm_3gpp_parse_clcc_response (response, self, &call_info_list, &error))
g_task_return_error (task, error);
else
g_task_return_pointer (task, call_info_list, (GDestroyNotify)mm_3gpp_call_info_list_free);
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index 67a5f0a6..4264e230 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -560,6 +560,7 @@ call_info_free (MMCallInfo *info)
gboolean
mm_3gpp_parse_clcc_response (const gchar *str,
+ gpointer log_object,
GList **out_list,
GError **error)
{
@@ -623,20 +624,20 @@ mm_3gpp_parse_clcc_response (const gchar *str,
call_info = g_slice_new0 (MMCallInfo);
if (!mm_get_uint_from_match_info (match_info, 1, &call_info->index)) {
- mm_warn ("couldn't parse call index from +CLCC line");
+ mm_obj_warn (log_object, "couldn't parse call index from +CLCC line");
goto next;
}
if (!mm_get_uint_from_match_info (match_info, 2, &aux) ||
(aux >= G_N_ELEMENTS (call_direction))) {
- mm_warn ("couldn't parse call direction from +CLCC line");
+ mm_obj_warn (log_object, "couldn't parse call direction from +CLCC line");
goto next;
}
call_info->direction = call_direction[aux];
if (!mm_get_uint_from_match_info (match_info, 3, &aux) ||
(aux >= G_N_ELEMENTS (call_state))) {
- mm_warn ("couldn't parse call state from +CLCC line");
+ mm_obj_warn (log_object, "couldn't parse call state from +CLCC line");
goto next;
}
call_info->state = call_state[aux];
diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h
index 25d94357..88bc71f4 100644
--- a/src/mm-modem-helpers.h
+++ b/src/mm-modem-helpers.h
@@ -106,6 +106,7 @@ typedef struct {
gchar *number; /* optional */
} MMCallInfo;
gboolean mm_3gpp_parse_clcc_response (const gchar *str,
+ gpointer log_object,
GList **out_list,
GError **error);
void mm_3gpp_call_info_list_free (GList *call_info_list);
diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c
index f991f023..65ead935 100644
--- a/src/tests/test-modem-helpers.c
+++ b/src/tests/test-modem-helpers.c
@@ -4190,7 +4190,7 @@ common_test_clcc_response (const gchar *str,
GList *call_info_list = NULL;
GList *l;
- result = mm_3gpp_parse_clcc_response (str, &call_info_list, &error);
+ result = mm_3gpp_parse_clcc_response (str, NULL, &call_info_list, &error);
g_assert_no_error (error);
g_assert (result);