summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan M. Raasch <ryan.raasch@gmail.com>2009-10-30 14:18:00 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-11-01 23:29:03 +0900
commitf92888fae70be1c5ceab3db83a60a61737842d3b (patch)
tree3cf9263ae565027ddbf83d6e3553ef4dab72030d
parentcbe52b9a4410a72ebfeeed50f942139afabbdc92 (diff)
downloadofono-f92888fae70be1c5ceab3db83a60a61737842d3b.tar.bz2
Inserted the GSM syntax option in modem.conf
This is patch to allow the gsm syntax to be specified in the modem.conf file. It is a 2nd version based on code change requests.
-rw-r--r--plugins/atgen.c12
-rw-r--r--plugins/modemconf.c1
2 files changed, 12 insertions, 1 deletions
diff --git a/plugins/atgen.c b/plugins/atgen.c
index 42b6c6b7..8300da27 100644
--- a/plugins/atgen.c
+++ b/plugins/atgen.c
@@ -113,7 +113,17 @@ static int atgen_enable(struct ofono_modem *modem)
return -EIO;
}
- syntax = g_at_syntax_new_gsmv1();
+ value = ofono_modem_get_string(modem, "GsmSyntax");
+ if (value) {
+ if (g_str_equal(value, "V1"))
+ syntax = g_at_syntax_new_gsmv1();
+ else if (g_str_equal(value, "Permissive"))
+ syntax = g_at_syntax_new_gsm_permissive();
+ else
+ return -EINVAL;
+ } else
+ syntax = g_at_syntax_new_gsmv1();
+
chat = g_at_chat_new(channel, syntax);
g_at_syntax_unref(syntax);
g_io_channel_unref(channel);
diff --git a/plugins/modemconf.c b/plugins/modemconf.c
index 440b205e..4b66590c 100644
--- a/plugins/modemconf.c
+++ b/plugins/modemconf.c
@@ -44,6 +44,7 @@ static const char *tty_opts[] = {
"Parity",
"XonXoff",
"RtsCts",
+ "GsmSyntax",
NULL,
};