longcheer: port to use object logging
This commit is contained in:
@@ -294,7 +294,6 @@ load_access_technologies (MMIfaceModem *self,
|
|||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
mm_dbg ("loading access technology (longcheer)...");
|
|
||||||
mm_base_modem_at_command (MM_BASE_MODEM (self),
|
mm_base_modem_at_command (MM_BASE_MODEM (self),
|
||||||
"+PSRAT",
|
"+PSRAT",
|
||||||
3,
|
3,
|
||||||
@@ -325,7 +324,6 @@ load_unlock_retries_ready (MMBaseModem *self,
|
|||||||
|
|
||||||
response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
|
response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
|
||||||
if (!response) {
|
if (!response) {
|
||||||
mm_dbg ("Couldn't query unlock retries: '%s'", error->message);
|
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
return;
|
return;
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#define _LIBMM_INSIDE_MM
|
#define _LIBMM_INSIDE_MM
|
||||||
#include <libmm-glib.h>
|
#include <libmm-glib.h>
|
||||||
|
|
||||||
#include "mm-log.h"
|
#include "mm-log-object.h"
|
||||||
#include "mm-modem-helpers.h"
|
#include "mm-modem-helpers.h"
|
||||||
#include "mm-plugin-longcheer.h"
|
#include "mm-plugin-longcheer.h"
|
||||||
#include "mm-broadband-modem-longcheer.h"
|
#include "mm-broadband-modem-longcheer.h"
|
||||||
@@ -61,15 +61,15 @@ gmr_ready (MMPortSerialAt *port,
|
|||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GTask *task)
|
GTask *task)
|
||||||
{
|
{
|
||||||
|
MMPortProbe *probe;
|
||||||
const gchar *p;
|
const gchar *p;
|
||||||
const gchar *response;
|
const gchar *response;
|
||||||
GError *error = NULL;
|
|
||||||
|
|
||||||
response = mm_port_serial_at_command_finish (port, res, &error);
|
probe = g_task_get_source_object (task);
|
||||||
if (error) {
|
|
||||||
g_error_free (error);
|
|
||||||
|
|
||||||
/* 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);
|
longcheer_custom_init_step (task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ gmr_ready (MMPortSerialAt *port,
|
|||||||
MM_CORE_ERROR_UNSUPPORTED,
|
MM_CORE_ERROR_UNSUPPORTED,
|
||||||
"X200 cannot be supported with the Longcheer plugin");
|
"X200 cannot be supported with the Longcheer plugin");
|
||||||
} else {
|
} 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_task_return_boolean (task, TRUE);
|
||||||
}
|
}
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
@@ -97,16 +97,17 @@ gmr_ready (MMPortSerialAt *port,
|
|||||||
static void
|
static void
|
||||||
longcheer_custom_init_step (GTask *task)
|
longcheer_custom_init_step (GTask *task)
|
||||||
{
|
{
|
||||||
|
MMPortProbe *probe;
|
||||||
LongcheerCustomInitContext *ctx;
|
LongcheerCustomInitContext *ctx;
|
||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
|
|
||||||
|
probe = g_task_get_source_object (task);
|
||||||
ctx = g_task_get_task_data (task);
|
ctx = g_task_get_task_data (task);
|
||||||
cancellable = g_task_get_cancellable (task);
|
cancellable = g_task_get_cancellable (task);
|
||||||
|
|
||||||
/* If cancelled, end */
|
/* If cancelled, end */
|
||||||
if (g_cancellable_is_cancelled (cancellable)) {
|
if (g_cancellable_is_cancelled (cancellable)) {
|
||||||
mm_dbg ("(Longcheer) no need to keep on running custom init in (%s)",
|
mm_obj_dbg (probe, "(Longcheer) no need to keep on running custom init");
|
||||||
mm_port_get_device (MM_PORT (ctx->port)));
|
|
||||||
g_task_return_boolean (task, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user