From d66fd48bf962079e13a3e3a7a97174e79c582c4f Mon Sep 17 00:00:00 2001 From: Andres Salomon Date: Wed, 5 Aug 2009 17:18:34 -0400 Subject: gatchat: add debugging infrastructure This patch adds debugging support to GAtChat (specifically of what's going across the serial line). Callbacks can be set via g_at_chat_set_debugging, and that callback is called after any channel reads or writes. --- gatchat/gatchat.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gatchat/gatchat.h') diff --git a/gatchat/gatchat.h b/gatchat/gatchat.h index d0a59b83..9bfcab1d 100644 --- a/gatchat/gatchat.h +++ b/gatchat/gatchat.h @@ -37,6 +37,7 @@ typedef void (*GAtResultFunc)(gboolean success, GAtResult *result, gpointer user_data); typedef void (*GAtNotifyFunc)(GAtResult *result, gpointer user_data); typedef void (*GAtDisconnectFunc)(gpointer user_data); +typedef void (*GAtDebugFunc)(const char *str, gpointer user_data); enum _GAtChatFlags { G_AT_CHAT_FLAG_NO_LEADING_CRLF = 1, /* Some emulators are broken */ @@ -56,6 +57,9 @@ gboolean g_at_chat_shutdown(GAtChat *chat); gboolean g_at_chat_set_disconnect_function(GAtChat *chat, GAtDisconnectFunc disconnect, gpointer user_data); +gboolean g_at_chat_set_debugging(GAtChat *chat, GAtDebugFunc func, + gpointer user_data); + /*! * Queue an AT command for execution. The command contents are given * in cmd. Once the command executes, the callback function given by -- cgit v1.2.3