From 8850d3dc9ef5ee1cb6aaa5b6291e879d98dc56d2 Mon Sep 17 00:00:00 2001 From: Zhenhua Zhang Date: Fri, 19 Mar 2010 17:44:42 +0800 Subject: Add server at command data structure --- gatchat/gatserver.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gatchat/gatserver.h') diff --git a/gatchat/gatserver.h b/gatchat/gatserver.h index 698f7e0a..1c12a0df 100644 --- a/gatchat/gatserver.h +++ b/gatchat/gatserver.h @@ -26,6 +26,7 @@ extern "C" { #endif +#include "gatresult.h" #include "gatutil.h" struct _GAtServer; @@ -46,6 +47,27 @@ enum _GAtServerResult { typedef enum _GAtServerResult GAtServerResult; +/* Types of AT command: + * COMMAND_ONLY: command without any sub-parameters, e.g. ATA, AT+CLCC + * QUERY: command followed by '?', e.g. AT+CPIN? + * SUPPORT: command followed by '=?', e.g. AT+CSMS=? + * SET: command followed by '=', e.g. AT+CLIP=1 + * or, basic command followed with sub-parameters, e.g. ATD12345; + */ +enum _GAtServerRequestType { + G_AT_SERVER_REQUEST_TYPE_ERROR, + G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY, + G_AT_SERVER_REQUEST_TYPE_QUERY, + G_AT_SERVER_REQUEST_TYPE_SUPPORT, + G_AT_SERVER_REQUEST_TYPE_SET, +}; + +typedef enum _GAtServerRequestType GAtServerRequestType; + +typedef GAtServerResult (*GAtServerNotifyFunc)(GAtServerRequestType type, + GAtResult *result, + gpointer user_data); + GAtServer *g_at_server_new(GIOChannel *io); GAtServer *g_at_server_ref(GAtServer *server); -- cgit v1.2.3