Open Source Telephony
 help / color / mirror / Atom feed
From: Ryan M. Raasch <ryan.raasch@gmail.com>
To: ofono@ofono.org
Subject: [PATCH] Inserted the GSM syntax option in modem.conf.
Date: Thu, 29 Oct 2009 12:04:23 +0100	[thread overview]
Message-ID: <1256814263-15298-1-git-send-email-ryan.raasch@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]

Hello,

Since the modems need to be setup in particular ways, this patch
allows for the GSM syntax to be specified by the configuration file.


Regards,
Ryan

---
 plugins/atgen.c     |    9 ++++++++-
 plugins/modemconf.c |    6 ++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/plugins/atgen.c b/plugins/atgen.c
index db59e36..67a1e8c 100644
--- a/plugins/atgen.c
+++ b/plugins/atgen.c
@@ -117,7 +117,14 @@ 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 && g_str_equal(value, "GSM_V1"))
+		syntax = g_at_syntax_new_gsmv1();
+	else if (value && g_str_equal(value, "GSM_Permissive"))
+		syntax = g_at_syntax_new_gsm_permissive();
+	else if (value)
+		return -EINVAL;
+
 	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 6b317e6..a5e5824 100644
--- a/plugins/modemconf.c
+++ b/plugins/modemconf.c
@@ -138,6 +138,12 @@ static int set_device(struct ofono_modem *modem,
 	} else
 		ofono_modem_set_string(modem, "Rtscts", "on");
 
+	value = g_key_file_get_string(keyfile, group, "GsmSyntax", NULL);
+	if (value) {
+		ofono_modem_set_string(modem, "GsmSyntax", value);
+		g_free(value);
+	} else
+		ofono_modem_set_string(modem, "GsmSyntax", "GSM_V1");
 
 	return 0;
 }
-- 
1.6.4.GIT


             reply	other threads:[~2009-10-29 11:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-29 11:04 Ryan M. Raasch [this message]
2009-10-29 12:37 ` [PATCH] Inserted the GSM syntax option in modem.conf Andres Salomon
2009-10-29 13:53 ` Marcel Holtmann
2009-10-29 14:11   ` Ryan Raasch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1256814263-15298-1-git-send-email-ryan.raasch@gmail.com \
    --to=ryan.raasch@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox