diff options
-rw-r--r-- | drivers/atmodem/atmodem.c | 9 |
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, |