Commit b9fe7422 authored by Slava Monich's avatar Slava Monich

[mms-engine] Logging cleanup. MER#1027

Logging functionality that used to be part of mms-engine has been
migrated to libglibutil
parent f4d77484
......@@ -10,13 +10,12 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef JOLLA_MMS_CONNMAN_NEMO_LOG_H
#define JOLLA_MMS_CONNMAN_NEMO_LOG_H
#include "mms_log.h"
#include "mms_lib_types.h"
#define MMS_CONNMAN_LOG_MODULES(log) \
log(gofonoext_log) \
......
......@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "mms_connection_nemo.h"
......@@ -20,9 +19,10 @@
#include <gofono_connctx.h>
/* Logging */
#define MMS_LOG_MODULE_NAME mms_connection_log
#define GLOG_MODULE_NAME mms_connection_log
#include "mms_connman_nemo_log.h"
MMS_LOG_MODULE_DEFINE("mms-connection-nemo");
#include <gutil_log.h>
GLOG_MODULE_DEFINE("mms-connection-nemo");
enum mm_handler_id {
MM_HANDLER_VALID,
......@@ -113,7 +113,7 @@ mms_connection_nemo_reset_mms_imsi_done(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_DEBUG("Released %s", self->path);
GDEBUG("Released %s", self->path);
mms_connman_busy_dec(self->cm);
mms_connection_unref(&self->connection);
}
......@@ -161,7 +161,7 @@ mms_connection_nemo_cancel(
{
if (self->connection.state <= MMS_CONNECTION_STATE_OPENING &&
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_FAILED)) {
MMS_DEBUG("Connection %s cancelled", self->connection.imsi);
GDEBUG("Connection %s cancelled", self->connection.imsi);
} else {
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_CLOSED);
}
......@@ -174,7 +174,7 @@ mms_connection_nemo_cancel_if_invalid(
void* arg)
{
if (!obj->valid) {
MMS_VERBOSE_("oops!");
GVERBOSE_("oops!");
mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg));
}
}
......@@ -186,9 +186,9 @@ mms_connection_nemo_active_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->active) {
MMS_DEBUG("Connection %s opened", self->connection.imsi);
GDEBUG("Connection %s opened", self->connection.imsi);
mms_connection_nemo_set_state(self, MMS_CONNECTION_STATE_OPEN);
} else {
mms_connection_nemo_disconnect_context(self, CONTEXT_HANDLER_ACTIVE);
......@@ -203,10 +203,10 @@ mms_connection_nemo_interface_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->ifname) {
self->connection.netif = context->ifname;
MMS_DEBUG("Interface: %s", self->connection.netif);
GDEBUG("Interface: %s", self->connection.netif);
} else {
self->connection.netif = NULL;
}
......@@ -219,10 +219,10 @@ mms_connection_nemo_mms_proxy_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->mms_proxy) {
self->connection.mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", self->connection.mmsproxy);
GDEBUG("MessageProxy: %s", self->connection.mmsproxy);
} else {
self->connection.mmsproxy = NULL;
}
......@@ -235,10 +235,10 @@ mms_connection_nemo_mms_center_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->mms_center) {
self->connection.mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", self->connection.mmsc);
GDEBUG("MessageCenter: %s", self->connection.mmsc);
} else {
self->connection.mmsc = NULL;
}
......@@ -252,7 +252,7 @@ mms_connection_nemo_activate_failed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
mms_connection_nemo_cancel(self);
}
......@@ -269,7 +269,7 @@ mms_connection_nemo_check_context(
} else {
OfonoConnMgr* connmgr = self->connmgr;
if (ofono_connmgr_valid(connmgr) && connmgr->attached) {
MMS_DEBUG("Activate %s", ofono_connctx_path(context));
GDEBUG("Activate %s", ofono_connctx_path(context));
ofono_connctx_activate(context);
}
}
......@@ -283,7 +283,7 @@ mms_connection_nemo_connmgr_attached_changed(
void* arg)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
MMS_DEBUG("Data registration %s for %s", connmgr->attached ? "on" : "off",
GDEBUG("Data registration %s for %s", connmgr->attached ? "on" : "off",
ofono_connmgr_path(connmgr));
mms_connection_nemo_check_context(self);
}
......@@ -307,15 +307,15 @@ mms_connection_nemo_setup_context(
/* Capture the current context state */
if (context->mms_proxy && context->mms_proxy[0]) {
conn->mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", conn->mmsproxy);
GDEBUG("MessageProxy: %s", conn->mmsproxy);
}
if (context->mms_center && context->mms_center[0]) {
conn->mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", conn->mmsc);
GDEBUG("MessageCenter: %s", conn->mmsc);
}
if (context->ifname && context->ifname[0]) {
conn->netif = context->ifname;
MMS_DEBUG("Interface: %s", conn->netif);
GDEBUG("Interface: %s", conn->netif);
}
/* Track context property changes */
......@@ -364,8 +364,8 @@ void
mms_connection_nemo_init_context(
MMSConnectionNemo* self)
{
MMS_ASSERT(ofono_connmgr_valid(self->connmgr));
MMS_ASSERT(!self->context);
GASSERT(ofono_connmgr_valid(self->connmgr));
GASSERT(!self->context);
/* From this point on, cancel the connection if OfonoConnMgr becomes
* invalid (which would probably mean SIM removal or ofono crash) */
......@@ -379,7 +379,7 @@ mms_connection_nemo_init_context(
self->context = ofono_connctx_ref(ofono_connmgr_get_context_for_type(
self->connmgr, OFONO_CONNCTX_TYPE_MMS));
if (self->context) {
MMS_DEBUG("MMS context %s", ofono_connctx_path(self->context));
GDEBUG("MMS context %s", ofono_connctx_path(self->context));
if (ofono_connctx_valid(self->context)) {
mms_connection_nemo_setup_context(self);
} else {
......@@ -388,7 +388,7 @@ mms_connection_nemo_init_context(
mms_connection_nemo_context_valid_changed, self);
}
} else {
MMS_WARN("No MMS context");
GWARN("No MMS context");
mms_connection_nemo_cancel(self);
}
}
......@@ -414,7 +414,7 @@ mms_connection_nemo_mms_imsi_changed(
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(arg);
if (mm->valid && g_strcmp0(mm->mms_imsi, self->connection.imsi)) {
MMS_VERBOSE_("%s", mm->mms_imsi);
GVERBOSE_("%s", mm->mms_imsi);
mms_connection_nemo_cancel(self);
}
}
......@@ -431,9 +431,9 @@ mms_connection_nemo_set_mms_imsi_done(
if (error) {
mms_connection_nemo_cancel(self);
} else {
MMS_DEBUG("MMS modem path %s", path);
MMS_ASSERT(!self->path);
MMS_ASSERT(!self->connmgr);
GDEBUG("MMS modem path %s", path);
GASSERT(!self->path);
GASSERT(!self->connmgr);
self->path = g_strdup(path);
if (self->connection.state == MMS_CONNECTION_STATE_OPENING) {
......@@ -454,7 +454,7 @@ mms_connection_nemo_set_mms_imsi_done(
}
} else {
/* Connection has been cancelled, release the slot */
MMS_DEBUG("Canceled, releasing %s", path);
GDEBUG("Canceled, releasing %s", path);
mms_connection_ref(&self->connection);
mms_connman_busy_inc(self->cm);
ofonoext_mm_set_mms_imsi_full(self->mm, "",
......@@ -473,7 +473,7 @@ mms_connection_nemo_cancel_if_mm_invalid(
void* arg)
{
if (!mm->valid) {
MMS_VERBOSE_("oops!");
GVERBOSE_("oops!");
mms_connection_nemo_cancel(MMS_CONNECTION_NEMO(arg));
}
}
......@@ -504,7 +504,7 @@ mms_connection_nemo_mm_valid_changed(
OfonoExtModemManager* mm,
void* arg)
{
MMS_VERBOSE_("%p %d", arg, mm->valid);
GVERBOSE_("%p %d", arg, mm->valid);
if (mm->valid) {
mms_connection_nemo_request_sim(arg);
}
......@@ -519,7 +519,7 @@ mms_connection_nemo_new(
MMSConnectionNemo* self = g_object_new(MMS_TYPE_CONNECTION_NEMO, NULL);
MMSConnection* conn = &self->connection;
MMS_VERBOSE_("%p %s", self, imsi);
GVERBOSE_("%p %s", self, imsi);
conn->type = type;
conn->imsi = self->imsi = g_strdup(imsi);
conn->state = MMS_CONNECTION_STATE_OPENING;
......@@ -545,7 +545,7 @@ mms_connection_nemo_close(
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(connection);
OfonoConnCtx* context = self->context;
if (ofono_connctx_valid(context) && context->active) {
MMS_DEBUG("Deactivate %s", ofono_connctx_path(context));
GDEBUG("Deactivate %s", ofono_connctx_path(context));
ofono_connctx_deactivate(context);
} else {
mms_connection_nemo_cancel(self);
......@@ -562,8 +562,8 @@ mms_connection_nemo_dispose(
GObject* object)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(object);
MMS_VERBOSE_("%p %s", self, self->imsi);
MMS_ASSERT(!mms_connection_is_active(&self->connection));
GVERBOSE_("%p %s", self, self->imsi);
GASSERT(!mms_connection_is_active(&self->connection));
mms_connection_nemo_disconnect(self);
if (self->context) {
if (mms_connection_is_active(&self->connection) &&
......@@ -586,7 +586,7 @@ mms_connection_nemo_finalize(
GObject* object)
{
MMSConnectionNemo* self = MMS_CONNECTION_NEMO(object);
MMS_VERBOSE_("%p %s", self, self->imsi);
GVERBOSE_("%p %s", self, self->imsi);
ofono_connmgr_unref(self->connmgr);
ofono_connctx_unref(self->context);
ofonoext_mm_unref(self->mm);
......@@ -618,7 +618,7 @@ void
mms_connection_nemo_init(
MMSConnectionNemo* self)
{
MMS_VERBOSE_("%p", self);
GVERBOSE_("%p", self);
}
/*
......
......@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "mms_connman_nemo.h"
......@@ -20,9 +19,10 @@
#include <gofono_modem.h>
/* Logging */
#define MMS_LOG_MODULE_NAME mms_connman_log
#define GLOG_MODULE_NAME mms_connman_log
#include "mms_connman_nemo_log.h"
MMS_LOG_MODULE_DEFINE("mms-connman-nemo");
#include <gutil_log.h>
GLOG_MODULE_DEFINE("mms-connman-nemo");
enum mm_event {
MM_EVENT_VALID,
......@@ -79,10 +79,10 @@ mms_connman_nemo_check_default_sim(
if (g_strcmp0(path, ofono_simmgr_path(self->default_sim))) {
ofono_simmgr_unref(self->default_sim);
if (path) {
MMS_DEBUG("Default SIM at %s", path);
GDEBUG("Default SIM at %s", path);
self->default_sim = ofono_simmgr_new(path);
} else {
MMS_DEBUG("No default SIM");
GDEBUG("No default SIM");
self->default_sim = NULL;
}
}
......@@ -136,10 +136,10 @@ mms_connman_nemo_default_imsi(
ofono_simmgr_wait_valid(self->default_sim, MMS_INIT_TIMEOUT_MS, 0) &&
self->default_sim /* Check it again */ &&
self->default_sim->imsi) {
MMS_DEBUG("Default IMSI %s", self->default_sim->imsi);
GDEBUG("Default IMSI %s", self->default_sim->imsi);
return g_strdup(self->default_sim->imsi);
}
MMS_DEBUG("No default IMSI");
GDEBUG("No default IMSI");
return NULL;
}
......@@ -153,8 +153,8 @@ mms_connman_nemo_connection_weak_ref_notify(
GObject* connection)
{
MMSConnManNemo* self = MMS_CONNMAN_NEMO(arg);
MMS_ASSERT(MMS_CONNECTION(connection) == self->conn);
MMS_VERBOSE_("%p", connection);
GASSERT(MMS_CONNECTION(connection) == self->conn);
GVERBOSE_("%p", connection);
self->conn_change_id = 0;
self->conn = NULL;
}
......@@ -168,7 +168,7 @@ mms_connman_nemo_drop_connection(
MMSConnManNemo* self)
{
if (self->conn) {
MMS_VERBOSE_("%p", self->conn);
GVERBOSE_("%p", self->conn);
mms_connection_remove_handler(self->conn, self->conn_change_id);
self->conn_change_id = 0;
g_object_weak_unref(G_OBJECT(self->conn),
......@@ -187,7 +187,7 @@ mms_connman_nemo_connection_state_changed(
void* arg)
{
MMSConnManNemo* self = MMS_CONNMAN_NEMO(arg);
MMS_ASSERT(connection == self->conn);
GASSERT(connection == self->conn);
if (self->conn && !mms_connection_is_active(self->conn)) {
mms_connman_nemo_drop_connection(self);
}
......@@ -216,7 +216,7 @@ mms_connman_nemo_open_connection(
self->conn = mms_connection_nemo_new(cm, imsi, type);
self->conn_change_id = mms_connection_add_state_change_handler(self->conn,
mms_connman_nemo_connection_state_changed, self);
MMS_ASSERT(mms_connection_is_active(self->conn));
GASSERT(mms_connection_is_active(self->conn));
g_object_weak_ref(G_OBJECT(self->conn),
mms_connman_nemo_connection_weak_ref_notify, self);
return self->conn;
......@@ -260,7 +260,7 @@ mms_connman_nemo_finalize(
GObject* object)
{
MMSConnManNemo* self = MMS_CONNMAN_NEMO(object);
MMS_VERBOSE_("");
GVERBOSE_("");
ofonoext_mm_unref(self->mm);
G_OBJECT_CLASS(mms_connman_nemo_parent_class)->finalize(object);
}
......@@ -288,7 +288,7 @@ void
mms_connman_nemo_init(
MMSConnManNemo* self)
{
MMS_VERBOSE_("");
GVERBOSE_("");
self->mm = ofonoext_mm_new();
self->mm_event_id[MM_EVENT_VALID] =
ofonoext_mm_add_valid_changed_handler(self->mm,
......
......@@ -10,13 +10,12 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef JOLLA_MMS_CONNMAN_OFONO_LOG_H
#define JOLLA_MMS_CONNMAN_OFONO_LOG_H
#include "mms_log.h"
#include "mms_lib_types.h"
#define MMS_CONNMAN_LOG_MODULES(log) \
log(gofono_log)
......
......@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "mms_connection_ofono.h"
......@@ -19,9 +18,10 @@
#include <gofono_simmgr.h>
/* Logging */
#define MMS_LOG_MODULE_NAME mms_connection_log
#define GLOG_MODULE_NAME mms_connection_log
#include "mms_connman_ofono_log.h"
MMS_LOG_MODULE_DEFINE("mms-connection-ofono");
#include <gutil_log.h>
GLOG_MODULE_DEFINE("mms-connection-ofono");
enum context_handler_id {
CONTEXT_HANDLER_ACTIVATE_FAILED,
......@@ -109,9 +109,9 @@ mms_connection_ofono_active_changed(
void* arg)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->active) {
MMS_DEBUG("Connection %s opened", self->connection.imsi);
GDEBUG("Connection %s opened", self->connection.imsi);
mms_connection_ofono_set_state(self, MMS_CONNECTION_STATE_OPEN);
} else {
mms_connection_ofono_set_state(self, MMS_CONNECTION_STATE_CLOSED);
......@@ -125,10 +125,10 @@ mms_connection_ofono_interface_changed(
void* arg)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->ifname) {
self->connection.netif = context->ifname;
MMS_DEBUG("Interface: %s", self->connection.netif);
GDEBUG("Interface: %s", self->connection.netif);
} else {
self->connection.netif = NULL;
}
......@@ -141,10 +141,10 @@ mms_connection_ofono_mms_proxy_changed(
void* arg)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->mms_proxy) {
self->connection.mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", self->connection.mmsproxy);
GDEBUG("MessageProxy: %s", self->connection.mmsproxy);
} else {
self->connection.mmsproxy = NULL;
}
......@@ -157,10 +157,10 @@ mms_connection_ofono_mms_center_changed(
void* arg)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
if (context->mms_center) {
self->connection.mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", self->connection.mmsc);
GDEBUG("MessageCenter: %s", self->connection.mmsc);
} else {
self->connection.mmsc = NULL;
}
......@@ -173,9 +173,9 @@ mms_connection_ofono_imsi_changed(
void* arg)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->sim == sim);
GASSERT(self->sim == sim);
if (g_strcmp0(sim->imsi, self->connection.imsi)) {
MMS_DEBUG_("%s", sim->imsi);
GDEBUG_("%s", sim->imsi);
mms_connection_ofono_cancel(self);
}
}
......@@ -187,10 +187,10 @@ mms_connection_ofono_present_changed(
void* arg)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->sim == sim);
MMS_DEBUG_("%s", sim->present ? "true" : "false");
GASSERT(self->sim == sim);
GDEBUG_("%s", sim->present ? "true" : "false");
if (!sim->present) {
MMS_DEBUG_("%s", sim->imsi);
GDEBUG_("%s", sim->imsi);
mms_connection_ofono_cancel(self);
}
}
......@@ -203,7 +203,7 @@ mms_connection_ofono_activate_failed(
void* arg)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(arg);
MMS_ASSERT(self->context == context);
GASSERT(self->context == context);
mms_connection_ofono_cancel(self);
}
......@@ -216,9 +216,9 @@ mms_connection_ofono_new(
MMSConnectionOfono* self = g_object_new(MMS_TYPE_CONNECTION_OFONO, NULL);
MMSConnection* conn = &self->connection;
MMS_ASSERT(ofono_simmgr_valid(sim));
MMS_ASSERT(sim->present);
MMS_VERBOSE_("%p %s", self, sim->imsi);
GASSERT(ofono_simmgr_valid(sim));
GASSERT(sim->present);
GVERBOSE_("%p %s", self, sim->imsi);
conn->type = type;
conn->imsi = self->imsi = g_strdup(sim->imsi);
......@@ -229,15 +229,15 @@ mms_connection_ofono_new(
if (context->mms_proxy && context->mms_proxy[0]) {
conn->mmsproxy = context->mms_proxy;
MMS_DEBUG("MessageProxy: %s", conn->mmsproxy);
GDEBUG("MessageProxy: %s", conn->mmsproxy);
}
if (context->mms_center && context->mms_center[0]) {
conn->mmsc = context->mms_center;
MMS_DEBUG("MessageCenter: %s", conn->mmsc);
GDEBUG("MessageCenter: %s", conn->mmsc);
}
if (context->ifname && context->ifname[0]) {
conn->netif = context->ifname;
MMS_DEBUG("Interface: %s", conn->netif);
GDEBUG("Interface: %s", conn->netif);
}
/* Listen for property changes */
......@@ -286,8 +286,8 @@ mms_connection_ofono_dispose(
GObject* object)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(object);
MMS_VERBOSE_("%p %s", self, self->imsi);
MMS_ASSERT(!mms_connection_is_active(&self->connection));
GVERBOSE_("%p %s", self, self->imsi);
GASSERT(!mms_connection_is_active(&self->connection));
mms_connection_ofono_disconnect(self);
if (self->sim) {
ofono_simmgr_unref(self->sim);
......@@ -314,7 +314,7 @@ mms_connection_ofono_finalize(
GObject* object)
{
MMSConnectionOfono* self = MMS_CONNECTION_OFONO(object);
MMS_VERBOSE_("%p %s", self, self->imsi);
GVERBOSE_("%p %s", self, self->imsi);
g_free(self->imsi);
G_OBJECT_CLASS(mms_connection_ofono_parent_class)->finalize(object);
}
......@@ -341,7 +341,7 @@ void
mms_connection_ofono_init(
MMSConnectionOfono* self)
{
MMS_VERBOSE_("%p", self);
GVERBOSE_("%p", self);
}
/*
......
......@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "mms_connman_ofono.h"
......@@ -23,9 +22,10 @@
#include <gofono_modem.h>
/* Logging */
#define MMS_LOG_MODULE_NAME mms_connman_log
#define GLOG_MODULE_NAME mms_connman_log
#include "mms_connman_ofono_log.h"
MMS_LOG_MODULE_DEFINE("mms-connman-ofono");
#include <gutil_log.h>
GLOG_MODULE_DEFINE("mms-connman-ofono");
enum manager_handler_id {
MANAGER_HANDLER_VALID_CHANGED,
......@@ -78,25 +78,25 @@ mms_connman_ofono_wait_valid(
self->default_modem->modem &&
!ofono_modem_wait_valid(self->default_modem->modem,
MMS_OFONO_TIMEOUT, &error)) {
MMS_ERR("%s", MMS_ERRMSG(error));
GERR("%s", GERRMSG(error));
g_error_free(error);
}
if (self->default_modem &&
self->default_modem->simmgr &&
!ofono_simmgr_wait_valid(self->default_modem->simmgr,
MMS_OFONO_TIMEOUT, &error)) {
MMS_ERR("%s", MMS_ERRMSG(error));
GERR("%s", GERRMSG(error));
g_error_free(error);
}
if (self->default_modem &&
self->default_modem->connmgr &&
!ofono_connmgr_wait_valid(self->default_modem->connmgr,
MMS_OFONO_TIMEOUT, &error)) {
MMS_ERR("%s", MMS_ERRMSG(error));
GERR("%s", GERRMSG(error));
g_error_free(error);
}
} else {
MMS_ERR("%s", MMS_ERRMSG(error));
GERR("%s", GERRMSG(error));
g_error_free(error);
}
}
......@@ -125,19 +125,19 @@ mms_connman_ofono_modem_for_imsi(
return modem;
}
}
MMS_INFO("SIM %s is not avialable", imsi);
GINFO("SIM %s is not avialable", imsi);
} else if (self->default_modem) {
if (ofono_simmgr_valid(self->default_modem->simmgr)) {
if (self->default_modem->simmgr->present) {
return self->default_modem;
} else {
MMS_INFO("SIM card is not present");
GINFO("SIM card is not present");
}
} else {
MMS_INFO("No SIM card found");
GINFO("No SIM card found");
}
} else {
MMS_WARN("No default modem");
GWARN("No default modem");
}
return NULL;
}
......@@ -178,7 +178,7 @@ mms_connman_ofono_connection_gone(
MMSOfonoModem* modem = value;
if (((GObject*)modem->conn) == connection) {
modem->conn = NULL;
MMS_VERBOSE_("%s", ofono_modem_path(modem->modem));
GVERBOSE_("%s", ofono_modem_path(modem->modem));
break;
}
}
......@@ -215,7 +215,7 @@ mms_connman_ofono_open_connection(
}
return modem->conn;
} else {
MMS_WARN("SIM %s has no MMS context", imsi);
GWARN("SIM %s has no MMS context", imsi);
}
}
return NULL;
......@@ -243,9 +243,9 @@ mms_connman_ofono_select_default_modem(
}
if (self->default_modem != context) {
if (context) {
MMS_INFO("Default modem %s", ofono_modem_path(context->modem));
GINFO("Default modem %s", ofono_modem_path(context->modem));
} else {
MMS_INFO("No default modem");
GINFO("No default modem");
}
self->default_modem = context;
}
......@@ -289,7 +289,7 @@ mms_connman_ofono_modem_added(
{
if (manager->valid) {
MMSConnManOfono* self = MMS_CONNMAN_OFONO(arg);
MMS_ASSERT(manager == self->manager);
GASSERT(manager == self->manager);
mms_connman_ofono_add_modem(self, modem);
mms_connman_ofono_select_default_modem(self);
}
......@@ -304,7 +304,7 @@ mms_connman_ofono_modem_removed(
{
if (manager->valid) {
MMSConnManOfono* self = MMS_CONNMAN_OFONO(arg);
MMS_ASSERT(manager == self->manager);
GASSERT(manager == self->manager);
g_hash_table_remove(self->modems, path);
mms_connman_ofono_select_default_modem(self);
}
......@@ -330,7 +330,7 @@ mms_connman_ofono_valid_changed(
void* arg)
{
MMSConnManOfono* self = MMS_CONNMAN_OFONO(arg);
MMS_ASSERT(manager == self->manager);
GASSERT(manager == self->manager);
if (manager->valid) {
mms_connman_ofono_init_modems(self);
} else {
......@@ -391,7 +391,7 @@ mms_connman_ofono_dispose(
GObject* object)
{
MMSConnManOfono* self = MMS_CONNMAN_OFONO(object);
MMS_VERBOSE_("");
GVERBOSE_("");
self->default_modem = NULL;
g_hash_table_remove_all(self->modems);
if (self->manager) {
......@@ -412,7 +412,7 @@ mms_connman_ofono_finalize(
GObject* object)
{
MMSConnManOfono* self = MMS_CONNMAN_OFONO(object);
MMS_VERBOSE_("");
GVERBOSE_("");
g_hash_table_destroy(self->modems);
G_OBJECT_CLASS(mms_connman_ofono_parent_class)->finalize(object);
}
......
......@@ -10,7 +10,6 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/