diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-09-24 14:14:04 +0900 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-09-24 14:14:04 +0900 |
commit | be1912fe9c30426dc138a6a7acec068e9151297e (patch) | |
tree | 5611f2de3e7487493495fd3265875ef4b972ba44 /plugins/calypso.c | |
parent | 7ab1258a76c50b45d8de9235ee1e72d1b495d73f (diff) | |
download | ofono-be1912fe9c30426dc138a6a7acec068e9151297e.tar.bz2 |
Make debug handling with OFONO_AT_DEBUG a bit more consistent
Diffstat (limited to 'plugins/calypso.c')
-rw-r--r-- | plugins/calypso.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/plugins/calypso.c b/plugins/calypso.c index a2d4ec82..8c54d5ec 100644 --- a/plugins/calypso.c +++ b/plugins/calypso.c @@ -90,21 +90,18 @@ struct calypso_data { static const char *cpin_prefix[] = { "+CPIN:", NULL }; static const char *none_prefix[] = { NULL }; -static void calypso_debug(const char *str, void *data) +static void calypso_dlc_debug(const char *str, void *user_data) { - guint dlc = GPOINTER_TO_UINT(data); + guint dlc = GPOINTER_TO_UINT(user_data); ofono_info("DLC%u: %s", dlc, str); } -static void calypso_mux_debug(const char *str, void *data) +static void calypso_debug(const char *str, void *user_data) { - ofono_info("MUX: %s", str); -} + const char *prefix = user_data; -static void calypso_setup_debug(const char *str, void *data) -{ - ofono_info("Setup: %s", str); + ofono_info("%s%s", prefix, str); } static int calypso_probe(struct ofono_modem *modem) @@ -272,7 +269,7 @@ static void mux_setup(GAtMux *mux, gpointer user_data) data->mux = mux; if (getenv("OFONO_AT_DEBUG")) - g_at_mux_set_debug(data->mux, calypso_mux_debug, NULL); + g_at_mux_set_debug(data->mux, calypso_debug, "MUX: "); g_at_mux_start(mux); @@ -285,7 +282,7 @@ static void mux_setup(GAtMux *mux, gpointer user_data) g_io_channel_unref(io); if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->dlcs[i], calypso_debug, + g_at_chat_set_debug(data->dlcs[i], calypso_dlc_debug, GUINT_TO_POINTER(i)); g_at_chat_set_wakeup_command(data->dlcs[i], "AT\r", 500, 5000); @@ -336,7 +333,7 @@ static void modem_initialize(struct ofono_modem *modem) goto error; if (getenv("OFONO_AT_DEBUG") != NULL) - g_at_chat_set_debug(chat, calypso_setup_debug, NULL); + g_at_chat_set_debug(chat, calypso_debug, "Setup: "); g_at_chat_set_wakeup_command(chat, "AT\r", 500, 5000); |