aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-04-07 15:09:40 +0200
committerAleksander Morgado <aleksander@aleksander.es>2020-04-08 16:35:09 +0200
commit64ac1c19ff25b43320bbf3b5fea8a49d5c7c207f (patch)
treef0eb4481ced55c3737bbaa0e21401fc0ccb767f0
parent62033b1b6e37d944cd3dcc3eb27e3b1056b604df (diff)
longcheer: port to use object logging
-rw-r--r--plugins/longcheer/mm-broadband-modem-longcheer.c2
-rw-r--r--plugins/longcheer/mm-plugin-longcheer.c27
2 files changed, 14 insertions, 15 deletions
diff --git a/plugins/longcheer/mm-broadband-modem-longcheer.c b/plugins/longcheer/mm-broadband-modem-longcheer.c
index 8e07bdf8..f158bc41 100644
--- a/plugins/longcheer/mm-broadband-modem-longcheer.c
+++ b/plugins/longcheer/mm-broadband-modem-longcheer.c
@@ -294,7 +294,6 @@ load_access_technologies (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading access technology (longcheer)...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+PSRAT",
3,
@@ -325,7 +324,6 @@ load_unlock_retries_ready (MMBaseModem *self,
response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
if (!response) {
- mm_dbg ("Couldn't query unlock retries: '%s'", error->message);
g_task_return_error (task, error);
g_object_unref (task);
return;
diff --git a/plugins/longcheer/mm-plugin-longcheer.c b/plugins/longcheer/mm-plugin-longcheer.c
index 59b84575..e2d4230e 100644
--- a/plugins/longcheer/mm-plugin-longcheer.c
+++ b/plugins/longcheer/mm-plugin-longcheer.c
@@ -21,7 +21,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
-#include "mm-log.h"
+#include "mm-log-object.h"
#include "mm-modem-helpers.h"
#include "mm-plugin-longcheer.h"
#include "mm-broadband-modem-longcheer.h"
@@ -58,18 +58,18 @@ static void longcheer_custom_init_step (GTask *task);
static void
gmr_ready (MMPortSerialAt *port,
- GAsyncResult *res,
- GTask *task)
+ GAsyncResult *res,
+ GTask *task)
{
+ MMPortProbe *probe;
const gchar *p;
const gchar *response;
- GError *error = NULL;
- response = mm_port_serial_at_command_finish (port, res, &error);
- if (error) {
- g_error_free (error);
+ probe = g_task_get_source_object (task);
- /* Just retry... */
+ response = mm_port_serial_at_command_finish (port, res, NULL);
+ if (!response) {
+ mm_obj_dbg (probe, "(Longcheer) retrying custom init step...");
longcheer_custom_init_step (task);
return;
}
@@ -88,7 +88,7 @@ gmr_ready (MMPortSerialAt *port,
MM_CORE_ERROR_UNSUPPORTED,
"X200 cannot be supported with the Longcheer plugin");
} else {
- mm_dbg ("(Longcheer) device is not a X200");
+ mm_obj_dbg (probe, "(Longcheer) device is not a X200");
g_task_return_boolean (task, TRUE);
}
g_object_unref (task);
@@ -97,16 +97,17 @@ gmr_ready (MMPortSerialAt *port,
static void
longcheer_custom_init_step (GTask *task)
{
+ MMPortProbe *probe;
LongcheerCustomInitContext *ctx;
- GCancellable *cancellable;
+ GCancellable *cancellable;
- ctx = g_task_get_task_data (task);
+ probe = g_task_get_source_object (task);
+ ctx = g_task_get_task_data (task);
cancellable = g_task_get_cancellable (task);
/* If cancelled, end */
if (g_cancellable_is_cancelled (cancellable)) {
- mm_dbg ("(Longcheer) no need to keep on running custom init in (%s)",
- mm_port_get_device (MM_PORT (ctx->port)));
+ mm_obj_dbg (probe, "(Longcheer) no need to keep on running custom init");
g_task_return_boolean (task, TRUE);
g_object_unref (task);
return;