GPRS support for Ofono
by Ismo Puustinen
Hello List,
I started working on Ofono GPRS support.
The patch set contains:
1) Documentation describing how an Ofono GPRS D-Bus API would look like.
2) Common Ofono GPRS support.
3) Ofono GPRS ISI driver.
4) Test script for trying out the GPRS functionality.
Note that the GPRS support is in no way completed -- many things are
still TODO or have rough edges. However, I thought that it would be a
good idea to send the patches to the mailing list to gather comments
and improvement suggestions before finalizing the work.
PS. A disclaimer: I'm a Nokia engineer, even though I'm sending this
email from my personal email account (due to incompatibilities with
Nokia email servers). If you need to contact me off-the-list, please
use the email address ismo.h.puustinen(a)nokia.com .
--
Ismo Puustinen <ismo(a)iki.fi>
12 years, 6 months
[PATCH] Inserted the GSM syntax option in modem.conf. (Revised).
by Ryan M. Raasch
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(-)
diff --git a/plugins/atgen.c b/plugins/atgen.c
index 42b6c6b..8300da2 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 440b205..4b66590 100644
--- a/plugins/modemconf.c
+++ b/plugins/modemconf.c
@@ -44,6 +44,7 @@ static const char *tty_opts[] = {
"Parity",
"XonXoff",
"RtsCts",
+ "GsmSyntax",
NULL,
};
--
1.6.4.GIT
12 years, 8 months
Release of Phone Simulator
by Marcel Holtmann
Happy Halloween to everyone,
for the last 10 month we have been using a modified version of the
Trolltech Phone Simulator for testing and validation. Recently we got
multiple requests for making our changes public and so here we go:
http://www.kernel.org/pub/linux/network/ofono/
The GIT repository is public since a week or so, but today I went ahead
and tagged version 1.0 of the Phone Simulator. This way distributions
can have a stab at including it.
During the last two weeks I spent a lot of time to clean up the source
code and fix the complicated build system. It should be pretty lean and
simple now. So have fun with it.
Regards
Marcel
12 years, 8 months
[PATCH 1/1] Create network registration driver for hfpmodem
by Gustavo F. Padovan
This driver handles phone informations about registration status, signal
strength and roaming status listening +CIEV commands. It also gets the
Network Operator name with +COPS commands.
---
Makefile.am | 3 +-
drivers/hfpmodem/hfpmodem.c | 2 +
drivers/hfpmodem/hfpmodem.h | 3 +
drivers/hfpmodem/network-registration.c | 365 +++++++++++++++++++++++++++++++
plugins/hfp.c | 1 +
5 files changed, 373 insertions(+), 1 deletions(-)
create mode 100644 drivers/hfpmodem/network-registration.c
diff --git a/Makefile.am b/Makefile.am
index 8e56568..c3e06b4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -126,7 +126,8 @@ builtin_modules += hfpmodem
builtin_sources += drivers/atmodem/atutil.h \
drivers/hfpmodem/hfpmodem.h \
drivers/hfpmodem/hfpmodem.c \
- drivers/hfpmodem/voicecall.c
+ drivers/hfpmodem/voicecall.c \
+ drivers/hfpmodem/network-registration.c
builtin_modules += mbmmodem
builtin_sources += drivers/atmodem/atutil.h \
diff --git a/drivers/hfpmodem/hfpmodem.c b/drivers/hfpmodem/hfpmodem.c
index 03b5ea0..58ae03d 100644
--- a/drivers/hfpmodem/hfpmodem.c
+++ b/drivers/hfpmodem/hfpmodem.c
@@ -42,6 +42,7 @@
static int hfpmodem_init(void)
{
hfp_voicecall_init();
+ hfp_netreg_init();
return 0;
}
@@ -49,6 +50,7 @@ static int hfpmodem_init(void)
static void hfpmodem_exit(void)
{
hfp_voicecall_exit();
+ hfp_netreg_exit();
}
OFONO_PLUGIN_DEFINE(hfpmodem, "Hands-Free Profile Driver", VERSION,
diff --git a/drivers/hfpmodem/hfpmodem.h b/drivers/hfpmodem/hfpmodem.h
index c4e2a34..02f5a4b 100644
--- a/drivers/hfpmodem/hfpmodem.h
+++ b/drivers/hfpmodem/hfpmodem.h
@@ -61,6 +61,9 @@ struct hfp_data {
unsigned int cind_val[HFP_INDICATOR_LAST];
};
+extern void hfp_netreg_init();
+extern void hfp_netreg_exit();
+
extern void hfp_voicecall_init();
extern void hfp_voicecall_exit();
diff --git a/drivers/hfpmodem/network-registration.c b/drivers/hfpmodem/network-registration.c
new file mode 100644
index 0000000..6cfaf57
--- /dev/null
+++ b/drivers/hfpmodem/network-registration.c
@@ -0,0 +1,365 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
+ * Copyright (C) 2009 ProFUSION embedded systems. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <glib.h>
+
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/netreg.h>
+
+#include "gatchat.h"
+#include "gatresult.h"
+#include "common.h"
+
+#include "hfpmodem.h"
+
+#define HFP_MAX_OPERATOR_NAME_LENGTH 16
+
+static const char *cops_prefix[] = { "+COPS:", NULL };
+static const char *cind_prefix[] = { "+CIND:", NULL };
+
+struct netreg_data {
+ GAtChat *chat;
+ unsigned char cind_pos[HFP_INDICATOR_LAST];
+ int cind_val[HFP_INDICATOR_LAST];
+};
+
+static void cops_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ struct netreg_data *nd = ofono_netreg_get_data(cbd->user);
+ ofono_netreg_operator_cb_t cb = cbd->cb;
+ struct ofono_network_operator op;
+ GAtResultIter iter;
+ int format;
+ const char *name;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ cb(&error, NULL, cbd->data);
+ goto out;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+COPS:"))
+ return;
+
+ g_at_result_iter_skip_next(&iter);
+
+ ok = g_at_result_iter_next_number(&iter, &format);
+
+ if (ok == FALSE || format != 0)
+ return;
+
+ if (g_at_result_iter_next_string(&iter, &name) == FALSE)
+ return;
+
+ strncpy(op.name, name, HFP_MAX_OPERATOR_NAME_LENGTH);
+ op.name[HFP_MAX_OPERATOR_NAME_LENGTH] = '\0';
+
+ op.mcc[0] = '\0';
+ op.mnc[0] = '\0';
+
+ cb(&error, &op, cbd->data);
+
+out:
+ g_free(cbd);
+
+ return;
+
+error:
+ CALLBACK_WITH_FAILURE(cb, NULL, cbd->data);
+
+ g_free(cbd);
+}
+
+static void ciev_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_netreg *netreg = user_data;
+ struct netreg_data *nd = ofono_netreg_get_data(netreg);
+ GAtResultIter iter;
+ int index, value, status;
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+CIEV:"))
+ return;
+
+ if (!g_at_result_iter_next_number(&iter, &index))
+ return;
+
+ if (!g_at_result_iter_next_number(&iter, &value))
+ return;
+
+ if (index == nd->cind_pos[HFP_INDICATOR_SERVICE]) {
+ nd->cind_val[HFP_INDICATOR_SERVICE] = value;
+ if (value)
+ status = NETWORK_REGISTRATION_STATUS_REGISTERED;
+ else
+ status = NETWORK_REGISTRATION_STATUS_NOT_REGISTERED;
+
+ ofono_netreg_status_notify(netreg, status, -1, -1, -1);
+ } else if (index == nd->cind_pos[HFP_INDICATOR_ROAM]) {
+ nd->cind_val[HFP_INDICATOR_ROAM] = value;
+ if (value)
+ status = NETWORK_REGISTRATION_STATUS_ROAMING;
+
+ ofono_netreg_status_notify(netreg, status, -1, -1, -1);
+ } else if (index == nd->cind_pos[HFP_INDICATOR_SIGNAL]) {
+ nd->cind_val[HFP_INDICATOR_SIGNAL] = value;
+ ofono_netreg_strength_notify(netreg, value * 20);
+ }
+
+ return;
+}
+
+static void signal_strength_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_netreg_strength_cb_t cb = cbd->cb;
+ struct netreg_data *nd = ofono_netreg_get_data(cbd->user);
+ GAtResultIter iter;
+ int index, strength;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ cb(&error, -1, cbd->data);
+ return;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+CIND:")) {
+ CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
+ return;
+ }
+
+ index = 1;
+
+ while (g_at_result_iter_next_number(&iter, &strength)) {
+ if (index == nd->cind_pos[HFP_INDICATOR_SIGNAL]) {
+ nd->cind_val[HFP_INDICATOR_SIGNAL] = strength;
+ break;
+ }
+
+ index++;
+ }
+
+ ofono_debug("signal_strength_cb: %d", strength);
+
+ cb(&error, strength * 20, cbd->data);
+}
+
+static void registration_status_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_netreg_status_cb_t cb = cbd->cb;
+ struct netreg_data *nd = ofono_netreg_get_data(cbd->user);
+ GAtResultIter iter;
+ int index, value, status;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ cb(&error, -1, -1, -1, -1, cbd->data);
+ return;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+CIND:")) {
+ CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, cbd->data);
+ return;
+ }
+
+ index = 1;
+
+ while (g_at_result_iter_next_number(&iter, &value)) {
+
+ if (index == nd->cind_pos[HFP_INDICATOR_SERVICE])
+ nd->cind_val[HFP_INDICATOR_SERVICE] = value;
+
+ if (index == nd->cind_pos[HFP_INDICATOR_ROAM])
+ nd->cind_val[HFP_INDICATOR_ROAM] = value;
+
+ index++;
+ }
+
+ if (nd->cind_val[HFP_INDICATOR_SERVICE])
+ status = NETWORK_REGISTRATION_STATUS_REGISTERED;
+ else
+ status = NETWORK_REGISTRATION_STATUS_NOT_REGISTERED;
+
+ if (nd->cind_val[HFP_INDICATOR_ROAM])
+ status = NETWORK_REGISTRATION_STATUS_ROAMING;
+
+ cb(&error, status, -1, -1, -1, cbd->data);
+}
+
+static void hfp_registration_status(struct ofono_netreg *netreg,
+ ofono_netreg_status_cb_t cb,
+ void *data)
+{
+ struct netreg_data *nd = ofono_netreg_get_data(netreg);
+ struct cb_data *cbd = cb_data_new(cb, data);
+ gboolean ok;
+
+ if (!cbd)
+ goto error;
+
+ cbd->user = netreg;
+
+ ok = g_at_chat_send(nd->chat, "AT+CIND?", cind_prefix,
+ registration_status_cb, cbd, g_free);
+ if (ok)
+ return;
+
+error:
+ if (cbd)
+ g_free(cbd);
+
+ CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, data);
+}
+
+static void hfp_current_operator(struct ofono_netreg *netreg,
+ ofono_netreg_operator_cb_t cb, void *data)
+{
+ struct netreg_data *nd = ofono_netreg_get_data(netreg);
+ struct cb_data *cbd = cb_data_new(cb, data);
+ gboolean ok;
+
+ if (!cbd)
+ goto error;
+
+ cbd->user = netreg;
+
+ ok = g_at_chat_send(nd->chat, "AT+COPS=3,0", NULL,
+ NULL, cbd, NULL);
+
+ if (ok)
+ ok = g_at_chat_send(nd->chat, "AT+COPS?", cops_prefix,
+ cops_cb, cbd, NULL);
+
+ if (ok)
+ return;
+
+error:
+ if (cbd)
+ g_free(cbd);
+
+ CALLBACK_WITH_FAILURE(cb, NULL, data);
+}
+
+static void hfp_signal_strength(struct ofono_netreg *netreg,
+ ofono_netreg_strength_cb_t cb, void *data)
+{
+ struct netreg_data *nd = ofono_netreg_get_data(netreg);
+ struct cb_data *cbd = cb_data_new(cb, data);
+
+ if (!cbd)
+ goto error;
+
+ cbd->user = netreg;
+
+ if (g_at_chat_send(nd->chat, "AT+CIND?", cind_prefix,
+ signal_strength_cb, cbd, g_free) > 0)
+ return;
+
+error:
+ if (cbd)
+ g_free(cbd);
+
+ CALLBACK_WITH_FAILURE(cb, -1, data);
+}
+
+static gboolean hfp_netreg_register(gpointer user_data)
+{
+ struct ofono_netreg *netreg = user_data;
+
+ ofono_netreg_register(netreg);
+
+ return FALSE;
+}
+
+static int hfp_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
+ void *user_data)
+{
+ struct hfp_data *data = user_data;
+ struct netreg_data *nd;
+
+ nd = g_new0(struct netreg_data, 1);
+ nd->chat = data->chat;
+ memcpy(nd->cind_pos, data->cind_pos, HFP_INDICATOR_LAST);
+ memcpy(nd->cind_val, data->cind_val, HFP_INDICATOR_LAST);
+
+ ofono_netreg_set_data(netreg, nd);
+
+ g_at_chat_register(nd->chat, "+CIEV:", ciev_notify, FALSE,
+ netreg, NULL);
+
+ g_idle_add(hfp_netreg_register, netreg);
+
+ return 0;
+}
+
+static void hfp_netreg_remove(struct ofono_netreg *netreg)
+{
+ struct netreg_data *nd = ofono_netreg_get_data(netreg);
+
+ g_free(nd);
+}
+
+static struct ofono_netreg_driver driver = {
+ .name = "hfpmodem",
+ .probe = hfp_netreg_probe,
+ .remove = hfp_netreg_remove,
+ .registration_status = hfp_registration_status,
+ .current_operator = hfp_current_operator,
+ .strength = hfp_signal_strength,
+};
+
+void hfp_netreg_init()
+{
+ ofono_netreg_driver_register(&driver);
+}
+
+void hfp_netreg_exit()
+{
+ ofono_netreg_driver_unregister(&driver);
+}
diff --git a/plugins/hfp.c b/plugins/hfp.c
index 5e94a05..be812cd 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -311,6 +311,7 @@ static void hfp_pre_sim(struct ofono_modem *modem)
DBG("%p", modem);
ofono_voicecall_create(modem, 0, "hfpmodem", data);
+ ofono_netreg_create(modem, 0, "hfpmodem", data);
}
static void hfp_post_sim(struct ofono_modem *modem)
--
1.6.4.4
12 years, 8 months
Clarity on Modem Plug In API
by onkar upadhyay
Hi,
I was looking into the architectural diagrame of OFONO. I would like to know
as to how flexible are the API which exposed at the Modem Plug In API.
1)One of lower module shown in blue colour "other Modem Plug in". Is it
possible that the APIs which are exposed cater all the need of modem which
it expects from modem's upper layer (i.e) NAS layer ?
2) What is the minium requirement does the exposed interface expected from
the implementation perspective of Modem implementation?
Kindly clarifies the above doubt as it will help me to see the utilization
of OFONO for our modem implementation
Thanks
Onkar Nath
12 years, 8 months
[PATCH 2/2] Altered the atgeneric modem to include the added modem.conf options.
by Ryan Raasch
The modem.conf options for the driver portion of the patch.
Regards,
Ryan
---
plugins/atgen.c | 48 ++++++++++++++++++++++++++++++++++++++--
plugins/modemconf.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 103 insertions(+), 4 deletions(-)
diff --git a/plugins/atgen.c b/plugins/atgen.c
index c0fbbb2..db59e36 100644
--- a/plugins/atgen.c
+++ b/plugins/atgen.c
@@ -48,6 +48,24 @@
#include <ofono/ussd.h>
#include <ofono/voicecall.h>
+static const char *tty_opts[] =
+ {
+ "Baud",
+ "Read",
+ "Local",
+ "StopBits",
+ "DataBits",
+ "Parity",
+ "XonXoff",
+ "Rtscts",
+ NULL,
+ };
+
+static void unregister_tty_option(gpointer data)
+{
+ g_free(data);
+}
+
static int atgen_probe(struct ofono_modem *modem)
{
return 0;
@@ -68,6 +86,9 @@ static int atgen_enable(struct ofono_modem *modem)
GIOChannel *channel;
GAtSyntax *syntax;
const char *device;
+ const char *value;
+ GHashTable *options;
+ int i = 0;
DBG("%p", modem);
@@ -75,23 +96,44 @@ static int atgen_enable(struct ofono_modem *modem)
if (!device)
return -EINVAL;
- channel = g_at_tty_open(device, NULL);
- if (!channel)
+ options = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, unregister_tty_option);
+ if (!options)
+ return -ENOMEM;
+
+ while (tty_opts[i]) {
+
+ value = ofono_modem_get_string(modem, tty_opts[i]);
+ if (value) {
+ g_hash_table_replace(options, g_strdup(tty_opts[i]),
+ g_strdup(value));
+ }
+ i++;
+ };
+
+ channel = g_at_tty_open(device, options);
+ if (!channel) {
+ g_hash_table_destroy(options);
return -EIO;
+ }
syntax = g_at_syntax_new_gsmv1();
chat = g_at_chat_new(channel, syntax);
g_at_syntax_unref(syntax);
g_io_channel_unref(channel);
- if (!chat)
+ if (!chat) {
+ g_hash_table_destroy(options);
return -ENOMEM;
+ }
if (getenv("OFONO_AT_DEBUG"))
g_at_chat_set_debug(chat, atgen_debug, NULL);
ofono_modem_set_data(modem, chat);
+ g_hash_table_destroy(options);
+
return 0;
}
diff --git a/plugins/modemconf.c b/plugins/modemconf.c
index 192faa6..6b317e6 100644
--- a/plugins/modemconf.c
+++ b/plugins/modemconf.c
@@ -72,7 +72,7 @@ static int set_address(struct ofono_modem *modem,
static int set_device(struct ofono_modem *modem,
GKeyFile *keyfile, const char *group)
{
- char *device;
+ char *device, *value;
device = g_key_file_get_string(keyfile, group, "Device", NULL);
if (!device)
@@ -82,6 +82,63 @@ static int set_device(struct ofono_modem *modem,
g_free(device);
+ value = g_key_file_get_string(keyfile, group, "Baud", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "Baud", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "Baud", "115200");
+
+ value = g_key_file_get_string(keyfile, group, "Read", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "Read", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "Read", "on");
+
+ value = g_key_file_get_string(keyfile, group, "Local", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "Local", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "Local", "none");
+
+ value = g_key_file_get_string(keyfile, group, "StopBits", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "StopBits", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "StopBits", "1");
+
+ value = g_key_file_get_string(keyfile, group, "DataBits", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "DataBits", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "Databits", "8");
+
+ value = g_key_file_get_string(keyfile, group, "Parity", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "Parity", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "Parity", "none");
+
+ value = g_key_file_get_string(keyfile, group, "XonXoff", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "XonXoff", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "XonXoff", "off");
+
+ value = g_key_file_get_string(keyfile, group, "Rtscts", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "Rtscts", value);
+ g_free(value);
+ } else
+ ofono_modem_set_string(modem, "Rtscts", "on");
+
+
return 0;
}
--
1.6.4.GIT
12 years, 8 months
[PATCH 0/2] python test scripts
by Ryan M. Raasch
Hello,
Python script to enter a pin number to unlock the sim card.
Regards,
Ryan
test/enable-modem | 6 +++++-
test/enable-sim | 18 ++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletions(-)
create mode 100755 test/enable-sim
12 years, 8 months
[PATCH 1/2] Altered the options for the modem.conf to include more tty options.
by Ryan Raasch
The modem.conf patch split into gatchat changes.
Regards,
Ryan
---
gatchat/gattty.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gatchat/gattty.c b/gatchat/gattty.c
index f18eca4..64dd8ab 100644
--- a/gatchat/gattty.c
+++ b/gatchat/gattty.c
@@ -208,21 +208,21 @@ static int open_device(const char *tty,
GHashTable *options)
(void *) &value)) {
gboolean ok = FALSE;
- if (g_str_equal(key, "baud"))
+ if (g_str_equal(key, "Baud"))
ok = set_baud(value, &ti);
- else if (g_str_equal(key, "stopbits"))
+ else if (g_str_equal(key, "StopBits"))
ok = set_stop_bits(value, &ti);
- else if (g_str_equal(key, "databits"))
+ else if (g_str_equal(key, "DataBits"))
ok = set_data_bits(value, &ti);
- else if (g_str_equal(key, "parity"))
+ else if (g_str_equal(key, "Parity"))
ok = set_parity(value, &ti);
- else if (g_str_equal(key, "xonxoff"))
+ else if (g_str_equal(key, "XonXoff"))
ok = set_xonxoff(value, &ti);
- else if (g_str_equal(key, "rtscts"))
+ else if (g_str_equal(key, "Rtscts"))
ok = set_rtscts(value, &ti);
- else if (g_str_equal(key, "local"))
+ else if (g_str_equal(key, "Local"))
ok = set_local(value, &ti);
- else if (g_str_equal(key, "read"))
+ else if (g_str_equal(key, "Read"))
ok = set_read(value, &ti);
if (ok == FALSE)
--
1.6.4.GIT
12 years, 8 months
[PATCH] Inserted the GSM syntax option in modem.conf.
by Ryan M. Raasch
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
12 years, 8 months
SIM PIN unlock
by Ryan Raasch
Hello,
I have noticed a difference of ofono on startup. If the PIN number is
not required, the daemon never gets past CRSM query, and the remaining
interfaces are not added.
But if the PIN number has not been entered, things work as they should.
Scenario 1:
The SIM card needs the PIN number to work.
ofonod[8203]: attr_cb got result: 1
ofonod[8203]: Final response: OK
ofonod[8203]: Response line: SIEMENS
ofonod[8203]: at_cpin_cb got result: 1
ofonod[8203]: Final response: OK
ofonod[8203]: Response line: +CPIN: SIM PIN
ofonod[8203]: crsm_pin_cb: SIM PIN
ofonod[8203]: at_crsm_info_cb got result: 0
ofonod[8203]: Final response: ERROR
ofonod[8203]: attr_cb got result: 1
ofonod[8203]: Final response: OK
ofonod[8203]: Response line: MC75
ofonod[8203]: at_crsm_info_cb got result: 0
ofonod[8203]: Final response: ERROR
ofonod[8203]: attr_cb got result: 1
ofonod[8203]: Final response: OK
ofonod[8203]: Response line: REVISION 03.010
ofonod[8203]: at_crsm_info_cb got result: 0
ofonod[8203]: Final response: ERROR
ofonod[8203]: src/voicecall.c:ecc_read_cb() 0
ofonod[8203]: attr_cb got result: 1
ofonod[8203]: Final response: OK
ofonod[8203]: Response line: 35****
ofonod[8203]: at_lock_unlock_cb got result: 1
ofonod[8203]: Final response: OK
ofonod[8203]: at_cpin_cb got result: 1
ofonod[8203]: Final response: OK
ofonod[8203]: Response line: +CPIN: READY
ofonod[8203]: crsm_pin_cb: READY
Scenario 2:
The daemon has been restarted (following correct SIM PIN number insertion).
ofonod[16456]: attr_cb got result: 1
ofonod[16456]: Final response: OK
ofonod[16456]: Response line: SIEMENS
ofonod[16456]: at_cpin_cb got result: 1
ofonod[16456]: Final response: OK
ofonod[16456]: Response line: +CPIN: READY
ofonod[16456]: crsm_pin_cb: READY
Thanks,
Ryan
12 years, 8 months