summaryrefslogtreecommitdiffstats
path: root/gatchat/gatmux.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-09-06 00:31:26 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-09-06 00:31:26 +0200
commit094fdd4e71dff7fe982bab7f6cebc7a8f666ca49 (patch)
treedf67d74ccab987505f183a809590512cb4c5489e /gatchat/gatmux.c
parentc9ba0e7df580a0e1f262077441652f4d5b3d6cff (diff)
downloadofono-094fdd4e71dff7fe982bab7f6cebc7a8f666ca49.tar.bz2
Add functions for disconnect and debug handling
Diffstat (limited to 'gatchat/gatmux.c')
-rw-r--r--gatchat/gatmux.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/gatchat/gatmux.c b/gatchat/gatmux.c
index 6c67bfd6..aeb5b591 100644
--- a/gatchat/gatmux.c
+++ b/gatchat/gatmux.c
@@ -35,8 +35,12 @@
#include "gatmux.h"
struct _GAtMux {
- gint ref_count; /* Ref count */
- GIOChannel *channel; /* channel */
+ gint ref_count; /* Ref count */
+ GIOChannel *channel; /* channel */
+ GAtDisconnectFunc user_disconnect; /* user disconnect func */
+ gpointer user_disconnect_data; /* user disconnect data */
+ GAtDebugFunc debugf; /* debugging output function */
+ gpointer debug_data; /* Data to pass to debug func */
};
GAtMux *g_at_mux_new(GIOChannel *channel)
@@ -125,3 +129,26 @@ gboolean g_at_mux_shutdown(GAtMux *mux)
return TRUE;
}
+
+gboolean g_at_mux_set_disconnect_function(GAtMux *mux,
+ GAtDisconnectFunc disconnect, gpointer user_data)
+{
+ if (mux == NULL)
+ return FALSE;
+
+ mux->user_disconnect = disconnect;
+ mux->user_disconnect_data = user_data;
+
+ return TRUE;
+}
+
+gboolean g_at_mux_set_debug(GAtMux *mux, GAtDebugFunc func, gpointer user)
+{
+ if (mux == NULL)
+ return FALSE;
+
+ mux->debugf = func;
+ mux->debug_data = user;
+
+ return TRUE;
+}