Upgrade ofono to 1.2
[profile/ivi/ofono.git] / gatchat / gathdlc.h
1 /*
2  *
3  *  AT chat library with GLib integration
4  *
5  *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef __G_AT_HDLC_H
23 #define __G_AT_HDLC_H
24
25 #include "gat.h"
26 #include "gatio.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 struct _GAtHDLC;
33
34 typedef struct _GAtHDLC GAtHDLC;
35
36 GAtHDLC *g_at_hdlc_new(GIOChannel *channel);
37 GAtHDLC *g_at_hdlc_new_from_io(GAtIO *io);
38
39 GAtHDLC *g_at_hdlc_ref(GAtHDLC *hdlc);
40 void g_at_hdlc_unref(GAtHDLC *hdlc);
41
42 void g_at_hdlc_set_debug(GAtHDLC *hdlc, GAtDebugFunc func, gpointer user_data);
43
44 void g_at_hdlc_set_xmit_accm(GAtHDLC *hdlc, guint32 accm);
45 guint32 g_at_hdlc_get_xmit_accm(GAtHDLC *hdlc);
46
47 void g_at_hdlc_set_recv_accm(GAtHDLC *hdlc, guint32 accm);
48 guint32 g_at_hdlc_get_recv_accm(GAtHDLC *hdlc);
49
50 void g_at_hdlc_set_receive(GAtHDLC *hdlc, GAtReceiveFunc func,
51                                                         gpointer user_data);
52 gboolean g_at_hdlc_send(GAtHDLC *hdlc, const unsigned char *data, gsize size);
53
54 void g_at_hdlc_set_recording(GAtHDLC *hdlc, const char *filename);
55
56 GAtIO *g_at_hdlc_get_io(GAtHDLC *hdlc);
57
58 void g_at_hdlc_set_start_frame_marker(GAtHDLC *hdlc, gboolean marker);
59 void g_at_hdlc_set_no_carrier_detect(GAtHDLC *hdlc, gboolean detect);
60
61 void g_at_hdlc_set_suspend_function(GAtHDLC *hdlc, GAtSuspendFunc func,
62                                                         gpointer user_data);
63
64 void g_at_hdlc_suspend(GAtHDLC *hdlc);
65 void g_at_hdlc_resume(GAtHDLC *hdlc);
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif /* __G_AT_HDLC_H */