Skip to contentSkip to conversation

Inserted the GSM syntax option in modem.conf. (Revised).

PATCH In review Ryan M. Raasch 2 participants 2 messages Oct 30, 2009 – Nov 1, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Inserted the GSM syntax option in modem.conf. (Revised).

Hello,

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.

Greetings,
Ryan

---
 plugins/atgen.c     |   12 +++++++++++-
 plugins/modemconf.c |    1 +
 2 files changed, 12 insertions(+), 1 deletions(-)
plugins/atgen.c +11 -1
index 42b6c6b..8300da2 100644
@@ -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);
plugins/modemconf.c +1 -0
index 440b205..4b66590 100644
@@ -44,6 +44,7 @@ static const char *tty_opts[] = {
 	"Parity",
 	"XonXoff",
 	"RtsCts",
+	"GsmSyntax",
 	NULL,
 };
 
Signature · 1 line
1.6.4.GIT
#1 lore raw

Hi Ryan,

Quoted 2 lines

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.

patch has been applied. Thanks.

Regards

Marcel