summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-08-06 15:50:22 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-08-06 16:38:46 -0500
commit7b8f5bed5db243722201696c1daa46142c715d3a (patch)
tree584d135b5082f90b759f5e079147cf5cbb17e9d7 /drivers
parent88b327cff57b24c1a64248fcb8e10c63e5969232 (diff)
downloadofono-7b8f5bed5db243722201696c1daa46142c715d3a.tar.bz2
Update AT modem plugin to use GAtChat logging
Enabled if OFONO_AT_DEBUG environment variable is set
Diffstat (limited to 'drivers')
-rw-r--r--drivers/atmodem/atmodem.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/atmodem/atmodem.c b/drivers/atmodem/atmodem.c
index f6fc44ff..727d6427 100644
--- a/drivers/atmodem/atmodem.c
+++ b/drivers/atmodem/atmodem.c
@@ -27,6 +27,7 @@
#include <glib.h>
#include <gdbus.h>
#include <gatchat.h>
+#include <stdlib.h>
#include <ofono/plugin.h>
#include <ofono/log.h>
@@ -315,6 +316,11 @@ static void msg_destroy(gpointer user)
dbus_message_unref(msg);
}
+static void at_debug(const char *str, gpointer user)
+{
+ ofono_debug("%s", str);
+}
+
static void create_cb(GIOChannel *io, gboolean success, gpointer user)
{
DBusConnection *conn = ofono_dbus_get_connection();
@@ -341,6 +347,9 @@ static void create_cb(GIOChannel *io, gboolean success, gpointer user)
if (at->parser == NULL)
goto out;
+ if (getenv("OFONO_AT_DEBUG") != NULL)
+ g_at_chat_set_debug(at->parser, at_debug, NULL);
+
ofono_debug("Seting up AT channel");
dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &target,