summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-10-02 12:29:02 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-10-02 12:29:47 +0200
commit1a8243983b41a3a4bed110ffeab80b5f2c091862 (patch)
treefd47507325c321011d0dd522177a15fafea04698
parent4a702cc413ab27b90d5efeb13925684e77a83547 (diff)
downloadconnman-1a8243983b41a3a4bed110ffeab80b5f2c091862.tar.gz
connman-1a8243983b41a3a4bed110ffeab80b5f2c091862.tar.bz2
connman-1a8243983b41a3a4bed110ffeab80b5f2c091862.zip
Add support for switching to a different GAtSyntax at runtime
-rw-r--r--gatchat/gatchat.c12
-rw-r--r--gatchat/gatchat.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index fa4f262e..c4de1471 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -1003,6 +1003,18 @@ gboolean g_at_chat_shutdown(GAtChat *chat)
return TRUE;
}
+gboolean g_at_chat_set_syntax(GAtChat *chat, GAtSyntax *syntax)
+{
+ if (chat == NULL)
+ return FALSE;
+
+ g_at_syntax_unref(chat->syntax);
+
+ chat->syntax = g_at_syntax_ref(syntax);
+
+ return TRUE;
+}
+
gboolean g_at_chat_set_disconnect_function(GAtChat *chat,
GAtDisconnectFunc disconnect, gpointer user_data)
{
diff --git a/gatchat/gatchat.h b/gatchat/gatchat.h
index b86fdb7a..6a4c2227 100644
--- a/gatchat/gatchat.h
+++ b/gatchat/gatchat.h
@@ -47,6 +47,8 @@ void g_at_chat_unref(GAtChat *chat);
gboolean g_at_chat_shutdown(GAtChat *chat);
+gboolean g_at_chat_set_syntax(GAtChat *chat, GAtSyntax *syntax);
+
gboolean g_at_chat_set_disconnect_function(GAtChat *chat,
GAtDisconnectFunc disconnect, gpointer user_data);