diff options
author | Zhenhua Zhang <zhenhua.zhang@intel.com> | 2010-01-18 22:31:18 +0800 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-02-01 17:59:27 -0600 |
commit | df7b1b30dc17827a1597f4753b8132df5607356f (patch) | |
tree | baf2f11bf90afc981877e15b70e31507bc954000 /gatchat/gatserver.h | |
parent | 105fccdcaf4c941a64f92ab7ca4508c15c34eba6 (diff) | |
download | ofono-df7b1b30dc17827a1597f4753b8132df5607356f.tar.bz2 |
Add GAtServer basic parsing support
It's the basic skeleton of GAtServer, including new/shutdown, ref/
unref, received_data/parse_buffer and set_discuss/set_debug.
GAtServer is to emulate the server side of AT conversation. It
complies with V.250 and 27.007 spec to accept AT command like
ATV1, ATE0 and extended command like AT+CLCC. Upper layer could
create customize server to expose TTY, tcp or unix socket to
client side application.
Diffstat (limited to 'gatchat/gatserver.h')
-rw-r--r-- | gatchat/gatserver.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/gatchat/gatserver.h b/gatchat/gatserver.h new file mode 100644 index 00000000..0785f274 --- /dev/null +++ b/gatchat/gatserver.h @@ -0,0 +1,65 @@ +/* + * + * AT Server library with GLib integration + * + * Copyright (C) 2008-2010 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __GATSERVER_H +#define __GATSERVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "gatutil.h" + +struct _GAtServer; + +typedef struct _GAtServer GAtServer; + +/* V.250 Table 1/V.250 Result codes */ +enum _GAtServerResultCodes { + G_AT_SERVER_RESULT_OK = 0, + G_AT_SERVER_RESULT_CONNECT, + G_AT_SERVER_RESULT_RING, + G_AT_SERVER_RESULT_NO_CARRIER, + G_AT_SERVER_RESULT_ERROR, + G_AT_SERVER_RESULT_NO_DIALTONE, + G_AT_SERVER_RESULT_BUSY, + G_AT_SERVER_RESULT_NO_ANSWER, + G_AT_SERVER_RESULT_CONNECT_EXT, +}; + +GAtServer *g_at_server_new(GIOChannel *io); + +GAtServer *g_at_server_ref(GAtServer *server); +void g_at_server_unref(GAtServer *server); +gboolean g_at_server_shutdown(GAtServer *server); + +gboolean g_at_server_set_disconnect_function(GAtServer *server, + GAtDisconnectFunc disconnect, + gpointer user_data); +gboolean g_at_server_set_debug(GAtServer *server, + GAtDebugFunc func, + gpointer user); + +#ifdef __cplusplus +} +#endif + +#endif /* __GATSERVER_H */ |