summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-04-28 17:15:07 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-04-28 17:27:36 -0500
commit378f3c61e3540c737cd0d45c5c946ddcf40c471a (patch)
tree72a3e3ad6791fabeb29c6c9799d100554076a358
parent3b98ed067a1d4c4916d928f6e08e7907cee462ed (diff)
downloadofono-378f3c61e3540c737cd0d45c5c946ddcf40c471a.tar.bz2
gathdlc: Add accessor for GAtIO
-rw-r--r--gatchat/gathdlc.c8
-rw-r--r--gatchat/gathdlc.h3
-rw-r--r--gatchat/gatio.h2
3 files changed, 13 insertions, 0 deletions
diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c
index a5e8ed41..48426674 100644
--- a/gatchat/gathdlc.c
+++ b/gatchat/gathdlc.c
@@ -313,6 +313,14 @@ guint32 g_at_hdlc_get_xmit_accm(GAtHDLC *hdlc)
return hdlc->xmit_accm[0];
}
+GAtIO *g_at_hdlc_get_io(GAtHDLC *hdlc)
+{
+ if (hdlc == NULL)
+ return NULL;
+
+ return hdlc->io;
+}
+
#define NEED_ESCAPE(xmit_accm, c) xmit_accm[c >> 5] & (1 << (c & 0x1f))
gboolean g_at_hdlc_send(GAtHDLC *hdlc, const unsigned char *data, gsize size)
diff --git a/gatchat/gathdlc.h b/gatchat/gathdlc.h
index 2fa32705..2217558a 100644
--- a/gatchat/gathdlc.h
+++ b/gatchat/gathdlc.h
@@ -23,6 +23,7 @@
#define __G_AT_HDLC_H
#include "gat.h"
+#include "gatio.h"
#ifdef __cplusplus
extern "C" {
@@ -51,6 +52,8 @@ gboolean g_at_hdlc_send(GAtHDLC *hdlc, const unsigned char *data, gsize size);
void g_at_hdlc_set_recording(GAtHDLC *hdlc, const char *filename);
+GAtIO *g_at_hdlc_get_io(GAtHDLC *hdlc);
+
#ifdef __cplusplus
}
#endif
diff --git a/gatchat/gatio.h b/gatchat/gatio.h
index cb19164b..5a9f9f93 100644
--- a/gatchat/gatio.h
+++ b/gatchat/gatio.h
@@ -32,6 +32,8 @@ struct _GAtIO;
typedef struct _GAtIO GAtIO;
+struct ring_buffer;
+
typedef void (*GAtIOReadFunc)(struct ring_buffer *buffer, gpointer user_data);
typedef gboolean (*GAtIOWriteFunc)(gpointer user_data);