aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-03-28 17:51:44 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-04-08 16:35:08 +0200
commitee454643299a59416a3ae799f958e676893afb0e (patch)
tree361d190732e851381812c36fbfa861cc65308ea2 /src
parent875ef11a57e1f6eedc3ca1aa4065d6ffca84073f (diff)
broadband-modem: port to use object logging
Diffstat (limited to 'src')
-rw-r--r--src/mm-broadband-modem.c666
1 files changed, 333 insertions, 333 deletions
diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 6b7687f3..05da641a 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -48,7 +48,7 @@
#include "mm-sms-part-3gpp.h"
#include "mm-call-list.h"
#include "mm-base-sim.h"
-#include "mm-log.h"
+#include "mm-log-object.h"
#include "mm-modem-helpers.h"
#include "mm-error-helpers.h"
#include "mm-port-serial-qcdm.h"
@@ -427,7 +427,7 @@ modem_create_bearer (MMIfaceModem *self,
task = g_task_new (self, NULL, callback, user_data);
/* We just create a MMBroadbandBearer */
- mm_dbg ("Creating Broadband bearer in broadband modem");
+ mm_obj_dbg (self, "creating broadband bearer in broadband modem...");
mm_broadband_bearer_new (MM_BROADBAND_MODEM (self),
props,
NULL, /* cancellable */
@@ -760,6 +760,7 @@ mode_pref_qcdm_ready (MMPortSerialQcdm *port,
GAsyncResult *res,
GTask *task)
{
+ MMBroadbandModem *self;
LoadCapabilitiesContext *ctx;
QcdmResult *result;
gint err = QCDM_SUCCESS;
@@ -767,12 +768,13 @@ mode_pref_qcdm_ready (MMPortSerialQcdm *port,
GError *error = NULL;
GByteArray *response;
+ self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
response = mm_port_serial_qcdm_command_finish (port, res, &error);
if (error) {
/* Fall back to AT checking */
- mm_dbg ("Failed to load NV ModePref: %s", error->message);
+ mm_obj_dbg (self, "failed to load NV ModePref: %s", error->message);
g_error_free (error);
goto at_caps;
}
@@ -783,7 +785,7 @@ mode_pref_qcdm_ready (MMPortSerialQcdm *port,
&err);
g_byte_array_unref (response);
if (!result) {
- mm_dbg ("Failed to parse NV ModePref result: %d", err);
+ mm_obj_dbg (self, "failed to parse NV ModePref result: %d", err);
g_byte_array_unref (response);
goto at_caps;
}
@@ -791,7 +793,7 @@ mode_pref_qcdm_ready (MMPortSerialQcdm *port,
err = qcdm_result_get_u8 (result, QCDM_CMD_NV_GET_MODE_PREF_ITEM_MODE_PREF, &pref);
qcdm_result_unref (result);
if (err) {
- mm_dbg ("Failed to read NV ModePref: %d", err);
+ mm_obj_dbg (self, "failed to read NV ModePref: %d", err);
goto at_caps;
}
@@ -847,8 +849,7 @@ load_current_capabilities_qcdm (GTask *task)
g_assert (ctx->qcdm_port);
if (!mm_port_serial_open (MM_PORT_SERIAL (ctx->qcdm_port), &error)) {
- mm_dbg ("Failed to open QCDM port for NV ModePref request: %s",
- error->message);
+ mm_obj_dbg (self, "failed to open QCDM port for NV ModePref request: %s", error->message);
g_error_free (error);
ctx->qcdm_port = NULL;
load_current_capabilities_at (task);
@@ -878,11 +879,10 @@ modem_load_current_capabilities (MMIfaceModem *self,
LoadCapabilitiesContext *ctx;
GTask *task;
- mm_dbg ("loading current capabilities...");
-
- ctx = g_slice_new0 (LoadCapabilitiesContext);
+ mm_obj_dbg (self, "loading current capabilities...");
task = g_task_new (self, NULL, callback, user_data);
+ ctx = g_slice_new0 (LoadCapabilitiesContext);
g_task_set_task_data (task, ctx, (GDestroyNotify)load_capabilities_context_free);
if (mm_base_modem_peek_port_qcdm (MM_BASE_MODEM (self)))
@@ -920,7 +920,7 @@ modem_load_manufacturer_finish (MMIfaceModem *self,
result = mm_base_modem_at_sequence_finish (MM_BASE_MODEM (self), res, NULL, error);
if (result) {
manufacturer = sanitize_info_reply (result, "GMI:");
- mm_dbg ("loaded manufacturer: %s", manufacturer);
+ mm_obj_dbg (self, "loaded manufacturer: %s", manufacturer);
}
return manufacturer;
}
@@ -936,7 +936,7 @@ modem_load_manufacturer (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading manufacturer...");
+ mm_obj_dbg (self, "loading manufacturer...");
mm_base_modem_at_sequence (
MM_BASE_MODEM (self),
manufacturers,
@@ -960,7 +960,7 @@ modem_load_model_finish (MMIfaceModem *self,
result = mm_base_modem_at_sequence_finish (MM_BASE_MODEM (self), res, NULL, error);
if (result) {
model = sanitize_info_reply (result, "GMM:");
- mm_dbg ("loaded model: %s", model);
+ mm_obj_dbg (self, "loaded model: %s", model);
}
return model;
}
@@ -976,7 +976,7 @@ modem_load_model (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading model...");
+ mm_obj_dbg (self, "loading model...");
mm_base_modem_at_sequence (
MM_BASE_MODEM (self),
models,
@@ -1000,7 +1000,7 @@ modem_load_revision_finish (MMIfaceModem *self,
result = mm_base_modem_at_sequence_finish (MM_BASE_MODEM (self), res, NULL, error);
if (result) {
revision = sanitize_info_reply (result, "GMR:");
- mm_dbg ("loaded revision: %s", revision);
+ mm_obj_dbg (self, "loaded revision: %s", revision);
}
return revision;
}
@@ -1016,7 +1016,7 @@ modem_load_revision (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading revision...");
+ mm_obj_dbg (self, "loading revision...");
mm_base_modem_at_sequence (
MM_BASE_MODEM (self),
revisions,
@@ -1060,7 +1060,7 @@ modem_load_equipment_identifier_finish (MMIfaceModem *self,
} else {
/* Leave whatever the modem returned alone */
}
- mm_dbg ("loaded equipment identifier: %s", equip_id);
+ mm_obj_dbg (self, "loaded equipment identifier: %s", equip_id);
}
return equip_id;
}
@@ -1078,7 +1078,7 @@ modem_load_equipment_identifier (MMIfaceModem *self,
{
const MMBaseModemAtCommand *commands = equipment_identifiers;
- mm_dbg ("loading equipment identifier...");
+ mm_obj_dbg (self, "loading equipment identifier...");
/* On CDMA-only (non-3GPP) modems, just try +GSN */
if (mm_iface_modem_is_cdma_only (self))
@@ -1129,7 +1129,7 @@ modem_load_device_identifier_finish (MMIfaceModem *self,
MM_BROADBAND_MODEM (self),
((DeviceIdentifierContext *)ctx)->ati,
((DeviceIdentifierContext *)ctx)->ati1));
- mm_dbg ("loaded device identifier: %s", device_identifier);
+ mm_obj_dbg (self, "loaded device identifier: %s", device_identifier);
return device_identifier;
}
@@ -1166,7 +1166,7 @@ modem_load_device_identifier (MMIfaceModem *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading device identifier...");
+ mm_obj_dbg (self, "loading device identifier...");
mm_base_modem_at_sequence (
MM_BASE_MODEM (self),
device_identifier_steps,
@@ -1327,9 +1327,9 @@ modem_load_own_numbers (MMIfaceModem *self,
if (mm_port_serial_open (MM_PORT_SERIAL (ctx->qcdm), &error)) {
ctx->qcdm = g_object_ref (ctx->qcdm);
} else {
- mm_dbg ("Couldn't open QCDM port: (%d) %s",
- error ? error->code : -1,
- error ? error->message : "(unknown)");
+ mm_obj_dbg (self, "couldn't open QCDM port: (%d) %s",
+ error ? error->code : -1,
+ error ? error->message : "(unknown)");
ctx->qcdm = NULL;
}
}
@@ -1337,7 +1337,7 @@ modem_load_own_numbers (MMIfaceModem *self,
task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, ctx, (GDestroyNotify)own_numbers_context_free);
- mm_dbg ("loading own numbers...");
+ mm_obj_dbg (self, "loading own numbers...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CNUM",
3,
@@ -1448,13 +1448,13 @@ modem_load_unlock_required (MMIfaceModem *self,
/* CDMA-only modems don't need this */
if (mm_iface_modem_is_cdma_only (self)) {
- mm_dbg ("Skipping unlock check in CDMA-only modem...");
+ mm_obj_dbg (self, "skipping unlock check in CDMA-only modem...");
g_task_return_int (task, MM_MODEM_LOCK_NONE);
g_object_unref (task);
return;
}
- mm_dbg ("checking if unlock required...");
+ mm_obj_dbg (self, "checking if unlock required...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CPIN?",
10,
@@ -1514,17 +1514,17 @@ csim_ready (MMBaseModem *self,
response = mm_base_modem_at_command_finish (self, res, &error);
if (!response) {
- mm_dbg ("Couldn't load retry count for lock '%s': %s",
- mm_modem_lock_get_string (unlock_retries_map[ctx->i].lock),
- error->message);
+ mm_obj_dbg (self, "couldn't load retry count for lock '%s': %s",
+ mm_modem_lock_get_string (unlock_retries_map[ctx->i].lock),
+ error->message);
goto next;
}
val = mm_parse_csim_response (response, &error);
if (val < 0) {
- mm_dbg ("Couldn't parse retry count value for lock '%s': %s",
- mm_modem_lock_get_string (unlock_retries_map[ctx->i].lock),
- error->message);
+ mm_obj_dbg (self, "couldn't parse retry count value for lock '%s': %s",
+ mm_modem_lock_get_string (unlock_retries_map[ctx->i].lock),
+ error->message);
goto next;
}
@@ -1640,7 +1640,7 @@ supported_modes_gcap_ready (MMBaseModem *_self,
self->priv->modem_cdma_evdo_network_supported = TRUE;
g_object_notify (G_OBJECT (self), MM_IFACE_MODEM_CDMA_EVDO_NETWORK_SUPPORTED);
}
- mm_dbg ("Device allows (CDMA) 3G network mode");
+ mm_obj_dbg (self, "device allows (CDMA) 3G network mode");
mode |= MM_MODEM_MODE_3G;
}
/* IS-707 is the 1xRTT family, which we consider as 2G */
@@ -1649,7 +1649,7 @@ supported_modes_gcap_ready (MMBaseModem *_self,
self->priv->modem_cdma_cdma1x_network_supported = TRUE;
g_object_notify (G_OBJECT (self), MM_IFACE_MODEM_CDMA_CDMA1X_NETWORK_SUPPORTED);
}
- mm_dbg ("Device allows (CDMA) 2G network mode");
+ mm_obj_dbg (self, "device allows (CDMA) 2G network mode");
mode |= MM_MODEM_MODE_2G;
}
}
@@ -1668,16 +1668,16 @@ supported_modes_gcap_ready (MMBaseModem *_self,
}
if (error) {
- mm_dbg ("Generic query of supported CDMA networks failed: '%s'", error->message);
+ mm_obj_dbg (self, "generic query of supported CDMA networks failed: '%s'", error->message);
g_error_free (error);
/* Use defaults */
if (self->priv->modem_cdma_cdma1x_network_supported) {
- mm_dbg ("Assuming device allows (CDMA) 2G network mode");
+ mm_obj_dbg (self, "assuming device allows (CDMA) 2G network mode");
ctx->mode |= MM_MODEM_MODE_2G;
}
if (self->priv->modem_cdma_evdo_network_supported) {
- mm_dbg ("Assuming device allows (CDMA) 3G network mode");
+ mm_obj_dbg (self, "assuming device allows (CDMA) 3G network mode");
ctx->mode |= MM_MODEM_MODE_3G;
}
}
@@ -1702,14 +1702,14 @@ supported_modes_ws46_test_ready (MMBroadbandModem *self,
response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
if (error) {
- mm_dbg ("Generic query of supported 3GPP networks with WS46=? failed: '%s'", error->message);
+ mm_obj_dbg (self, "generic query of supported 3GPP networks with WS46=? failed: '%s'", error->message);
g_error_free (error);
goto out;
}
modes = mm_3gpp_parse_ws46_test_response (response, &error);
if (!modes) {
- mm_dbg ("Parsing WS46=? response failed: '%s'", error->message);
+ mm_obj_dbg (self, "parsing WS46=? response failed: '%s'", error->message);
g_error_free (error);
goto out;
}
@@ -1723,7 +1723,7 @@ supported_modes_ws46_test_ready (MMBroadbandModem *self,
ctx->mode |= mode;
str = mm_modem_mode_build_string_from_mask (mode);
- mm_dbg ("Device allows (3GPP) mode combination: %s", str);
+ mm_obj_dbg (self, "device allows (3GPP) mode combination: %s", str);
g_free (str);
}
@@ -1756,7 +1756,7 @@ supported_modes_cnti_ready (MMBroadbandModem *self,
if (g_strstr_len (lower, -1, "gsm") ||
g_strstr_len (lower, -1, "gprs") ||
g_strstr_len (lower, -1, "edge")) {
- mm_dbg ("Device allows (3GPP) 2G networks");
+ mm_obj_dbg (self, "device allows (3GPP) 2G networks");
mode |= MM_MODEM_MODE_2G;
}
@@ -1764,12 +1764,12 @@ supported_modes_cnti_ready (MMBroadbandModem *self,
g_strstr_len (lower, -1, "hsdpa") ||
g_strstr_len (lower, -1, "hsupa") ||
g_strstr_len (lower, -1, "hspa+")) {
- mm_dbg ("Device allows (3GPP) 3G networks");
+ mm_obj_dbg (self, "device allows (3GPP) 3G networks");
mode |= MM_MODEM_MODE_3G;
}
if (g_strstr_len (lower, -1, "lte")) {
- mm_dbg ("Device allows (3GPP) 4G networks");
+ mm_obj_dbg (self, "device allows (3GPP) 4G networks");
mode |= MM_MODEM_MODE_4G;
}
@@ -1777,11 +1777,11 @@ supported_modes_cnti_ready (MMBroadbandModem *self,
/* If no expected ID found, log error */
if (mode == MM_MODEM_MODE_NONE)
- mm_dbg ("Invalid list of supported networks reported by *CNTI: '%s'", response);
+ mm_obj_dbg (self, "invalid list of supported networks reported by *CNTI: '%s'", response);
else
ctx->mode |= mode;
} else {
- mm_dbg ("Generic query of supported 3GPP networks with *CNTI failed: '%s'", error->message);
+ mm_obj_dbg (self, "generic query of supported 3GPP networks with *CNTI failed: '%s'", error->message);
g_error_free (error);
}
@@ -1853,7 +1853,7 @@ modem_load_supported_modes (MMIfaceModem *self,
LoadSupportedModesContext *ctx;
GTask *task;
- mm_dbg ("loading supported modes...");
+ mm_obj_dbg (self, "loading supported modes...");
ctx = g_new0 (LoadSupportedModesContext, 1);
ctx->mode = MM_MODEM_MODE_NONE;
@@ -1928,7 +1928,7 @@ modem_load_supported_ip_families (MMIfaceModem *self,
{
GTask *task;
- mm_dbg ("loading supported IP families...");
+ mm_obj_dbg (self, "loading supported IP families...");
task = g_task_new (self, NULL, callback, user_data);
if (mm_iface_modem_is_cdma_only (self)) {
@@ -1982,7 +1982,7 @@ qcdm_evdo_pilot_sets_log_handle (MMPortSerialQcdm *port,
&pilot_pn,
&pilot_energy,
&rssi_dbm)) {
- mm_dbg ("EVDO active pilot RSSI: %ddBm", rssi_dbm);
+ mm_obj_dbg (self, "EVDO active pilot RSSI: %ddBm", rssi_dbm);
self->priv->evdo_pilot_rssi = rssi_dbm;
}
@@ -2134,14 +2134,11 @@ signal_quality_cind_ready (MMBroadbandModem *self,
GAsyncResult *res,
GTask *task)
{
- SignalQualityContext *ctx;
GError *error = NULL;
const gchar *result;
GByteArray *indicators;
guint quality = 0;
- ctx = g_task_get_task_data (task);
-
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
if (error) {
g_clear_error (&error);
@@ -2150,19 +2147,17 @@ signal_quality_cind_ready (MMBroadbandModem *self,
indicators = mm_3gpp_parse_cind_read_response (result, &error);
if (!indicators) {
- mm_dbg ("(%s) Could not parse CIND signal quality results: %s",
- mm_port_get_device (MM_PORT (ctx->at_port)),
- error->message);
+ mm_obj_dbg (self, "could not parse CIND signal quality results: %s", error->message);
g_clear_error (&error);
goto try_csq;
}
if (indicators->len < self->priv->modem_cind_indicator_signal_quality) {
- mm_dbg ("(%s) Could not parse CIND signal quality results; signal "
- "index (%u) outside received range (0-%u)",
- mm_port_get_device (MM_PORT (ctx->at_port)),
- self->priv->modem_cind_indicator_signal_quality,
- indicators->len);
+ mm_obj_dbg (self,
+ "could not parse CIND signal quality results; signal "
+ "index (%u) outside received range (0-%u)",
+ self->priv->modem_cind_indicator_signal_quality,
+ indicators->len);
} else {
quality = g_array_index (indicators,
guint8,
@@ -2317,7 +2312,7 @@ modem_load_signal_quality (MMIfaceModem *_self,
GError *error = NULL;
GTask *task;
- mm_dbg ("loading signal quality...");
+ mm_obj_dbg (self, "loading signal quality...");
ctx = g_new0 (SignalQualityContext, 1);
task = g_task_new (self, NULL, callback, user_data);
@@ -2348,7 +2343,7 @@ modem_load_signal_quality (MMIfaceModem *_self,
}
ctx->qcdm_port = NULL;
- mm_dbg ("Couldn't open QCDM port: %s", error->message);
+ mm_obj_dbg (self, "couldn't open QCDM port: %s", error->message);
}
/* Return the error we got when getting best AT port */
@@ -2408,24 +2403,25 @@ access_tech_context_free (AccessTechContext *ctx)
}
static AccessTechAndMask *
-access_tech_and_mask_new (AccessTechContext *ctx)
+access_tech_and_mask_new (MMBroadbandModem *self,
+ AccessTechContext *ctx)
{
AccessTechAndMask *tech;
MMModemAccessTechnology act = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN;
guint mask = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN;
if (ctx->fallback_mask) {
- mm_dbg ("Fallback access technology: 0x%08x", ctx->fallback_act);
+ mm_obj_dbg (self, "fallback access technology: 0x%08x", ctx->fallback_act);
act = ctx->fallback_act;
mask = ctx->fallback_mask;
goto done;
}
- mm_dbg ("QCDM operating mode: %d", ctx->opmode);
- mm_dbg ("QCDM system mode: %d", ctx->sysmode);
- mm_dbg ("QCDM hybrid pref: %d", ctx->hybrid);
- mm_dbg ("QCDM WCDMA open: %d", ctx->wcdma_open);
- mm_dbg ("QCDM EVDO open: %d", ctx->evdo_open);
+ mm_obj_dbg (self, "QCDM operating mode: %d", ctx->opmode);
+ mm_obj_dbg (self, "QCDM system mode: %d", ctx->sysmode);
+ mm_obj_dbg (self, "QCDM hybrid pref: %d", ctx->hybrid);
+ mm_obj_dbg (self, "QCDM WCDMA open: %d", ctx->wcdma_open);
+ mm_obj_dbg (self, "QCDM EVDO open: %d", ctx->evdo_open);
if (ctx->opmode == QCDM_CMD_CM_SUBSYS_STATE_INFO_OPERATING_MODE_ONLINE) {
switch (ctx->sysmode) {
@@ -2481,6 +2477,7 @@ access_tech_qcdm_wcdma_ready (MMPortSerialQcdm *port,
GAsyncResult *res,
GTask *task)
{
+ MMBroadbandModem *self;
AccessTechContext *ctx;
QcdmResult *result;
gint err = QCDM_SUCCESS;
@@ -2495,6 +2492,7 @@ access_tech_qcdm_wcdma_ready (MMPortSerialQcdm *port,
return;
}
+ self = g_task_get_source_object (task);
ctx = g_task_get_task_data (task);
/* Parse the response */
@@ -2513,7 +2511,9 @@ access_tech_qcdm_wcdma_ready (MMPortSerialQcdm *port,
ctx->wcdma_open = TRUE;
}
- g_task_return_pointer (task, access_tech_and_mask_new (ctx), g_free);
+ g_task_return_pointer (task,
+ access_tech_and_mask_new (MM_BROADBAND_MODEM (self), ctx),
+ g_free);
g_object_unref (task);
}
@@ -2581,6 +2581,7 @@ access_tech_qcdm_hdr_ready (MMPortSerialQcdm *port,
GAsyncResult *res,
GTask *task)
{
+ MMBroadbandModem *self;
AccessTechContext *ctx;
QcdmResult *result;
gint err = QCDM_SUCCESS;
@@ -2596,7 +2597,8 @@ access_tech_qcdm_hdr_ready (MMPortSerialQcdm *port,
return;
}
- ctx = g_task_get_task_data (task);
+ self = g_task_get_source_object (task);
+ ctx = g_task_get_task_data (task);
/* Parse the response */
result = qcdm_cmd_hdr_subsys_state_info_result ((const gchar *) response->data,
@@ -2614,7 +2616,7 @@ access_tech_qcdm_hdr_ready (MMPortSerialQcdm *port,
ctx->evdo_open = TRUE;
}
- g_task_return_pointer (task, access_tech_and_mask_new (ctx), g_free);
+ g_task_return_pointer (task, access_tech_and_mask_new (self, ctx), g_free);
g_object_unref (task);
}
@@ -2697,9 +2699,9 @@ access_tech_from_cdma_registration_state (MMBroadbandModem *self,
ctx->fallback_mask = MM_IFACE_MODEM_CDMA_ALL_ACCESS_TECHNOLOGIES_MASK;
}
- mm_dbg ("EVDO registration: %d", self->priv->modem_cdma_evdo_registration_state);
- mm_dbg ("CDMA1x registration: %d", self->priv->modem_cdma_cdma1x_registration_state);
- mm_dbg ("Fallback access tech: 0x%08x", ctx->fallback_act);
+ mm_obj_dbg (self, "EVDO registration: %d", self->priv->modem_cdma_evdo_registration_state);
+ mm_obj_dbg (self, "CDMA1x registration: %d", self->priv->modem_cdma_cdma1x_registration_state);
+ mm_obj_dbg (self, "fallback access tech: 0x%08x", ctx->fallback_act);
}
static void
@@ -2727,7 +2729,7 @@ modem_load_access_technologies (MMIfaceModem *self,
if (mm_port_serial_open (MM_PORT_SERIAL (ctx->port), &error)) {
g_object_ref (ctx->port);
- mm_dbg ("loading access technologies via QCDM...");
+ mm_obj_dbg (self, "loading access technologies via QCDM...");
/* FIXME: we may want to run both the CDMA and 3GPP in sequence to ensure
* that a multi-mode device that's in CDMA-mode but still has 3GPP capabilities
@@ -2768,7 +2770,7 @@ modem_load_access_technologies (MMIfaceModem *self,
}
ctx->port = NULL;
- mm_dbg ("Couldn't open QCDM port: %s", error->message);
+ mm_obj_dbg (self, "couldn't open QCDM port: %s", error->message);
g_clear_error (&error);
}
@@ -2778,7 +2780,9 @@ modem_load_access_technologies (MMIfaceModem *self,
* guess access technologies from the registration information.
*/
access_tech_from_cdma_registration_state (MM_BROADBAND_MODEM (self), ctx);
- g_task_return_pointer (task, access_tech_and_mask_new (ctx), g_free);
+ g_task_return_pointer (task,
+ access_tech_and_mask_new (MM_BROADBAND_MODEM (self), ctx),
+ g_free);
} else {
g_task_return_new_error (task,
MM_CORE_ERROR,
@@ -2818,7 +2822,7 @@ bearer_report_disconnected (MMBaseBearer *bearer,
if (mm_base_bearer_get_status (bearer) == MM_BEARER_STATUS_DISCONNECTED)
return;
- mm_info ("Bearer %s: explicitly disconnected", mm_base_bearer_get_path (bearer));
+ mm_obj_info (bearer, "explicitly disconnected");
mm_base_bearer_report_connection_status (bearer, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
}
@@ -2845,13 +2849,13 @@ cgev_process_detach (MMBroadbandModem *self,
MM3gppCgev type)
{
if (type == MM_3GPP_CGEV_NW_DETACH) {
- mm_info ("network forced PS detach: all contexts have been deactivated");
+ mm_obj_info (self, "network forced PS detach: all contexts have been deactivated");
bearer_list_report_disconnections (self, 0);
return;
}
if (type == MM_3GPP_CGEV_ME_DETACH) {
- mm_info ("mobile equipment forced PS detach: all contexts have been deactivated");
+ mm_obj_info (self, "mobile equipment forced PS detach: all contexts have been deactivated");
bearer_list_report_disconnections (self, 0);
return;
}
@@ -2868,24 +2872,24 @@ cgev_process_primary (MMBroadbandModem *self,
guint cid = 0;
if (!mm_3gpp_parse_cgev_indication_primary (str, type, &cid, &error)) {
- mm_warn ("couldn't parse cid info from +CGEV indication '%s': %s", str, error->message);
+ mm_obj_warn (self, "couldn't parse cid info from +CGEV indication '%s': %s", str, error->message);
g_error_free (error);
return;
}
switch (type) {
case MM_3GPP_CGEV_NW_ACT_PRIMARY:
- mm_info ("network request to activate context (cid %u)", cid);
+ mm_obj_info (self, "network request to activate context (cid %u)", cid);
break;
case MM_3GPP_CGEV_ME_ACT_PRIMARY:
- mm_info ("mobile equipment request to activate context (cid %u)", cid);
+ mm_obj_info (self, "mobile equipment request to activate context (cid %u)", cid);
break;
case MM_3GPP_CGEV_NW_DEACT_PRIMARY:
- mm_info ("network request to deactivate context (cid %u)", cid);
+ mm_obj_info (self, "network request to deactivate context (cid %u)", cid);
bearer_list_report_disconnections (self, cid);
break;
case MM_3GPP_CGEV_ME_DEACT_PRIMARY:
- mm_info ("mobile equipment request to deactivate context (cid %u)", cid);
+ mm_obj_info (self, "mobile equipment request to deactivate context (cid %u)", cid);
bearer_list_report_disconnections (self, cid);
break;
case MM_3GPP_CGEV_UNKNOWN:
@@ -2919,24 +2923,24 @@ cgev_process_secondary (MMBroadbandModem *self,
guint cid = 0;
if (!mm_3gpp_parse_cgev_indication_secondary (str, type, &p_cid, &cid, NULL, &error)) {
- mm_warn ("couldn't parse p_cid/cid info from +CGEV indication '%s': %s", str, error->message);
+ mm_obj_warn (self, "couldn't parse p_cid/cid info from +CGEV indication '%s': %s", str, error->message);
g_error_free (error);
return;
}
switch (type) {
case MM_3GPP_CGEV_NW_ACT_SECONDARY:
- mm_info ("network request to activate secondary context (cid %u, primary cid %u)", cid, p_cid);
+ mm_obj_info (self, "network request to activate secondary context (cid %u, primary cid %u)", cid, p_cid);
break;
case MM_3GPP_CGEV_ME_ACT_SECONDARY:
- mm_info ("mobile equipment request to activate secondary context (cid %u, primary cid %u)", cid, p_cid);
+ mm_obj_info (self, "mobile equipment request to activate secondary context (cid %u, primary cid %u)", cid, p_cid);
break;
case MM_3GPP_CGEV_NW_DEACT_SECONDARY:
- mm_info ("network request to deactivate secondary context (cid %u, primary cid %u)", cid, p_cid);
+ mm_obj_info (self, "network request to deactivate secondary context (cid %u, primary cid %u)", cid, p_cid);
bearer_list_report_disconnections (self, cid);
break;
case MM_3GPP_CGEV_ME_DEACT_SECONDARY:
- mm_info ("mobile equipment request to deactivate secondary context (cid %u, primary cid %u)", cid, p_cid);
+ mm_obj_info (self, "mobile equipment request to deactivate secondary context (cid %u, primary cid %u)", cid, p_cid);
bearer_list_report_disconnections (self, cid);
break;
case MM_3GPP_CGEV_UNKNOWN:
@@ -2971,35 +2975,35 @@ cgev_process_pdp (MMBroadbandModem *self,
guint cid = 0;
if (!mm_3gpp_parse_cgev_indication_pdp (str, type, &pdp_type, &pdp_addr, &cid, &error)) {
- mm_warn ("couldn't parse PDP info from +CGEV indication '%s': %s", str, error->message);
+ mm_obj_warn (self, "couldn't parse PDP info from +CGEV indication '%s': %s", str, error->message);
g_error_free (error);
return;
}
switch (type) {
case MM_3GPP_CGEV_REJECT:
- mm_info ("network request to activate context (type %s, address %s) has been automatically rejected", pdp_type, pdp_addr);
+ mm_obj_info (self, "network request to activate context (type %s, address %s) has been automatically rejected", pdp_type, pdp_addr);
break;
case MM_3GPP_CGEV_NW_REACT:
/* NOTE: we don't currently notify about automatic reconnections like this one */
if (cid)
- mm_info ("network request to reactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid);
+ mm_obj_info (self, "network request to reactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid);
else
- mm_info ("network request to reactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr);
+ mm_obj_info (self, "network request to reactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr);
break;
case MM_3GPP_CGEV_NW_DEACT_PDP:
if (cid) {
- mm_info ("network request to deactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid);
+ mm_obj_info (self, "network request to deactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid);
bearer_list_report_disconnections (self, cid);
} else
- mm_info ("network request to deactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr);
+ mm_obj_info (self, "network request to deactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr);
break;
case MM_3GPP_CGEV_ME_DEACT_PDP:
if (cid) {
- mm_info ("mobile equipment request to deactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid);
+ mm_obj_info (self, "mobile equipment request to deactivate context (type %s, address %s, cid %u)", pdp_type, pdp_addr, cid);
bearer_list_report_disconnections (self, cid);
} else
- mm_info ("mobile equipment request to deactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr);
+ mm_obj_info (self, "mobile equipment request to deactivate context (type %s, address %s, cid unknown)", pdp_type, pdp_addr);
break;
case MM_3GPP_CGEV_UNKNOWN:
case MM_3GPP_CGEV_NW_DETACH:
@@ -3070,7 +3074,7 @@ cgev_received (MMPortSerialAt *port,
break;
case MM_3GPP_CGEV_UNKNOWN:
default:
- mm_dbg ("unhandled +CGEV indication: %s", str);
+ mm_obj_dbg (self, "unhandled +CGEV indication: %s", str);
break;
}
@@ -3095,9 +3099,9 @@ set_cgev_unsolicited_events_handlers (MMBroadbandModem *self,
continue;
/* Set/unset unsolicited CGEV event handler */
- mm_dbg ("(%s) %s 3GPP +CGEV unsolicited events handlers",
- mm_port_get_device (MM_PORT (ports[i])),
- enable ? "Setting" : "Removing");
+ mm_obj_dbg (self, "%s 3GPP +CGEV unsolicited events handlers in %s",
+ enable ? "setting" : "removing",
+ mm_port_get_device (MM_PORT (ports[i])));
mm_port_serial_at_add_unsolicited_msg_handler (
ports[i],
cgev_regex,
@@ -3116,7 +3120,7 @@ ciev_signal_received (MMBroadbandModem *self,
guint quality;
if (!mm_get_uint_from_match_info (match_info, 2, &quality)) {
- mm_dbg ("Couldn't parse signal quality value from +CIEV");
+ mm_obj_dbg (self, "couldn't parse signal quality value from +CIEV");
return;
}
@@ -3171,9 +3175,9 @@ set_ciev_unsolicited_events_handlers (MMBroadbandModem *self,
continue;
/* Set/unset unsolicited CIEV event handler */
- mm_dbg ("(%s) %s 3GPP +CIEV unsolicited events handlers",
- mm_port_get_device (MM_PORT (ports[i])),
- enable ? "Setting" : "Removing");
+ mm_obj_dbg (self, "%s 3GPP +CIEV unsolicited events handlers in %s",
+ enable ? "setting" : "removing",
+ mm_port_get_device (MM_PORT (ports[i])));
mm_port_serial_at_add_unsolicited_msg_handler (
ports[i],
ciev_regex,
@@ -3214,12 +3218,13 @@ cgerep_format_check_ready (MMBroadbandModem *self,
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
if (!result) {
- mm_dbg ("+CGEREP check failed, marking packet domain event reporting as unsupported: '%s'", error->message);
+ mm_obj_dbg (self, "+CGEREP check failed: %s", error->message);
+ mm_obj_dbg (self, "packet domain event reporting is unsupported");
g_error_free (error);
goto out;
}
- mm_dbg ("Modem supports packet domain event reporting");
+ mm_obj_dbg (self, "packet domain event reporting is supported");
self->priv->modem_cgerep_supported = TRUE;
out:
@@ -3240,17 +3245,18 @@ cmer_format_check_ready (MMBroadbandModem *self,
result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
if (error || !mm_3gpp_parse_cmer_test_response (result, &supported_modes, &supported_inds, &error)) {
- mm_dbg ("+CMER check failed, marking indications as unsupported: '%s'", error->message);
+ mm_obj_dbg (self, "+CMER check failed: %s", error->message);
+ mm_obj_dbg (self, "generic indications are unsupported");
g_error_free (error);
goto out;
}
aux = mm_3gpp_cmer_mode_build_string_from_mask (supported_modes);
- mm_dbg ("Supported +CMER modes: %s", aux);
+ mm_obj_dbg (self, "supported +CMER modes: %s", aux);
g_free (aux);
aux = mm_3gpp_cmer_ind_build_string_from_mask (supported_inds);
- mm_dbg ("Supported +CMER indication settings: %s", aux);
+ mm_obj_dbg (self, "supported +CMER indication settings: %s", aux);
g_free (aux);
/* Flag +CMER supported values */
@@ -3263,14 +3269,14 @@ cmer_format_check_ready (MMBroadbandModem *self,
self->priv->modem_cmer_enable_mode = MM_3GPP_CMER_MODE_DISCARD_URCS_IF_LINK_RESERVED;
aux = mm_3gpp_cmer_mode_build_string_from_mask (self->priv->modem_cmer_enable_mode);
- mm_dbg ("+CMER enable mode: %s", aux);
+ mm_obj_dbg (self, "+CMER enable mode: %s", aux);
g_free (aux);
if (supported_modes & MM_3GPP_CMER_MODE_DISCARD_URCS)
self->priv->modem_cmer_disable_mode = MM_3GPP_CMER_MODE_DISCARD_URCS;
aux = mm_3gpp_cmer_mode_build_string_from_mask (self->priv->modem_cmer_disable_mode);
- mm_dbg ("+CMER disable mode: %s", aux);
+ mm_obj_dbg (self, "+CMER disable mode: %s", aux);
g_free (aux);
if (supported_inds & MM_3GPP_CMER_IND_ENABLE_NOT_CAUSED_BY_CIND)
@@ -3279,7 +3285,7 @@ cmer_format_check_ready (MMBroadbandModem *self,
self->priv->modem_cmer_ind = MM_3GPP_CMER_IND_ENABLE_ALL;
aux = mm_3gpp_cmer_ind_build_string_from_mask (self->priv->modem_cmer_ind);
- mm_dbg ("+CMER indication setting: %s", aux);
+ mm_obj_dbg (self, "+CMER indication setting: %s", aux);
g_free (aux);
out:
@@ -3301,7 +3307,8 @@ cind_format_check_ready (MMBroadbandModem *self,
if (error ||
!(indicators = mm_3gpp_parse_cind_test_response (result, &error))) {
/* unsupported indications */
- mm_dbg ("+CIND check failed, marking indications as unsupported: '%s'", error->message);
+ mm_obj_dbg (self, "+CIND check failed: %s", error->message);
+ mm_obj_dbg (self, "generic indications are unsupported");
g_error_free (error);
/* go on with remaining checks */
check_and_setup_3gpp_urc_support (task);
@@ -3319,11 +3326,10 @@ cind_format_check_ready (MMBroadbandModem *self,
self->priv->modem_cind_min_signal_quality = mm_3gpp_cind_response_get_min (r);
self->priv->modem_cind_max_signal_quality = mm_3gpp_cind_response_get_max (r);
- mm_dbg ("Modem supports signal quality indications via CIND at index '%u'"
- "(min: %u, max: %u)",
- self->priv->modem_cind_indicator_signal_quality,
- self->priv->modem_cind_min_signal_quality,
- self->priv->modem_cind_max_signal_quality);
+ mm_obj_dbg (self, "signal quality indications via CIND are supported at index '%u' (min: %u, max: %u)",
+ self->priv->modem_cind_indicator_signal_quality,
+ self->priv->modem_cind_min_signal_quality,
+ self->priv->modem_cind_max_signal_quality);
} else
self->priv->modem_cind_indicator_signal_quality = CIND_INDICATOR_INVALID;
@@ -3331,8 +3337,8 @@ cind_format_check_ready (MMBroadbandModem *self,
r = g_hash_table_lookup (indicators, "roam");
if (r) {
self->priv->modem_cind_indicator_roaming = mm_3gpp_cind_response_get_index (r);
- mm_dbg ("Modem supports roaming indications via CIND at index '%u'",
- self->priv->modem_cind_indicator_roaming);
+ mm_obj_dbg (self, "roaming indications via CIND are supported at index '%u'",
+ self->priv->modem_cind_indicator_roaming);
} else
self->priv->modem_cind_indicator_roaming = CIND_INDICATOR_INVALID;
@@ -3340,8 +3346,8 @@ cind_format_check_ready (MMBroadbandModem *self,
r = g_hash_table_lookup (indicators, "service");
if (r) {
self->priv->modem_cind_indicator_service = mm_3gpp_cind_response_get_index (r);
- mm_dbg ("Modem supports service indications via CIND at index '%u'",
- self->priv->modem_cind_indicator_service);
+ mm_obj_dbg (self, "service indications via CIND are supported at index '%u'",
+ self->priv->modem_cind_indicator_service);
} else
self->priv->modem_cind_indicator_service = CIND_INDICATOR_INVALID;
@@ -3365,7 +3371,7 @@ check_and_setup_3gpp_urc_support (GTask *task)
/* Check support for +CIEV indications, managed with +CIND/+CMER */
if (!self->priv->modem_cind_disabled && !self->priv->modem_cind_support_checked) {
- mm_dbg ("Checking indicator support...");
+ mm_obj_dbg (self, "checking indicator support...");
self->priv->modem_cind_support_checked = TRUE;
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CIND=?",
@@ -3378,7 +3384,7 @@ check_and_setup_3gpp_urc_support (GTask *task)
/* Check support for +CGEV indications, managed with +CGEREP */
if (!self->priv->modem_cgerep_support_checked) {
- mm_dbg ("Checking packet domain event reporting...");
+ mm_obj_dbg (self, "checking packet domain event reporting...");
self->priv->modem_cgerep_support_checked = TRUE;
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CGEREP=?",
@@ -3471,9 +3477,9 @@ unsolicited_events_setup_ready (MMBroadbandModem *self,
ctx = g_task_get_task_data (task);
if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) {
- mm_dbg ("Couldn't %s event reporting: '%s'",
- ctx->enable ? "enable" : "disable",
- error->message);
+ mm_obj_dbg (self, "couldn't %s event reporting: '%s'",
+ ctx->enable ? "enable" : "disable",
+ error->message);
g_error_free (error);
}
@@ -3494,28 +3500,28 @@ run_unsolicited_events_setup (GTask *task)
/* CMER on primary port */
if (!ctx->cmer_primary_done && ctx->cmer_command && ctx->primary && !self->priv->modem_cind_disabled) {
- mm_dbg ("%s +CIND event reporting in primary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CIND event reporting in primary port...", ctx->enable ? "enabling" : "disabling");
ctx->cmer_primary_done = TRUE;
command = ctx->cmer_command;
port = ctx->primary;
}
/* CMER on secondary port */
else if (!ctx->cmer_secondary_done && ctx->cmer_command && ctx->secondary && !self->priv->modem_cind_disabled) {
- mm_dbg ("%s +CIND event reporting in secondary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CIND event reporting in secondary port...", ctx->enable ? "enabling" : "disabling");
ctx->cmer_secondary_done = TRUE;
command = ctx->cmer_command;
port = ctx->secondary;
}
/* CGEREP on primary port */
else if (!ctx->cgerep_primary_done && ctx->cgerep_command && ctx->primary) {
- mm_dbg ("%s +CGEV event reporting in primary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CGEV event reporting in primary port...", ctx->enable ? "enabling" : "disabling");
ctx->cgerep_primary_done = TRUE;
command = ctx->cgerep_command;
port = ctx->primary;
}
/* CGEREP on secondary port */
else if (!ctx->cgerep_secondary_done && ctx->cgerep_command && ctx->secondary) {
- mm_dbg ("%s +CGEV event reporting in secondary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CGEV event reporting in secondary port...", ctx->enable ? "enabling" : "disabling");
ctx->cgerep_secondary_done = TRUE;
port = ctx->secondary;
command = ctx->cgerep_command;
@@ -3796,7 +3802,7 @@ modem_load_supported_charsets (MMIfaceModem *self,
/* CDMA-only modems don't need this */
if (mm_iface_modem_is_cdma_only (self)) {
- mm_dbg ("Skipping supported charset loading in CDMA-only modem...");
+ mm_obj_dbg (self, "skipping supported charset loading in CDMA-only modem...");
g_task_return_int (task, MM_MODEM_CHARSET_UNKNOWN);
g_object_unref (task);
return;
@@ -3872,7 +3878,7 @@ ifc_test_ready (MMBaseModem *_self,
return;
}
- mm_dbg ("Flow control settings explicitly requested (%s)", flow_control_requested_str);
+ mm_obj_dbg (self, "flow control settings explicitly requested: %s", flow_control_requested_str);
flow_control_selected = flow_control_requested;
flow_control_selected_str = flow_control_requested_str;
} else {
@@ -3891,7 +3897,7 @@ ifc_test_ready (MMBaseModem *_self,
else
g_assert_not_reached ();
flow_control_selected_str = mm_flow_control_build_string_from_mask (flow_control_selected);
- mm_dbg ("Flow control settings automatically selected (%s)", flow_control_selected_str);
+ mm_obj_dbg (self, "flow control settings automatically selected: %s", flow_control_selected_str);
}
/* Select flow control for all connections */
@@ -3921,7 +3927,7 @@ out:
/* Ignore errors */
if (error) {
- mm_dbg ("couldn't load supported flow control methods: %s", error->message);
+ mm_obj_dbg (self, "couldn't load supported flow control methods: %s", error->message);
g_error_free (error);
}
@@ -3995,13 +4001,13 @@ modem_load_power_state (MMIfaceModem *self,
/* CDMA-only modems don't need this */
if (mm_iface_modem_is_cdma_only (self)) {
- mm_dbg ("Assuming full power state in CDMA-only modem...");
+ mm_obj_dbg (self, "assuming full power state in CDMA-only modem...");
g_task_return_int (task, MM_MODEM_POWER_STATE_ON);
g_object_unref (task);
return;
}
- mm_dbg ("loading power state...");
+ mm_obj_dbg (self, "loading power state...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CFUN?",
3,
@@ -4033,7 +4039,7 @@ modem_power_up (MMIfaceModem *self,
/* CDMA-only modems don't need this */
if (mm_iface_modem_is_cdma_only (self))
- mm_dbg ("Skipping Power-up in CDMA-only modem...");
+ mm_obj_dbg (self, "skipping power-up in CDMA-only modem...");
else
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CFUN=1",
@@ -4095,21 +4101,21 @@ load_sim_identifier_ready (MMBaseSim *sim,
}
if (ctx->retries > 0) {
- mm_warn ("could not load SIM identifier: %s (%d retries left)",
- error->message, ctx->retries);
+ mm_obj_warn (self, "could not load SIM identifier: %s (%d retries left)",
+ error->message, ctx->retries);
--ctx->retries;
g_clear_error (&error);
g_timeout_add_seconds (1, (GSourceFunc) load_sim_identifier, task);
return;
}
- mm_warn ("could not load SIM identifier: %s", error->message);
+ mm_obj_warn (self, "could not load SIM identifier: %s", error->message);
g_task_return_error (task, error);
goto out;
}
if (g_strcmp0 (current_simid, cached_simid) != 0) {
- mm_info ("sim identifier has changed: possible SIM swap during power down/low");
+ mm_obj_info (self, "sim identifier has changed: possible SIM swap during power down/low");
mm_broadband_modem_update_sim_hot_swap_detected (self);
}
@@ -4141,7 +4147,7 @@ modem_check_for_sim_swap (MMIfaceModem *self,
GTask *task;
SimSwapContext *ctx;
- mm_dbg ("Checking if SIM was swapped...");
+ mm_obj_dbg (self, "checking if SIM was swapped...");
task = g_task_new (self, NULL, callback, user_data);
ctx = g_slice_new0 (SimSwapContext);
@@ -4217,7 +4223,7 @@ modem_3gpp_load_imei_finish (MMIfaceModem3gpp *self,
result = mm_strip_tag (result, "+CGSN:");
mm_parse_gsn (result, &imei, NULL, NULL);
- mm_dbg ("loaded IMEI: %s", imei);
+ mm_obj_dbg (self, "loaded IMEI: %s", imei);
return imei;
}
@@ -4226,7 +4232,7 @@ modem_3gpp_load_imei (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading IMEI...");
+ mm_obj_dbg (self, "loading IMEI...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CGSN",
3,
@@ -4360,7 +4366,7 @@ clck_test_ready (MMBaseModem *self,
gchar *str;
str = mm_modem_3gpp_facility_build_string_from_mask (MM_BROADBAND_MODEM (self)->priv->modem_3gpp_ignored_facility_locks);
- mm_dbg ("Ignoring facility locks: '%s'", str);
+ mm_obj_dbg (self, "ignoring facility locks: '%s'", str);
g_free (str);
ctx->facilities &= ~MM_BROADBAND_MODEM (self)->priv->modem_3gpp_ignored_facility_locks;
@@ -4386,7 +4392,7 @@ modem_3gpp_load_enabled_facility_locks (MMIfaceModem3gpp *self,
task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, ctx, g_free);
- mm_dbg ("loading enabled facility locks...");
+ mm_obj_dbg (self, "loading enabled facility locks...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CLCK=?",
3,
@@ -4420,7 +4426,7 @@ modem_3gpp_load_operator_code_finish (MMIfaceModem3gpp *self,
mm_3gpp_normalize_operator (&operator_code, MM_BROADBAND_MODEM (self)->priv->modem_current_charset);
if (operator_code)
- mm_dbg ("loaded Operator Code: %s", operator_code);
+ mm_obj_dbg (self, "loaded Operator Code: %s", operator_code);
return operator_code;
}
@@ -4429,7 +4435,7 @@ modem_3gpp_load_operator_code (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading Operator Code...");
+ mm_obj_dbg (self, "loading Operator Code...");
mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS=3,2", 3, FALSE, NULL, NULL);
mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS?", 3, FALSE, callback, user_data);
}
@@ -4459,7 +4465,7 @@ modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self,
mm_3gpp_normalize_operator (&operator_name, MM_BROADBAND_MODEM (self)->priv->modem_current_charset);
if (operator_name)
- mm_dbg ("loaded Operator Name: %s", operator_name);
+ mm_obj_dbg (self, "loaded Operator Name: %s", operator_name);
return operator_name;
}
@@ -4468,7 +4474,7 @@ modem_3gpp_load_operator_name (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading Operator Name...");
+ mm_obj_dbg (self, "loading Operator Name...");
mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS=3,0", 3, FALSE, NULL, NULL);
mm_base_modem_at_command (MM_BASE_MODEM (self), "+COPS?", 3, FALSE, callback, user_data);
}
@@ -4496,7 +4502,7 @@ modem_3gpp_load_eps_ue_mode_operation (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading UE mode of operation for EPS...");
+ mm_obj_dbg (self, "loading UE mode of operation for EPS...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+CEMODE?",
3,
@@ -4524,7 +4530,7 @@ modem_3gpp_set_eps_ue_mode_operation (MMIfaceModem3gpp *self,
{
gchar *cmd;
- mm_dbg ("updating UE mode of operation for EPS...");
+ mm_obj_dbg (self, "updating UE mode of operation for EPS...");
cmd = mm_3gpp_build_cemode_set_request (mode);
mm_base_modem_at_command (MM_BASE_MODEM (self),
cmd,
@@ -4566,8 +4572,8 @@ registration_state_changed (MMPortSerialAt *port,
&cgreg,
&cereg,
&error)) {
- mm_warn ("error parsing unsolicited registration: %s",
- error && error->message ? error->message : "(unknown)");
+ mm_obj_warn (self, "error parsing unsolicited registration: %s",
+ error && error->message ? error->message : "(unknown)");
g_clear_error (&error);
return;
}
@@ -4623,8 +4629,8 @@ modem_3gpp_setup_unsolicited_registration_events (MMIfaceModem3gpp *self,
if (!ports[i])
continue;
- mm_dbg ("(%s) setting up 3GPP unsolicited registration messages handlers",
- mm_port_get_device (MM_PORT (ports[i])));
+ mm_obj_dbg (self, "setting up 3GPP unsolicited registration messages handlers in %s",
+ mm_port_get_device (MM_PORT (ports[i])));
for (j = 0; j < array->len; j++) {
mm_port_serial_at_add_unsolicited_msg_handler (
MM_PORT_SERIAL_AT (ports[i]),
@@ -4672,9 +4678,8 @@ modem_3gpp_cleanup_unsolicited_registration_events (MMIfaceModem3gpp *self,
if (!ports[i])
continue;
- mm_dbg ("(%s) cleaning up unsolicited registration messages handlers",
- mm_port_get_device (MM_PORT (ports[i])));
-
+ mm_obj_dbg (self, "cleaning up unsolicited registration messages handlers in %s",
+ mm_port_get_device (MM_PORT (ports[i])));
for (j = 0; j < array->len; j++) {
mm_port_serial_at_add_unsolicited_msg_handler (
MM_PORT_SERIAL_AT (ports[i]),
@@ -4995,17 +5000,17 @@ registration_status_check_ready (MMBroadbandModem *self,
*/
if (cgreg) {
if (ctx->running_cs)
- mm_dbg ("Got PS registration state when checking CS registration state");
+ mm_obj_dbg (self, "got PS registration state when checking CS registration state");
else if (ctx->running_eps)
- mm_dbg ("Got PS registration state when checking EPS registration state");
+ mm_obj_dbg (self, "got PS registration state when checking EPS registration state");
mm_iface_modem_3gpp_update_ps_registration_state (MM_IFACE_MODEM_3GPP (self), state);
} else if (cereg) {
tac = lac;
lac = 0;
if (ctx->running_cs)
- mm_dbg ("Got EPS registration state when checking CS registration state");
+ mm_obj_dbg (self, "got EPS registration state when checking CS registration state");
else if (ctx->running_ps)
- mm_dbg ("Got EPS registration state when checking PS registration state");
+ mm_obj_dbg (self, "got EPS registration state when checking PS registration state");
mm_iface_modem_3gpp_update_eps_registration_state (MM_IFACE_MODEM_3GPP (self), state);
} else {
if (act == MM_MODEM_ACCESS_TECHNOLOGY_LTE) {
@@ -5013,9 +5018,9 @@ registration_status_check_ready (MMBroadbandModem *self,
lac = 0;
}
if (ctx->running_ps)
- mm_dbg ("Got CS registration state when checking PS registration state");
+ mm_obj_dbg (self, "got CS registration state when checking PS registration state");
else if (ctx->running_eps)
- mm_dbg ("Got CS registration state when checking EPS registration state");
+ mm_obj_dbg (self, "got CS registration state when checking EPS registration state");
mm_iface_modem_3gpp_update_cs_registration_state (MM_IFACE_MODEM_3GPP (self), state);
}
@@ -5301,9 +5306,9 @@ unsolicited_registration_events_sequence_ready (MMBroadbandModem *self,
mm_base_modem_at_command_full_finish (MM_BASE_MODEM (self), res, &error);
if (error) {
- mm_dbg ("%s unsolicited registration events in secondary port failed: '%s'",
- ctx->enable ? "Enabling" : "Disabling",
- error->message);
+ mm_obj_dbg (self, "%s unsolicited registration events in secondary port failed: %s",
+ ctx->enable ? "enabling" : "disabling",
+ error->message);
/* Keep errors reported */
if (ctx->running_cs && !ctx->cs_error)
ctx->cs_error = error;
@@ -5341,9 +5346,9 @@ unsolicited_registration_events_sequence_ready (MMBroadbandModem *self,
error = g_error_new (MM_CORE_ERROR,
MM_CORE_ERROR_FAILED,
"AT sequence failed");
- mm_dbg ("%s unsolicited registration events in primary port failed: '%s'",
- ctx->enable ? "Enabling" : "Disabling",
- error->message);
+ mm_obj_dbg (self, "%s unsolicited registration events in primary port failed: %s",
+ ctx->enable ? "enabling" : "disabling",
+ error->message);
/* Keep errors reported */
if (ctx->running_cs)
ctx->cs_error = error;
@@ -5619,7 +5624,7 @@ ussd_send_command_ready (MMBaseModem *_self,
response = mm_base_modem_at_command_finish (_self, res, &error);
if (error) {
/* Some immediate error happened when sending the USSD request */
- mm_dbg ("Error sending USSD request: '%s'", error->message);
+ mm_obj_dbg (self, "error sending USSD request: '%s'", error->message);
g_error_free (error);
if (self->priv->pending_ussd_action) {
@@ -5629,17 +5634,17 @@ ussd_send_command_ready (MMBaseModem *_self,
}
if (!self->priv->pending_ussd_action) {
- mm_dbg ("USSD operation finished already via URCs");
+ mm_obj_dbg (self, "USSD operation finished already via URCs");
return;
}
/* Cache the hint for the next time we send something */
ctx = g_task_get_task_data (self->priv->pending_ussd_action);
if (!self->priv->use_unencoded_ussd && ctx->current_is_unencoded) {
- mm_dbg ("Will assume we want unencoded USSD commands");
+ mm_obj_dbg (self, "will assume we want unencoded USSD commands");
self->priv->use_unencoded_ussd = TRUE;
} else if (self->priv->use_unencoded_ussd && !ctx->current_is_unencoded) {
- mm_dbg ("Will assume we want encoded USSD commands");
+ mm_obj_dbg (self, "will assume we want encoded USSD commands");
self->priv->use_unencoded_ussd = FALSE;
}
@@ -5984,7 +5989,7 @@ out:
/* If no pending task, just report the error */
if (error) {
- mm_warn ("Invalid USSD message: %s", error->message);
+ mm_obj_warn (self, "invalid USSD message: %s", error->message);
g_error_free (error);
}
@@ -5998,7 +6003,7 @@ cusd_received (MMPortSerialAt *port,
{
gchar *str;
- mm_dbg ("Unsolicited USSD URC received");
+ mm_obj_dbg (self, "unsolicited USSD URC received");
str = g_match_info_fetch (info, 1);
cusd_process_string (self, str);
g_free (str);
@@ -6024,9 +6029,9 @@ set_unsolicited_result_code_handlers (MMIfaceModem3gppUssd *self,
if (!ports[i])
continue;
/* Set/unset unsolicited CUSD event handler */
- mm_dbg ("(%s) %s unsolicited result code handlers",
- mm_port_get_device (MM_PORT (ports[i])),
- enable ? "Setting" : "Removing");
+ mm_obj_dbg (self, "%s unsolicited result code handlers in %s",
+ enable ? "setting" : "removing",
+ mm_port_get_device (MM_PORT (ports[i])));
mm_port_serial_at_add_unsolicited_msg_handler (
ports[i],
cusd_regex,
@@ -6366,14 +6371,14 @@ cpms_query_ready (MMBroadbandModem *self,
self->priv->current_sms_mem1_storage = mem1;
self->priv->current_sms_mem2_storage = mem2;
- mm_dbg ("Current storages initialized:");
+ mm_obj_dbg (self, "current storages initialized:");
aux = mm_common_build_sms_storages_string (&mem1, 1);
- mm_dbg (" mem1 (list/read/delete) storages: '%s'", aux);
+ mm_obj_dbg (self, " mem1 (list/read/delete) storages: '%s'", aux);
g_free (aux);
aux = mm_common_build_sms_storages_string (&mem2, 1);
- mm_dbg (" mem2 (write/send) storages: '%s'", aux);
+ mm_obj_dbg (self, " mem2 (write/send) storages: '%s'", aux);
g_free (aux);
g_task_return_boolean (task, TRUE);
@@ -6532,8 +6537,8 @@ mm_broadband_modem_lock_sms_storages (MMBroadbandModem *self,
self->priv->current_sms_mem1_storage = mem1;
self->priv->mem1_storage_locked = TRUE;
} else if (self->priv->current_sms_mem1_storage != MM_SMS_STORAGE_UNKNOWN) {
- mm_dbg ("Given sms mem1 storage is unknown. Using current sms mem1 storage value '%s' instead",
- mm_sms_storage_get_string (self->priv->current_sms_mem1_storage));
+ mm_obj_dbg (self, "given sms mem1 storage is unknown. Using current sms mem1 storage value '%s' instead",
+ mm_sms_storage_get_string (self->priv->current_sms_mem1_storage));
} else {
g_task_return_new_error (task,
MM_CORE_ERROR,
@@ -6557,9 +6562,8 @@ mm_broadband_modem_lock_sms_storages (MMBroadbandModem *self,
g_assert (mem1_str != NULL);
/* We don't touch 'mem3' here */
- mm_dbg ("Locking SMS storages to: mem1 (%s), mem2 (%s)...",
- mem1_str,
- mem2_str ? mem2_str : "none");
+ mm_obj_dbg (self, "locking SMS storages to: mem1 (%s), mem2 (%s)...",
+ mem1_str, mem2_str ? mem2_str : "none");
if (mem2_str)
cmd = g_strdup_printf ("+CPMS=\"%s\",\"%s\"", mem1_str, mem2_str);
@@ -6668,13 +6672,12 @@ cmgf_set_ready (MMBroadbandModem *self,
mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error);
if (error) {
- mm_dbg ("Failed to set preferred SMS mode: '%s'; assuming text mode'",
- error->message);
+ mm_obj_dbg (self, "failed to set preferred SMS mode: %s; assuming text mode'", error->message);
g_error_free (error);
self->priv->modem_messaging_sms_pdu_mode = FALSE;
} else
- mm_dbg ("Successfully set preferred SMS mode: '%s'",
- self->priv->modem_messaging_sms_pdu_mode ? "PDU" : "text");
+ mm_obj_dbg (self, "successfully set preferred SMS mode: '%s'",
+ self->priv->modem_messaging_sms_pdu_mode ? "PDU" : "text");
g_task_return_boolean (task, TRUE);
g_object_unref (task);
@@ -6713,8 +6716,7 @@ cmgf_format_check_ready (MMBroadbandModem *self,
&sms_pdu_supported,
&sms_text_supported,
&error)) {
- mm_dbg ("Failed to query supported SMS modes: '%s'",
- error->message);
+ mm_obj_dbg (self, "failed to query supported SMS modes: %s", error->message);
g_error_free (error);
}
@@ -6722,11 +6724,11 @@ cmgf_format_check_ready (MMBroadbandModem *self,
self->priv->modem_messaging_sms_pdu_mode = TRUE;
if (!sms_pdu_supported) {
if (sms_text_supported) {
- mm_dbg ("PDU mode not supported, will try to use Text mode");
+ mm_obj_dbg (self, "PDU mode not supported, will try to use Text mode");
self->priv->modem_messaging_sms_pdu_mode = FALSE;
} else
- mm_dbg ("Neither PDU nor Text modes are reported as supported; "
- "will anyway default to PDU mode");
+ mm_obj_dbg (self, "neither PDU nor Text modes are reported as supported; "
+ "will anyway default to PDU mode");
}
self->priv->sms_supported_modes_checked = TRUE;
@@ -6792,8 +6794,7 @@ sms_part_ready (MMBroadbandModem *self,
if (error) {
/* We're really ignoring this error afterwards, as we don't have a callback
* passed to the async operation, so just log the error here. */
- mm_warn ("Couldn't retrieve SMS part: '%s'",
- error->message);
+ mm_obj_warn (self, "couldn't retrieve SMS part: '%s'", error->message);
g_task_return_error (task, error);
g_object_unref (task);
return;
@@ -6803,8 +6804,7 @@ sms_part_ready (MMBroadbandModem *self,
info = mm_3gpp_parse_cmgr_read_response (response, ctx->idx, &error);
if (!info) {
- mm_warn ("Couldn't parse SMS part: '%s'",
- error->message);
+ mm_obj_warn (self, "couldn't parse SMS part: '%s'", error->message);
g_task_return_error (task, error);
g_object_unref (task);
return;
@@ -6812,14 +6812,14 @@ sms_part_ready (MMBroadbandModem *self,
part = mm_sms_part_3gpp_new_from_pdu (info->index, info->pdu, &error);
if (part) {
- mm_dbg ("Correctly parsed PDU (%d)", ctx->idx);
+ mm_obj_dbg (self, "correctly parsed PDU (%d)", ctx->idx);
mm_iface_modem_messaging_take_part (MM_IFACE_MODEM_MESSAGING (self),
part,
MM_SMS_STATE_RECEIVED,
self->priv->modem_messaging_sms_default_storage);
} else {
/* Don't treat the error as critical */
- mm_dbg ("Error parsing PDU (%d): %s", ctx->idx, error->message);
+ mm_obj_dbg (self, "error parsing PDU (%d): %s", ctx->idx, error->message);
g_error_free (error);
}
@@ -6878,7 +6878,7 @@ cmti_received (MMPortSerialAt *port,
str = mm_get_string_unquoted_from_match_info (info, 1);
storage = mm_common_get_sms_storage_from_string (str, NULL);
if (storage == MM_SMS_STORAGE_UNKNOWN) {
- mm_dbg ("Skipping CMTI indication, unknown storage '%s' reported", str);
+ mm_obj_dbg (self, "skipping CMTI indication, unknown storage '%s' reported", str);
g_free (str);
return;
}
@@ -6888,7 +6888,7 @@ cmti_received (MMPortSerialAt *port,
if (mm_sms_list_has_part (self->priv->modem_messaging_sms_list,
storage,
idx)) {
- mm_dbg ("Skipping CMTI indication, part already processed");
+ mm_obj_dbg (self, "skipping CMTI indication, part already processed");
return;
}
@@ -6916,7 +6916,7 @@ cds_received (MMPortSerialAt *port,
guint length;
gchar *pdu;
- mm_dbg ("Got new non-stored message indication");
+ mm_obj_dbg (self, "got new non-stored message indication");
if (!mm_get_uint_from_match_info (info, 1, &length))
return;
@@ -6927,14 +6927,14 @@ cds_received (MMPortSerialAt *port,
part = mm_sms_part_3gpp_new_from_pdu (SMS_PART_INVALID_INDEX, pdu, &error);
if (part) {
- mm_dbg ("Correctly parsed non-stored PDU");
+ mm_obj_dbg (self, "correctly parsed non-stored PDU");
mm_iface_modem_messaging_take_part (MM_IFACE_MODEM_MESSAGING (self),
part,
MM_SMS_STATE_RECEIVED,
MM_SMS_STORAGE_UNKNOWN);
} else {
/* Don't treat the error as critical */
- mm_dbg ("Error parsing non-stored PDU: %s", error->message);
+ mm_obj_dbg (self, "error parsing non-stored PDU: %s", error->message);
g_error_free (error);
}
}
@@ -6962,9 +6962,9 @@ set_messaging_unsolicited_events_handlers (MMIfaceModemMessaging *self,
continue;
/* Set/unset unsolicited CMTI event handler */
- mm_dbg ("(%s) %s messaging unsolicited events handlers",
- mm_port_get_device (MM_PORT (ports[i])),
- enable ? "Setting" : "Removing");
+ mm_obj_dbg (self, "%s messaging unsolicited events handlers in %s",
+ enable ? "setting" : "removing",
+ mm_port_get_device (MM_PORT (ports[i])));
mm_port_serial_at_add_unsolicited_msg_handler (
ports[i],
cmti_regex,
@@ -7065,14 +7065,14 @@ modem_messaging_enable_unsolicited_events_secondary_ready (MMBaseModem *self,
/* Since the secondary is not required, we don't propagate the error anywhere */
mm_base_modem_at_sequence_full_finish (MM_BASE_MODEM (self), res, NULL, &inner_error);
if (inner_error) {
- mm_dbg ("(%s) Unable to enable messaging unsolicited events on modem secondary: %s",
- mm_port_get_device (MM_PORT (secondary)),
- inner_error->message);
+ mm_obj_dbg (self, "failed to enable messaging unsolicited events on secondary port %s: %s",
+ mm_port_get_device (MM_PORT (secondary)),
+ inner_error->message);
g_error_free (inner_error);
}
- mm_dbg ("(%s) Messaging unsolicited events enabled on secondary",
- mm_port_get_device (MM_PORT (secondary)));
+ mm_obj_dbg (self, "messaging unsolicited events enabled on secondary port %s",
+ mm_port_get_device (MM_PORT (secondary)));
g_task_return_boolean (task, TRUE);
g_object_unref (task);
@@ -7097,13 +7097,13 @@ modem_messaging_enable_unsolicited_events_primary_ready (MMBaseModem *self,
return;
}
- mm_dbg ("(%s) Messaging unsolicited events enabled on primary",
- mm_port_get_device (MM_PORT (primary)));
+ mm_obj_dbg (self, "messaging unsolicited events enabled on primary port %s",
+ mm_port_get_device (MM_PORT (primary)));
/* Try to enable unsolicited events for secondary port */
if (secondary) {
- mm_dbg ("(%s) Enabling messaging unsolicited events on secondary port",
- mm_port_get_device (MM_PORT (secondary)));
+ mm_obj_dbg (self, "enabling messaging unsolicited events on secondary port %s",
+ mm_port_get_device (MM_PORT (secondary)));
mm_base_modem_at_sequence_full (
MM_BASE_MODEM (self),
secondary,
@@ -7132,8 +7132,8 @@ modem_messaging_enable_unsolicited_events (MMIfaceModemMessaging *self,
primary = mm_base_modem_peek_port_primary (MM_BASE_MODEM (self));
/* Enable unsolicited events for primary port */
- mm_dbg ("(%s) Enabling messaging unsolicited events on primary port",
- mm_port_get_device (MM_PORT (primary)));
+ mm_obj_dbg (self, "enabling messaging unsolicited events on primary port %s",
+ mm_port_get_device (MM_PORT (primary)));
mm_base_modem_at_sequence_full (
MM_BASE_MODEM (self),
primary,
@@ -7235,26 +7235,26 @@ sms_text_part_list_ready (MMBroadbandModem *self,
matches = g_match_info_get_match_count (match_info);
if (matches != 7) {
- mm_dbg ("Failed to match entire CMGL response (count %d)", matches);
+ mm_obj_dbg (self, "failed to match entire CMGL response (count %d)", matches);
goto next;
}
if (!mm_get_uint_from_match_info (match_info, 1, &idx)) {
- mm_dbg ("Failed to convert message index");
+ mm_obj_dbg (self, "failed to convert message index");
goto next;
}
/* Get part state */
stat = mm_get_string_unquoted_from_match_info (match_info, 2);
if (!stat) {
- mm_dbg ("Failed to get part status");
+ mm_obj_dbg (self, "failed to get part status");
goto next;
}
/* Get and parse number */
number = mm_get_string_unquoted_from_match_info (match_info, 3);
if (!number) {
- mm_dbg ("Failed to get message sender number");
+ mm_obj_dbg (self, "failed to get message sender number");
g_free (stat);
goto next;
}
@@ -7287,7 +7287,7 @@ sms_text_part_list_ready (MMBroadbandModem *self,
mm_sms_part_take_data (part, raw);
mm_sms_part_set_class (part, -1);
- mm_dbg ("Correctly parsed SMS list entry (%d)", idx);
+ mm_obj_dbg (self, "correctly parsed SMS list entry (%d)", idx);
mm_iface_modem_messaging_take_part (MM_IFACE_MODEM_MESSAGING (self),
part,
sms_state_from_str (stat),
@@ -7357,14 +7357,14 @@ sms_pdu_part_list_ready (MMBroadbandModem *self,
part = mm_sms_part_3gpp_new_from_pdu (info->index, info->pdu, &error);
if (part) {
- mm_dbg ("Correctly parsed PDU (%d)", info->index);
+ mm_obj_dbg (self, "correctly parsed PDU (%d)", info->index);
mm_iface_modem_messaging_take_part (MM_IFACE_MODEM_MESSAGING (self),
part,
sms_state_from_index (info->status),
ctx->list_storage);
} else {
/* Don't treat the error as critical */
- mm_dbg ("Error parsing PDU (%d): %s", info->index, error->message);
+ mm_obj_dbg (self, "error parsing PDU (%d): %s", info->index, error->message);
g_clear_error (&error);
}
}
@@ -7422,8 +7422,7 @@ modem_messaging_load_initial_sms_parts (MMIfaceModemMessaging *self,
task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, ctx, g_free);
- mm_dbg ("Listing SMS parts in storage '%s'",
- mm_sms_storage_get_string (storage));
+ mm_obj_dbg (self, "listing SMS parts in storage '%s'", mm_sms_storage_get_string (storage));
/* First, request to set the proper storage to read from */
mm_broadband_modem_lock_sms_storages (MM_BROADBAND_MODEM (self),
@@ -7618,7 +7617,7 @@ in_call_event_received (MMPortSerialAt *port,
call_info.number = NULL;
str = g_match_info_fetch (info, 1);
- mm_dbg ("Call terminated: %s", str);
+ mm_obj_dbg (self, "call terminated: %s", str);
g_free (str);
mm_iface_modem_voice_report_call (MM_IFACE_MODEM_VOICE (self), &call_info);
@@ -7644,9 +7643,9 @@ set_voice_in_call_unsolicited_events_handlers (MMBroadbandModem *self,
if (!ports[i])
continue;
- mm_dbg ("(%s) %s voice in-call unsolicited events handlers",
- mm_port_get_device (MM_PORT (ports[i])),
- enable ? "Setting" : "Removing");
+ mm_obj_dbg (self, "%s voice in-call unsolicited events handlers in %s",
+ enable ? "setting" : "removing",
+ mm_port_get_device (MM_PORT (ports[i])));
mm_port_serial_at_add_unsolicited_msg_handler (
ports[i],
in_call_event_regex,
@@ -7671,7 +7670,7 @@ modem_voice_setup_in_call_unsolicited_events (MMIfaceModemVoice *_self,
if (!self->priv->in_call_ports_ctx) {
PortsContext *ctx;
- mm_dbg ("Setting up in-call ports context");
+ mm_obj_dbg (self, "setting up in-call ports context");
ctx = ports_context_new ();
if (!ports_context_open (self, ctx, FALSE, TRUE, FALSE, &error)) {
ports_context_unref (ctx);
@@ -7681,7 +7680,7 @@ modem_voice_setup_in_call_unsolicited_events (MMIfaceModemVoice *_self,
self->priv->in_call_ports_ctx = ctx;
}
} else
- mm_dbg ("In-call ports context already set up");
+ mm_obj_dbg (self, "in-call ports context already set up");
task = g_task_new (self, NULL, callback, user_data);
if (error)
@@ -7701,11 +7700,11 @@ modem_voice_cleanup_in_call_unsolicited_events (MMIfaceModemVoice *_self,
self = MM_BROADBAND_MODEM (_self);
if (self->priv->in_call_ports_ctx) {
- mm_dbg ("Cleaning up in-call ports context");
+ mm_obj_dbg (self, "cleaning up in-call ports context");
set_voice_in_call_unsolicited_events_handlers (self, self->priv->in_call_ports_ctx, FALSE);
g_clear_pointer (&self->priv->in_call_ports_ctx, (GDestroyNotify) ports_context_unref);
} else
- mm_dbg ("In-call ports context already cleaned up");
+ mm_obj_dbg (self, "in-call ports context already cleaned up");
task = g_task_new (self, NULL, callback, user_data);
g_task_return_boolean (task, TRUE);
@@ -7735,7 +7734,7 @@ ccwa_received (MMPortSerialAt *port,
call_info.state = MM_CALL_STATE_WAITING;
call_info.number = mm_get_string_unquoted_from_match_info (info, 1);
- mm_dbg ("Call waiting (%s)", call_info.number);
+ mm_obj_dbg (self, "call waiting (%s)", call_info.number);
mm_iface_modem_voice_report_call (MM_IFACE_MODEM_VOICE (self), &call_info);
g_free (call_info.number);
@@ -7753,7 +7752,7 @@ ring_received (MMPortSerialAt *port,
call_info.state = MM_CALL_STATE_RINGING_IN;
call_info.number = NULL;
- mm_dbg ("Ringing");
+ mm_obj_dbg (self, "ringing");
mm_iface_modem_voice_report_call (MM_IFACE_MODEM_VOICE (self), &call_info);
}
@@ -7767,7 +7766,7 @@ cring_received (MMPortSerialAt *port,
/* We could have "VOICE" or "DATA". Now consider only "VOICE" */
str = mm_get_string_unquoted_from_match_info (info, 1);
- mm_dbg ("Ringing (%s)", str);
+ mm_obj_dbg (self, "ringing (%s)", str);
g_free (str);
call_info.index = 0;
@@ -7790,7 +7789,7 @@ clip_received (MMPortSerialAt *port,
call_info.state = MM_CALL_STATE_RINGING_IN;
call_info.number = mm_get_string_unquoted_from_match_info (info, 1);
- mm_dbg ("Ringing (%s)", call_info.number);
+ mm_obj_dbg (self, "ringing (%s)", call_info.number);
mm_iface_modem_voice_report_call (MM_IFACE_MODEM_VOICE (self), &call_info);
g_free (call_info.number);
@@ -7823,9 +7822,9 @@ set_voice_unsolicited_events_handlers (MMIfaceModemVoice *self,
continue;
/* Set/unset unsolicited CMTI event handler */
- mm_dbg ("(%s) %s voice unsolicited events handlers",
- mm_port_get_device (MM_PORT (ports[i])),
- enable ? "Setting" : "Removing");
+ mm_obj_dbg (self, "%s voice unsolicited events handlers in %s",
+ enable ? "setting" : "removing",
+ mm_port_get_device (MM_PORT (ports[i])));
mm_port_serial_at_add_unsolicited_msg_handler (
ports[i],
cring_regex,
@@ -7928,9 +7927,9 @@ voice_unsolicited_events_setup_ready (MMBroadbandModem *self,
ctx = g_task_get_task_data (task);
if (!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, &error)) {
- mm_dbg ("Couldn't %s voice event reporting: '%s'",
- ctx->enable ? "enable" : "disable",
- error->message);
+ mm_obj_dbg (self, "couldn't %s voice event reporting: '%s'",
+ ctx->enable ? "enable" : "disable",
+ error->message);
g_error_free (error);
}
@@ -7951,42 +7950,42 @@ run_voice_unsolicited_events_setup (GTask *task)
/* CLIP on primary port */
if (!ctx->clip_primary_done && ctx->clip_command && ctx->primary) {
- mm_dbg ("%s +CLIP calling line reporting in primary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CLIP calling line reporting in primary port...", ctx->enable ? "enabling" : "disabling");
ctx->clip_primary_done = TRUE;
command = ctx->clip_command;
port = ctx->primary;
}
/* CLIP on secondary port */
else if (!ctx->clip_secondary_done && ctx->clip_command && ctx->secondary) {
- mm_dbg ("%s +CLIP calling line reporting in secondary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CLIP calling line reporting in secondary port...", ctx->enable ? "enabling" : "disabling");
ctx->clip_secondary_done = TRUE;
command = ctx->clip_command;
port = ctx->secondary;
}
/* CRC on primary port */
else if (!ctx->crc_primary_done && ctx->crc_command && ctx->primary) {
- mm_dbg ("%s +CRC extended format of incoming call indications in primary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CRC extended format of incoming call indications in primary port...", ctx->enable ? "enabling" : "disabling");
ctx->crc_primary_done = TRUE;
command = ctx->crc_command;
port = ctx->primary;
}
/* CRC on secondary port */
else if (!ctx->crc_secondary_done && ctx->crc_command && ctx->secondary) {
- mm_dbg ("%s +CRC extended format of incoming call indications in secondary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CRC extended format of incoming call indications in secondary port...", ctx->enable ? "enabling" : "disabling");
ctx->crc_secondary_done = TRUE;
command = ctx->crc_command;
port = ctx->secondary;
}
/* CCWA on primary port */
else if (!ctx->ccwa_primary_done && ctx->ccwa_command && ctx->primary) {
- mm_dbg ("%s +CCWA call waiting indications in primary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CCWA call waiting indications in primary port...", ctx->enable ? "enabling" : "disabling");
ctx->ccwa_primary_done = TRUE;
command = ctx->ccwa_command;
port = ctx->primary;
}
/* CCWA on secondary port */
else if (!ctx->ccwa_secondary_done && ctx->ccwa_command && ctx->secondary) {
- mm_dbg ("%s +CCWA call waiting indications in secondary port...", ctx->enable ? "Enabling" : "Disabling");
+ mm_obj_dbg (self, "%s +CCWA call waiting indications in secondary port...", ctx->enable ? "enabling" : "disabling");
ctx->ccwa_secondary_done = TRUE;
command = ctx->ccwa_command;
port = ctx->secondary;
@@ -8346,7 +8345,7 @@ modem_cdma_load_esn_finish (MMIfaceModemCdma *self,
result = mm_strip_tag (result, "+GSN:");
mm_parse_gsn (result, NULL, NULL, &esn);
- mm_dbg ("loaded ESN: %s", esn);
+ mm_obj_dbg (self, "loaded ESN: %s", esn);
return esn;
}
@@ -8355,7 +8354,7 @@ modem_cdma_load_esn (MMIfaceModemCdma *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- mm_dbg ("loading ESN...");
+ mm_obj_dbg (self, "loading ESN...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+GSN",
3,
@@ -8381,7 +8380,7 @@ modem_cdma_load_meid_finish (MMIfaceModemCdma *self,
result = mm_strip_tag (result, "+GSN:");
mm_parse_gsn (result, NULL, &meid, NULL);
- mm_dbg ("loaded MEID: %s", meid);
+ mm_obj_dbg (self, "loaded MEID: %s", meid);
return meid;
}
@@ -8391,7 +8390,7 @@ modem_cdma_load_meid (MMIfaceModemCdma *self,
gpointer user_data)
{
/* Some devices return both the MEID and the ESN in the +GSN response */
- mm_dbg ("loading MEID...");
+ mm_obj_dbg (self, "loading MEID...");
mm_base_modem_at_command (MM_BASE_MODEM (self),
"+GSN",
3,
@@ -9011,6 +9010,7 @@ qcdm_cdma_status_ready (MMPortSerialQcdm *port,
GAsyncResult *res,
GTask *task)
{
+ MMBroadbandModem *self;
QcdmResult *result = NULL;
guint32 sid = MM_MODEM_CDMA_SID_UNKNOWN;
guint32 nid = MM_MODEM_CDMA_NID_UNKNOWN;
@@ -9019,9 +9019,11 @@ qcdm_cdma_status_ready (MMPortSerialQcdm *port,
GError *error = NULL;
GByteArray *response;
+ self = g_task_get_source_object (task);
+
response = mm_port_serial_qcdm_command_finish (port, res, &error);
if (error) {
- mm_dbg ("Failed to get cdma status: %s", error->message);
+ mm_obj_dbg (self, "failed to get cdma status: %s", error->message);
g_clear_error (&error);
/* Fall back to AT+CSS */
@@ -9034,7 +9036,7 @@ qcdm_cdma_status_ready (MMPortSerialQcdm *port,
&err);
if (!result) {
if (err != QCDM_SUCCESS)
- mm_dbg ("Failed to parse cdma status command result: %d", err);
+ mm_obj_dbg (self, "failed to parse cdma status command result: %d", err);
g_byte_array_unref (response);
/* Fall back to AT+CSS */
@@ -9055,9 +9057,9 @@ qcdm_cdma_status_ready (MMPortSerialQcdm *port,
nid = MM_MODEM_CDMA_NID_UNKNOWN;
}
- mm_dbg ("CDMA 1x Status RX state: %d", rxstate);
- mm_dbg ("CDMA 1x Status SID: %d", sid);
- mm_dbg ("CDMA 1x Status NID: %d", nid);
+ mm_obj_dbg (self, "CDMA 1x Status RX state: %d", rxstate);
+ mm_obj_dbg (self, "CDMA 1x Status SID: %d", sid);
+ mm_obj_dbg (self, "CDMA 1x Status NID: %d", nid);
cdma1x_serving_system_complete_and_free (task,
sid,
@@ -9086,7 +9088,7 @@ modem_cdma_get_cdma1x_serving_system (MMIfaceModemCdma *self,
}
if (!mm_port_serial_open (MM_PORT_SERIAL (qcdm), &error)) {
- mm_dbg ("Failed to open QCDM port for serving-system request: %s", error->message);
+ mm_obj_dbg (self, "failed to open QCDM port for serving-system request: %s", error->message);
g_error_free (error);
/* Fall back to AT+CSS */
@@ -9258,7 +9260,7 @@ speri_ready (MMIfaceModemCdma *self,
response = mm_strip_tag (response, "$SPERI:");
if (!response ||
!mm_cdma_parse_eri (response, &roaming, NULL, NULL)) {
- mm_warn ("Couldn't parse SPERI response '%s'", response);
+ mm_obj_warn (self, "couldn't parse SPERI response '%s'", response);
g_task_return_pointer (task,
detailed_registration_state_result_new (ctx),
g_free);
@@ -9416,7 +9418,7 @@ setup_registration_checks_results_new (MMBroadbandModem *self,
/* Skip QCDM steps if no QCDM port */
if (!ctx->has_qcdm_port) {
- mm_dbg ("Will skip all QCDM-based registration checks");
+ mm_obj_dbg (self, "will skip all QCDM-based registration checks");
results->skip_qcdm_call_manager_step = TRUE;
results->skip_qcdm_hdr_step = TRUE;
}
@@ -9430,14 +9432,12 @@ setup_registration_checks_results_new (MMBroadbandModem *self,
* for the specific step, or subclass this setup and return
* FALSE themselves. */
if (ctx->has_sprint_commands) {
- mm_dbg ("Will skip CDMA1x Serving System check, "
- "we do have Sprint commands");
+ mm_obj_dbg (self, "will skip CDMA1x Serving System check, we do have Sprint commands");
results->skip_at_cdma1x_serving_system_step = TRUE;
} else {
/* If there aren't Sprint specific commands, and the detailed
* registration state getter wasn't subclassed, skip the step */
- mm_dbg ("Will skip generic detailed registration check, we "
- "don't have Sprint commands");
+ mm_obj_dbg (self, "will skip generic detailed registration check, we don't have Sprint commands");
results->skip_detailed_registration_state = TRUE;
}
}
@@ -9640,7 +9640,7 @@ run_cdma_registration_checks_ready (MMBroadbandModem *self,
mm_iface_modem_cdma_run_registration_checks_finish (MM_IFACE_MODEM_CDMA (self), res, &error);
if (error) {
- mm_dbg ("CDMA registration check failed: '%s'", error->message);
+ mm_obj_dbg (self, "CDMA registration check failed: %s", error->message);
mm_iface_modem_cdma_update_cdma1x_registration_state (
MM_IFACE_MODEM_CDMA (self),
MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN,
@@ -9661,10 +9661,9 @@ run_cdma_registration_checks_ready (MMBroadbandModem *self,
/* If we got registered in at least one CDMA network, end registration checks */
if (REG_IS_DONE (self->priv->modem_cdma_cdma1x_registration_state) ||
REG_IS_DONE (self->priv->modem_cdma_evdo_registration_state)) {
- mm_dbg ("Modem is currently registered in a CDMA network "
- "(CDMA1x: '%s', EV-DO: '%s')",
- REG_IS_DONE (self->priv->modem_cdma_cdma1x_registration_state) ? "yes" : "no",
- REG_IS_DONE (self->priv->modem_cdma_evdo_registration_state) ? "yes" : "no");
+ mm_obj_dbg (self, "registered in a CDMA network (CDMA1x: '%s', EV-DO: '%s')",
+ REG_IS_DONE (self->priv->modem_cdma_cdma1x_registration_state) ? "yes" : "no",
+ REG_IS_DONE (self->priv->modem_cdma_evdo_registration_state) ? "yes" : "no");
g_task_return_boolean (task, TRUE);
g_object_unref (task);
return;
@@ -9672,7 +9671,7 @@ run_cdma_registration_checks_ready (MMBroadbandModem *self,
/* Don't spend too much time waiting to get registered */
if (g_timer_elapsed (ctx->timer, NULL) > ctx->max_registration_time) {
- mm_dbg ("CDMA registration check timed out");
+ mm_obj_dbg (self, "CDMA registration check timed out");
mm_iface_modem_cdma_update_cdma1x_registration_state (
MM_IFACE_MODEM_CDMA (self),
MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN,
@@ -9691,7 +9690,7 @@ run_cdma_registration_checks_ready (MMBroadbandModem *self,
}
/* Check again in a few seconds. */
- mm_dbg ("Modem not yet registered in a CDMA network... will recheck soon");
+ mm_obj_dbg (self, "not yet registered in a CDMA network... will recheck soon");
g_timeout_add_seconds (3,
(GSourceFunc)run_cdma_registration_checks_again,
task);
@@ -10237,7 +10236,7 @@ enabling_modem_init_ready (MMBroadbandModem *self,
self->priv->modem_init_run = TRUE;
/* After the modem init sequence, give a 500ms period for the modem to settle */
- mm_dbg ("Giving some time to settle the modem...");
+ mm_obj_dbg (self, "giving some time to settle the modem...");
g_timeout_add (500, (GSourceFunc)enabling_after_modem_init_timeout, task);
}
@@ -10261,7 +10260,7 @@ enabling_flash_done (MMPortSerial *port,
ctx = g_task_get_task_data (task);
if (ctx->modem_init_required) {
- mm_dbg ("Running modem initialization sequence...");
+ mm_obj_dbg (self, "running initialization sequence...");
MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_modem_init (self,
(GAsyncReadyCallback)enabling_modem_init_ready,
task);
@@ -10290,13 +10289,13 @@ enabling_started (MMBroadbandModem *self,
* did it (i.e. don't reinitialize if the modem got disabled and enabled
* again) */
if (self->priv->modem_init_run)
- mm_dbg ("Skipping modem initialization: not first enabling");
+ mm_obj_dbg (self, "skipping initialization: not first enabling");
else if (mm_base_modem_get_hotplugged (MM_BASE_MODEM (self))) {
self->priv->modem_init_run = TRUE;
- mm_dbg ("Skipping modem initialization: device hotplugged");
+ mm_obj_dbg (self, "skipping initialization: device hotplugged");
} else if (!MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_modem_init ||
!MM_BROADBAND_MODEM_GET_CLASS (self)->enabling_modem_init_finish)
- mm_dbg ("Skipping modem initialization: not required");
+ mm_obj_dbg (self, "skipping initialization: not required");
else
ctx->modem_init_required = TRUE;
@@ -10312,7 +10311,7 @@ enabling_started (MMBroadbandModem *self,
}
/* Ports were correctly opened, now flash the primary port */
- mm_dbg ("Flashing primary AT port before enabling...");
+ mm_obj_dbg (self, "flashing primary AT port before enabling...");
mm_port_serial_flash (MM_PORT_SERIAL (ctx->ports->primary),
100,
FALSE,
@@ -10330,11 +10329,11 @@ modem_3gpp_run_registration_checks_ready (MMIfaceModem3gpp *self,
GError *error = NULL;
if (!mm_iface_modem_3gpp_run_registration_checks_finish (self, res, &error)) {
- mm_warn ("Initial 3GPP registration check failed: %s", error->message);
+ mm_obj_warn (self, "initial 3GPP registration check failed: %s", error->message);
g_error_free (error);
return;
}
- mm_dbg ("Initial 3GPP registration checks finished");
+ mm_obj_dbg (self, "initial 3GPP registration checks finished");
}
static void
@@ -10344,11 +10343,11 @@ modem_cdma_run_registration_checks_ready (MMIfaceModemCdma *self,
GError *error = NULL;
if (!mm_iface_modem_cdma_run_registration_checks_finish (self, res, &error)) {
- mm_warn ("Initial CDMA registration check failed: %s", error->message);
+ mm_obj_warn (self, "initial CDMA registration check failed: %s", error->message);
g_error_free (error);
return;
}
- mm_dbg ("Initial CDMA registration checks finished");
+ mm_obj_dbg (self, "initial CDMA registration checks finished");
}
static gboolean
@@ -10410,7 +10409,7 @@ disabling_context_free (DisablingContext *ctx)
if (MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->disabling_stopped &&
!MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->disabling_stopped (ctx->self, &error)) {
- mm_warn ("Error when stopping the disabling sequence: %s", error->message);
+ mm_obj_warn (ctx->self, "error when stopping the disabling sequence: %s", error->message);
g_error_free (error);
}
@@ -10456,8 +10455,8 @@ disable_finish (MMBaseModem *self,
return; \
} \
\
- mm_dbg ("Couldn't disable interface: '%s'", \
- error->message); \
+ mm_obj_dbg (self, "couldn't disable interface: %s", \
+ error->message); \
g_error_free (error); \
return; \
} \
@@ -10596,7 +10595,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_VOICE:
if (ctx->self->priv->modem_voice_dbus_skeleton) {
- mm_dbg ("Modem has voice capabilities, disabling the Voice interface...");
+ mm_obj_dbg (ctx->self, "modem has voice capabilities, disabling the Voice interface...");
/* Disabling the Modem Voice interface */
mm_iface_modem_voice_disable (MM_IFACE_MODEM_VOICE (ctx->self),
(GAsyncReadyCallback)iface_modem_voice_disable_ready,
@@ -10608,7 +10607,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_SIGNAL:
if (ctx->self->priv->modem_signal_dbus_skeleton) {
- mm_dbg ("Modem has extended signal reporting capabilities, disabling the Signal interface...");
+ mm_obj_dbg (ctx->self, "modem has extended signal reporting capabilities, disabling the Signal interface...");
/* Disabling the Modem Signal interface */
mm_iface_modem_signal_disable (MM_IFACE_MODEM_SIGNAL (ctx->self),
(GAsyncReadyCallback)iface_modem_signal_disable_ready,
@@ -10620,7 +10619,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_OMA:
if (ctx->self->priv->modem_oma_dbus_skeleton) {
- mm_dbg ("Modem has OMA capabilities, disabling the OMA interface...");
+ mm_obj_dbg (ctx->self, "modem has OMA capabilities, disabling the OMA interface...");
/* Disabling the Modem Oma interface */
mm_iface_modem_oma_disable (MM_IFACE_MODEM_OMA (ctx->self),
(GAsyncReadyCallback)iface_modem_oma_disable_ready,
@@ -10632,7 +10631,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_TIME:
if (ctx->self->priv->modem_time_dbus_skeleton) {
- mm_dbg ("Modem has time capabilities, disabling the Time interface...");
+ mm_obj_dbg (ctx->self, "modem has time capabilities, disabling the Time interface...");
/* Disabling the Modem Time interface */
mm_iface_modem_time_disable (MM_IFACE_MODEM_TIME (ctx->self),
(GAsyncReadyCallback)iface_modem_time_disable_ready,
@@ -10644,7 +10643,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_MESSAGING:
if (ctx->self->priv->modem_messaging_dbus_skeleton) {
- mm_dbg ("Modem has messaging capabilities, disabling the Messaging interface...");
+ mm_obj_dbg (ctx->self, "modem has messaging capabilities, disabling the Messaging interface...");
/* Disabling the Modem Messaging interface */
mm_iface_modem_messaging_disable (MM_IFACE_MODEM_MESSAGING (ctx->self),
(GAsyncReadyCallback)iface_modem_messaging_disable_ready,
@@ -10656,7 +10655,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_LOCATION:
if (ctx->self->priv->modem_location_dbus_skeleton) {
- mm_dbg ("Modem has location capabilities, disabling the Location interface...");
+ mm_obj_dbg (ctx->self, "modem has location capabilities, disabling the Location interface...");
/* Disabling the Modem Location interface */
mm_iface_modem_location_disable (MM_IFACE_MODEM_LOCATION (ctx->self),
(GAsyncReadyCallback)iface_modem_location_disable_ready,
@@ -10668,7 +10667,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_CDMA:
if (ctx->self->priv->modem_cdma_dbus_skeleton) {
- mm_dbg ("Modem has CDMA capabilities, disabling the Modem CDMA interface...");
+ mm_obj_dbg (ctx->self, "modem has CDMA capabilities, disabling the Modem CDMA interface...");
/* Disabling the Modem CDMA interface */
mm_iface_modem_cdma_disable (MM_IFACE_MODEM_CDMA (ctx->self),
(GAsyncReadyCallback)iface_modem_cdma_disable_ready,
@@ -10680,7 +10679,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_3GPP_USSD:
if (ctx->self->priv->modem_3gpp_ussd_dbus_skeleton) {
- mm_dbg ("Modem has 3GPP/USSD capabilities, disabling the Modem 3GPP/USSD interface...");
+ mm_obj_dbg (ctx->self, "modem has 3GPP/USSD capabilities, disabling the Modem 3GPP/USSD interface...");
/* Disabling the Modem 3GPP USSD interface */
mm_iface_modem_3gpp_ussd_disable (MM_IFACE_MODEM_3GPP_USSD (ctx->self),
(GAsyncReadyCallback)iface_modem_3gpp_ussd_disable_ready,
@@ -10692,7 +10691,7 @@ disabling_step (GTask *task)
case DISABLING_STEP_IFACE_3GPP:
if (ctx->self->priv->modem_3gpp_dbus_skeleton) {
- mm_dbg ("Modem has 3GPP capabilities, disabling the Modem 3GPP interface...");
+ mm_obj_dbg (ctx->self, "modem has 3GPP capabilities, disabling the Modem 3GPP interface...");
/* Disabling the Modem 3GPP interface */
mm_iface_modem_3gpp_disable (MM_IFACE_MODEM_3GPP (ctx->self),
(GAsyncReadyCallback)iface_modem_3gpp_disable_ready,
@@ -10823,8 +10822,8 @@ enable_finish (MMBaseModem *self,
return; \
} \
\
- mm_dbg ("Couldn't enable interface: '%s'", \
- error->message); \
+ mm_obj_dbg (self, "couldn't enable interface: '%s'", \
+ error->message); \
g_error_free (error); \
} \
\
@@ -10946,7 +10945,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_3GPP:
if (ctx->self->priv->modem_3gpp_dbus_skeleton) {
- mm_dbg ("Modem has 3GPP capabilities, enabling the Modem 3GPP interface...");
+ mm_obj_dbg (ctx->self, "modem has 3GPP capabilities, enabling the Modem 3GPP interface...");
/* Enabling the Modem 3GPP interface */
mm_iface_modem_3gpp_enable (MM_IFACE_MODEM_3GPP (ctx->self),
g_task_get_cancellable (task),
@@ -10959,7 +10958,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_3GPP_USSD:
if (ctx->self->priv->modem_3gpp_ussd_dbus_skeleton) {
- mm_dbg ("Modem has 3GPP/USSD capabilities, enabling the Modem 3GPP/USSD interface...");
+ mm_obj_dbg (ctx->self, "modem has 3GPP/USSD capabilities, enabling the Modem 3GPP/USSD interface...");
mm_iface_modem_3gpp_ussd_enable (MM_IFACE_MODEM_3GPP_USSD (ctx->self),
(GAsyncReadyCallback)iface_modem_3gpp_ussd_enable_ready,
task);
@@ -10970,7 +10969,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_CDMA:
if (ctx->self->priv->modem_cdma_dbus_skeleton) {
- mm_dbg ("Modem has CDMA capabilities, enabling the Modem CDMA interface...");
+ mm_obj_dbg (ctx->self, "modem has CDMA capabilities, enabling the Modem CDMA interface...");
/* Enabling the Modem CDMA interface */
mm_iface_modem_cdma_enable (MM_IFACE_MODEM_CDMA (ctx->self),
g_task_get_cancellable (task),
@@ -10983,7 +10982,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_LOCATION:
if (ctx->self->priv->modem_location_dbus_skeleton) {
- mm_dbg ("Modem has location capabilities, enabling the Location interface...");
+ mm_obj_dbg (ctx->self, "modem has location capabilities, enabling the Location interface...");
/* Enabling the Modem Location interface */
mm_iface_modem_location_enable (MM_IFACE_MODEM_LOCATION (ctx->self),
g_task_get_cancellable (task),
@@ -10996,7 +10995,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_MESSAGING:
if (ctx->self->priv->modem_messaging_dbus_skeleton) {
- mm_dbg ("Modem has messaging capabilities, enabling the Messaging interface...");
+ mm_obj_dbg (ctx->self, "modem has messaging capabilities, enabling the Messaging interface...");
/* Enabling the Modem Messaging interface */
mm_iface_modem_messaging_enable (MM_IFACE_MODEM_MESSAGING (ctx->self),
g_task_get_cancellable (task),
@@ -11009,7 +11008,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_TIME:
if (ctx->self->priv->modem_time_dbus_skeleton) {
- mm_dbg ("Modem has time capabilities, enabling the Time interface...");
+ mm_obj_dbg (ctx->self, "modem has time capabilities, enabling the Time interface...");
/* Enabling the Modem Time interface */
mm_iface_modem_time_enable (MM_IFACE_MODEM_TIME (ctx->self),
g_task_get_cancellable (task),
@@ -11022,7 +11021,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_SIGNAL:
if (ctx->self->priv->modem_signal_dbus_skeleton) {
- mm_dbg ("Modem has extended signal reporting capabilities, enabling the Signal interface...");
+ mm_obj_dbg (ctx->self, "modem has extended signal reporting capabilities, enabling the Signal interface...");
/* Enabling the Modem Signal interface */
mm_iface_modem_signal_enable (MM_IFACE_MODEM_SIGNAL (ctx->self),
g_task_get_cancellable (task),
@@ -11035,7 +11034,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_OMA:
if (ctx->self->priv->modem_oma_dbus_skeleton) {
- mm_dbg ("Modem has OMA capabilities, enabling the OMA interface...");
+ mm_obj_dbg (ctx->self, "modem has OMA capabilities, enabling the OMA interface...");
/* Enabling the Modem Oma interface */
mm_iface_modem_oma_enable (MM_IFACE_MODEM_OMA (ctx->self),
g_task_get_cancellable (task),
@@ -11048,7 +11047,7 @@ enabling_step (GTask *task)
case ENABLING_STEP_IFACE_VOICE:
if (ctx->self->priv->modem_voice_dbus_skeleton) {
- mm_dbg ("Modem has voice capabilities, enabling the Voice interface...");
+ mm_obj_dbg (ctx->self, "modem has voice capabilities, enabling the Voice interface...");
/* Enabling the Modem Voice interface */
mm_iface_modem_voice_enable (MM_IFACE_MODEM_VOICE (ctx->self),
g_task_get_cancellable (task),
@@ -11198,7 +11197,7 @@ initialize_context_free (InitializeContext *ctx)
if (ctx->ports_ctx &&
MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_stopped &&
!MM_BROADBAND_MODEM_GET_CLASS (ctx->self)->initialization_stopped (ctx->self, ctx->ports_ctx, &error)) {
- mm_warn ("Error when stopping the initialization sequence: %s", error->message);
+ mm_obj_warn (ctx->self, "error when stopping the initialization sequence: %s", error->message);
g_error_free (error);
}
@@ -11228,7 +11227,7 @@ initialization_started_ready (MMBroadbandModem *self,
/* May return NULL without error */
ports_ctx = MM_BROADBAND_MODEM_GET_CLASS (self)->initialization_started_finish (self, result, &error);
if (error) {
- mm_warn ("Couldn't start initialization: %s", error->message);
+ mm_obj_warn (self, "couldn't start initialization: %s", error->message);
g_error_free (error);
/* There is no Modem interface yet, so just update the variable directly */
@@ -11264,7 +11263,7 @@ iface_modem_initialize_ready (MMBroadbandModem *self,
MMModemStateFailedReason failed_reason = MM_MODEM_STATE_FAILED_REASON_UNKNOWN;
/* Report the new FAILED state */
- mm_warn ("Modem couldn't be initialized: %s", error->message);
+ mm_obj_warn (self, "modem couldn't be initialized: %s", error->message);
if (g_error_matches (error,
MM_MOBILE_EQUIPMENT_ERROR,
@@ -11323,8 +11322,8 @@ iface_modem_initialize_ready (MMBroadbandModem *self,
\
if (!mm_##NAME##_initialize_finish (TYPE (self), result, &error)) { \
if (FATAL_ERRORS) { \
- mm_warn ("Couldn't initialize interface: '%s'", \
- error->message); \
+ mm_obj_warn (self, "couldn't initialize interface: '%s'", \
+ error->message); \
g_error_free (error); \
\
/* Report the new FAILED state */ \
@@ -11337,8 +11336,8 @@ iface_modem_initialize_ready (MMBroadbandModem *self,
return; \
} \
\
- mm_dbg ("Couldn't initialize interface: '%s'", \
- error->message); \
+ mm_obj_dbg (self, "couldn't initialize interface: '%s'", \
+ error->message); \
/* Just shutdown this interface */ \
mm_##NAME##_shutdown (TYPE (self)); \
g_error_free (error); \
@@ -11528,15 +11527,16 @@ initialize_step (GTask *task)
if (is_sim_hot_swap_supported) {
if (!is_sim_hot_swap_configured) {
- mm_warn ("SIM hot swap supported but not configured. Skipping opening ports");
+ mm_obj_warn (ctx->self, "SIM hot swap supported but not configured. Skipping opening ports");
} else {
PortsContext *ports;
GError *error = NULL;
- mm_dbg ("Creating ports context for SIM hot swap");
+ mm_obj_dbg (ctx->self, "creating ports context for SIM hot swap");
ports = ports_context_new ();
if (!ports_context_open (ctx->self, ports, FALSE, FALSE, FALSE, &error)) {
- mm_warn ("Couldn't open ports during Modem SIM hot swap enabling: %s", error? error->message : "unknown reason");
+ mm_obj_warn (ctx->self, "couldn't open ports during Modem SIM hot swap enabling: %s",
+ error ? error->message : "unknown reason");
g_error_free (error);
} else {
ctx->self->priv->sim_hot_swap_ports_ctx = ports_context_ref (ports);
@@ -11546,7 +11546,7 @@ initialize_step (GTask *task)
}
}
} else
- mm_dbg ("Ports context for SIM hot swap already available");
+ mm_obj_dbg (ctx->self, "ports context for SIM hot swap already available");
ctx->step++;
/* fall through */
@@ -11584,13 +11584,13 @@ initialize_step (GTask *task)
if (reason == MM_MODEM_STATE_FAILED_REASON_SIM_MISSING) {
if (!is_sim_hot_swap_supported) {
- mm_dbg ("SIM is missing, but this modem does not support SIM hot swap.");
+ mm_obj_dbg (ctx->self, "SIM is missing, but this modem does not support SIM hot swap.");
} else if (!is_sim_hot_swap_configured) {
- mm_warn ("SIM is missing, but SIM hot swap could not be configured.");
+ mm_obj_warn (ctx->self, "SIM is missing, but SIM hot swap could not be configured.");
} else if (!ctx->self->priv->sim_hot_swap_ports_ctx) {
- mm_err ("SIM is missing and SIM hot swap is configured, but ports are not opened.");
+ mm_obj_err (ctx->self, "SIM is missing and SIM hot swap is configured, but ports are not opened.");
} else {
- mm_dbg ("SIM is missing, but SIM hot swap is enabled. Waiting for SIM...");
+ mm_obj_dbg (ctx->self, "SIM is missing, but SIM hot swap is enabled; waiting for SIM...");
error = g_error_new (MM_CORE_ERROR,
MM_CORE_ERROR_WRONG_STATE,
"Modem is unusable due to SIM missing, "
@@ -11780,20 +11780,20 @@ after_hotswap_event_disable_ready (MMBaseModem *self,
gpointer user_data)
{
GError *error = NULL;
+
mm_base_modem_disable_finish (self, res, &error);
if (error) {
- mm_err ("Disable modem error: %s", error->message);
+ mm_obj_err (self, "failed to disable after hotswap event: %s", error->message);
g_error_free (error);
- } else {
+ } else
mm_base_modem_set_valid (self, FALSE);
- }
}
void
mm_broadband_modem_update_sim_hot_swap_detected (MMBroadbandModem *self)
{
if (self->priv->sim_hot_swap_ports_ctx) {
- mm_dbg ("Releasing SIM hot swap ports context");
+ mm_obj_dbg (self, "releasing SIM hot swap ports context");
ports_context_unref (self->priv->sim_hot_swap_ports_ctx);
self->priv->sim_hot_swap_ports_ctx = NULL;
}