diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-10-02 12:29:02 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-10-02 12:29:02 +0200 |
commit | cfbc902287e71f1d3f2983824f22f69049c357a4 (patch) | |
tree | 7ff9e67e333b221a218bb26974702b8ce485b2f8 | |
parent | 7e11615ac352e63cdefc6004a54fadd638ac0be8 (diff) | |
download | ofono-cfbc902287e71f1d3f2983824f22f69049c357a4.tar.bz2 |
Add support for switching to a different GAtSyntax at runtime
-rw-r--r-- | gatchat/gatchat.c | 12 | ||||
-rw-r--r-- | gatchat/gatchat.h | 2 |
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); |