* [PATCH 0/3] Telit HE910
@ 2012-12-17 16:22 Mingli Wu
2012-12-17 16:22 ` [PATCH 1/3] Support Telit cdc acm device Mingli Wu
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Mingli Wu @ 2012-12-17 16:22 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]
Hi Christopher,
I've been working on the Telit HE910 modem too, as I see from
the mailing list that you have been.
Allow me to send a coule of patches that I have in progress and
that are needed for things to work. Could you take a look at
these and possibily incorporate them into ofono in a way that's
acceptable to upstream?
The first patch in the series is similar to what you sent to
the mailing list today but sets more options... I can't recall
if setting only baud rate was insufficient, right now, so I'll
just send the entire patch.
Thanks,
Mingli Wu
Mingli Wu (3):
Support Telit cdc acm device
Drop checking whether +CMER is supported.
Delay 10 seconds between CFUN=4 and CFUN=1
drivers/atmodem/network-registration.c | 2 -
include/modem.h | 3 +
plugins/telit.c | 101 +++++++++++++++++++++++++++++++-
plugins/udevng.c | 30 +++++++++-
src/modem.c | 11 ++++
5 files changed, 143 insertions(+), 4 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] Support Telit cdc acm device
2012-12-17 16:22 [PATCH 0/3] Telit HE910 Mingli Wu
@ 2012-12-17 16:22 ` Mingli Wu
2012-12-17 16:34 ` Denis Kenzior
2012-12-17 16:22 ` [PATCH 2/3] Drop checking whether +CMER is supported Mingli Wu
2012-12-17 16:22 ` [PATCH 3/3] Delay 10 seconds between CFUN=4 and CFUN=1 Mingli Wu
2 siblings, 1 reply; 9+ messages in thread
From: Mingli Wu @ 2012-12-17 16:22 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5490 bytes --]
This patch is for Telit HE910 modem. Configure modem and aux ports
of ACM devices. some code of this patch was found on the Internet.
---
include/modem.h | 3 +++
plugins/telit.c | 24 +++++++++++++++++++++++-
plugins/udevng.c | 30 +++++++++++++++++++++++++++++-
src/modem.c | 11 +++++++++++
4 files changed, 66 insertions(+), 2 deletions(-)
diff --git a/include/modem.h b/include/modem.h
index 6e08275..303bc24 100644
--- a/include/modem.h
+++ b/include/modem.h
@@ -112,6 +112,9 @@ int ofono_modem_set_boolean(struct ofono_modem *modem,
ofono_bool_t ofono_modem_get_boolean(struct ofono_modem *modem,
const char *key);
+void ofono_modem_set_modem_info(struct ofono_modem *omodem, void *modem_info);
+void *ofono_modem_get_modem_info(struct ofono_modem *omodem);
+
int ofono_modem_driver_register(const struct ofono_modem_driver *);
void ofono_modem_driver_unregister(const struct ofono_modem_driver *);
diff --git a/plugins/telit.c b/plugins/telit.c
index a0f7deb..aaf2a9d 100644
--- a/plugins/telit.c
+++ b/plugins/telit.c
@@ -180,6 +180,7 @@ static gboolean hw_event_cb(GIOChannel *hw_io, GIOCondition condition,
return FALSE;
}
+extern gboolean udevng_match_modem_id(struct ofono_modem *modem, char *vendorid, char *productid);
static GAtChat *open_device(struct ofono_modem *modem,
const char *key, char *debug)
{
@@ -187,6 +188,7 @@ static GAtChat *open_device(struct ofono_modem *modem,
GAtSyntax *syntax;
GIOChannel *channel;
GAtChat *chat;
+ GHashTable *options = NULL;
device = ofono_modem_get_string(modem, key);
if (device == NULL)
@@ -194,7 +196,27 @@ static GAtChat *open_device(struct ofono_modem *modem,
DBG("%s %s", key, device);
- channel = g_at_tty_open(device, NULL);
+ /* This is for Telit HE910. */
+ if(udevng_match_modem_id(modem, "1bc7", "0021")){
+ options = g_hash_table_new(g_str_hash, g_str_equal);
+
+ if (options == NULL)
+ return NULL;
+
+ g_hash_table_insert(options, "Baud", "115200");
+ g_hash_table_insert(options, "Parity", "none");
+ g_hash_table_insert(options, "StopBits", "1");
+ g_hash_table_insert(options, "DataBits", "8");
+ g_hash_table_insert(options, "XonXoff", "off");
+ g_hash_table_insert(options, "Local", "on");
+ g_hash_table_insert(options, "RtsCts", "on");
+ }
+
+ channel = g_at_tty_open(device, options);
+ if(options){
+ g_hash_table_destroy(options);
+ }
+
if (channel == NULL)
return NULL;
diff --git a/plugins/udevng.c b/plugins/udevng.c
index afb02ca..b7cdef6 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -57,6 +57,20 @@ struct device_info {
char *sysattr;
};
+
+gboolean udevng_match_modem_id(struct ofono_modem *modem, char *vendorid, char *productid)
+{
+ struct modem_info *modem_info = ofono_modem_get_modem_info(modem);
+
+ if(!modem_info){
+ return FALSE;
+ }
+ if (g_strcmp0(modem_info->vendor, vendorid) || g_strcmp0(modem_info->model, productid)){
+ return FALSE;
+ }
+ return TRUE;
+}
+
static gboolean setup_isi(struct modem_info *modem)
{
const char *node = NULL;
@@ -620,6 +634,17 @@ static gboolean setup_telit(struct modem_info *modem)
else if (g_strcmp0(info->number, "03") == 0)
aux = info->devnode;
}
+ /* This for Telit HE910 */
+ else if (!g_strcmp0(modem->vendor, "1bc7") && !g_strcmp0(modem->model, "0021")){
+ if (g_strcmp0(info->interface, "2/2/1") == 0) {
+ if (g_strcmp0(info->number, "00") == 0)
+ mdm = info->devnode;
+ else if (g_strcmp0(info->number, "02") == 0)
+ diag = info->devnode;
+ else if (g_strcmp0(info->number, "06") == 0)
+ aux = info->devnode;
+ }
+ }
}
if (aux == NULL || mdm == NULL)
@@ -629,7 +654,8 @@ static gboolean setup_telit(struct modem_info *modem)
ofono_modem_set_string(modem->modem, "Modem", mdm);
ofono_modem_set_string(modem->modem, "Aux", aux);
- ofono_modem_set_string(modem->modem, "GPS", gps);
+ //ofono_modem_set_string(modem->modem, "GPS", gps);
+ ofono_modem_set_string(modem->modem, "Diag", diag);
return TRUE;
}
@@ -988,6 +1014,7 @@ static struct {
{ "simcom", "option", "05c6", "9000" },
{ "telit", "usbserial", "1bc7" },
{ "telit", "option", "1bc7" },
+ { "telit", "cdc_acm", "1bc7", "0021" },
{ "nokia", "option", "0421", "060e" },
{ "nokia", "option", "0421", "0623" },
{ "samsung", "option", "04e8", "6889" },
@@ -1113,6 +1140,7 @@ static gboolean create_modem(gpointer key, gpointer value, gpointer user_data)
if (modem->modem == NULL)
return TRUE;
+ ofono_modem_set_modem_info(modem->modem, modem);
for (i = 0; driver_list[i].name; i++) {
if (g_str_equal(driver_list[i].name, modem->driver) == FALSE)
continue;
diff --git a/src/modem.c b/src/modem.c
index 3c7c80a..207dce8 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -87,6 +87,7 @@ struct ofono_modem {
void *driver_data;
char *driver_type;
char *name;
+ void *modem_info;
};
struct ofono_devinfo {
@@ -119,6 +120,16 @@ struct modem_property {
void *value;
};
+void ofono_modem_set_modem_info(struct ofono_modem *omodem, void *modem_info)
+{
+ omodem->modem_info = modem_info;
+}
+
+void *ofono_modem_get_modem_info(struct ofono_modem *omodem)
+{
+ return omodem->modem_info;
+}
+
static const char *modem_type_to_string(enum ofono_modem_type type)
{
switch (type) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] Drop checking whether +CMER is supported.
2012-12-17 16:22 [PATCH 0/3] Telit HE910 Mingli Wu
2012-12-17 16:22 ` [PATCH 1/3] Support Telit cdc acm device Mingli Wu
@ 2012-12-17 16:22 ` Mingli Wu
2012-12-17 16:27 ` Denis Kenzior
2012-12-18 10:08 ` Christopher Vogl
2012-12-17 16:22 ` [PATCH 3/3] Delay 10 seconds between CFUN=4 and CFUN=1 Mingli Wu
2 siblings, 2 replies; 9+ messages in thread
From: Mingli Wu @ 2012-12-17 16:22 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
For Telit HE910, ofono always got "\r\n+CME ERROR: 14\r\n"
after issuing "AT+CMER=3,0,0,2\r" command. "CME ERROR: 14"
means that SIM is busy. Now we igonre the result of the
command "AT+CMER=3,0,0,2\r", and register network anyway.
---
drivers/atmodem/network-registration.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c
index 19b19b2..518a548 100644
--- a/drivers/atmodem/network-registration.c
+++ b/drivers/atmodem/network-registration.c
@@ -1480,7 +1480,6 @@ static void at_cmer_not_supported(struct ofono_netreg *netreg)
ofono_error("+CMER not supported by this modem. If this is an error"
" please submit patches to support this hardware");
- ofono_netreg_remove(netreg);
}
static void at_cmer_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -1490,7 +1489,6 @@ static void at_cmer_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
if (!ok) {
at_cmer_not_supported(netreg);
- return;
}
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] Delay 10 seconds between CFUN=4 and CFUN=1
2012-12-17 16:22 [PATCH 0/3] Telit HE910 Mingli Wu
2012-12-17 16:22 ` [PATCH 1/3] Support Telit cdc acm device Mingli Wu
2012-12-17 16:22 ` [PATCH 2/3] Drop checking whether +CMER is supported Mingli Wu
@ 2012-12-17 16:22 ` Mingli Wu
2 siblings, 0 replies; 9+ messages in thread
From: Mingli Wu @ 2012-12-17 16:22 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4435 bytes --]
According Telit software user guide:
Note: the protocol implementation of the module requires a
delay between consecutive activation of CFUN=1 and CFUN=4
(or vice versa) modes. It is suggested to use a delay of
10 sec.
---
plugins/telit.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
diff --git a/plugins/telit.c b/plugins/telit.c
index aaf2a9d..8938425 100644
--- a/plugins/telit.c
+++ b/plugins/telit.c
@@ -31,6 +31,7 @@
#include <termios.h>
#include <string.h>
#include <sys/socket.h>
+#include <time.h>
#include <glib.h>
#include <gatchat.h>
@@ -75,6 +76,10 @@ struct telit_data {
GIOChannel *hw_io;
guint bt_watch;
guint hw_watch;
+ int cfun_cmd;
+ time_t cfun_time;
+ struct cb_data *cbd;
+ ofono_bool_t online;
};
static void telit_debug(const char *str, void *user_data)
@@ -408,6 +413,10 @@ static int telit_enable(struct ofono_modem *modem)
g_at_chat_send(data->chat, "AT+CFUN=1", none_prefix,
cfun_enable_cb, modem, NULL);
+ data->cfun_time = time(NULL);
+ data->cfun_cmd = 1;
+ data->online = FALSE;
+
return -EINPROGRESS;
}
@@ -614,6 +623,20 @@ static void telit_pre_sim(struct ofono_modem *modem)
ofono_voicecall_create(modem, 0, "atmodem", data->chat);
}
+static gboolean post_sim_offline_timeout_cb(gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ if (!ofono_modem_get_online(modem)){
+ g_at_chat_send(data->chat, "AT+CFUN=4", none_prefix,
+ NULL, NULL, NULL);
+ data->cfun_time = time(NULL);
+ data->cfun_cmd = 4;
+ data->online = FALSE;
+ }
+}
+
static void telit_post_sim(struct ofono_modem *modem)
{
struct telit_data *data = ofono_modem_get_data(modem);
@@ -632,9 +655,13 @@ static void telit_post_sim(struct ofono_modem *modem)
if (gprs && gc)
ofono_gprs_add_context(gprs, gc);
+ /* Wait for 10 secs, and then check whether it should be online */
+ g_timeout_add_seconds(10, post_sim_offline_timeout_cb, modem);
+#if 0
if (!ofono_modem_get_online(modem))
g_at_chat_send(data->chat, "AT+CFUN=4", none_prefix,
NULL, NULL, NULL);
+#endif
}
static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -647,17 +674,67 @@ static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
cb(&error, cbd->data);
}
+static gboolean set_online_timeout_cb(gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct telit_data *data = ofono_modem_get_data(modem);
+ int cfun_cmd = data->online ? 1 : 4;
+
+ char const *command = data->online ? "AT+CFUN=1,0" : "AT+CFUN=4,0";
+
+ /* Before timeout, online status might already be changed */
+ if(data->cfun_cmd == cfun_cmd){
+ return;
+ }
+
+ g_at_chat_send(data->chat, command, none_prefix, set_online_cb,
+ data->cbd, g_free);
+
+ data->cfun_time = time(NULL);
+ data->cfun_cmd = cfun_cmd;
+
+ if (data->online) {
+ /*
+ * Query current sim state in case it changed while we
+ * were offline and ignoring the QSS: 0 reports.
+ */
+ g_at_chat_send(data->chat, "AT#QSS?", qss_prefix,
+ telit_qss_cb, modem, NULL);
+ }
+}
+
static void telit_set_online(struct ofono_modem *modem, ofono_bool_t online,
ofono_modem_online_cb_t cb, void *user_data)
{
struct telit_data *data = ofono_modem_get_data(modem);
struct cb_data *cbd = cb_data_new(cb, user_data);
char const *command = online ? "AT+CFUN=1,0" : "AT+CFUN=4,0";
+ int cfun_cmd = online ? 1 : 4;
DBG("modem %p %s", modem, online ? "online" : "offline");
+
+ data->online = online;
+ if(data->cfun_cmd != cfun_cmd){
+ time_t val = abs(time(NULL) - data->cfun_time);
+
+ /*
+ * According Telit software user guide:
+ * the protocol implementation of the module
+ * requires a delay between consecutive activation
+ * of CFUN=1 and CFUN=4 (or vice versa) modes.
+ * It is suggested to use a delay of 10 sec.
+ */
+ if(val < 10){
+ data->cbd = cbd;
+ g_timeout_add_seconds(10 - val, set_online_timeout_cb, modem);
+ return;
+ }
+ }
g_at_chat_send(data->chat, command, none_prefix, set_online_cb,
cbd, g_free);
+ data->cfun_time = time(NULL);
+ data->cfun_cmd = cfun_cmd;
if (online) {
/* Query current sim state in case it changed while we
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] Drop checking whether +CMER is supported.
2012-12-17 16:22 ` [PATCH 2/3] Drop checking whether +CMER is supported Mingli Wu
@ 2012-12-17 16:27 ` Denis Kenzior
2012-12-18 10:08 ` Christopher Vogl
1 sibling, 0 replies; 9+ messages in thread
From: Denis Kenzior @ 2012-12-17 16:27 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1302 bytes --]
Hi Mingli,
On 12/17/2012 10:22 AM, Mingli Wu wrote:
> For Telit HE910, ofono always got "\r\n+CME ERROR: 14\r\n"
> after issuing "AT+CMER=3,0,0,2\r" command. "CME ERROR: 14"
> means that SIM is busy. Now we igonre the result of the
> command "AT+CMER=3,0,0,2\r", and register network anyway.
> ---
> drivers/atmodem/network-registration.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/atmodem/network-registration.c b/drivers/atmodem/network-registration.c
> index 19b19b2..518a548 100644
> --- a/drivers/atmodem/network-registration.c
> +++ b/drivers/atmodem/network-registration.c
> @@ -1480,7 +1480,6 @@ static void at_cmer_not_supported(struct ofono_netreg *netreg)
> ofono_error("+CMER not supported by this modem. If this is an error"
> " please submit patches to support this hardware");
>
> - ofono_netreg_remove(netreg);
You are changing the global behavior of the driver here. This affects
other modems than HE910...
> }
>
> static void at_cmer_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
> @@ -1490,7 +1489,6 @@ static void at_cmer_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
>
> if (!ok) {
> at_cmer_not_supported(netreg);
> - return;
> }
>
> /*
Regards,
-Denis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] Support Telit cdc acm device
2012-12-17 16:22 ` [PATCH 1/3] Support Telit cdc acm device Mingli Wu
@ 2012-12-17 16:34 ` Denis Kenzior
2012-12-17 18:39 ` Ming Li Wu
0 siblings, 1 reply; 9+ messages in thread
From: Denis Kenzior @ 2012-12-17 16:34 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 6375 bytes --]
Hi Mingli,
On 12/17/2012 10:22 AM, Mingli Wu wrote:
> This patch is for Telit HE910 modem. Configure modem and aux ports
> of ACM devices. some code of this patch was found on the Internet.
> ---
> include/modem.h | 3 +++
> plugins/telit.c | 24 +++++++++++++++++++++++-
> plugins/udevng.c | 30 +++++++++++++++++++++++++++++-
> src/modem.c | 11 +++++++++++
> 4 files changed, 66 insertions(+), 2 deletions(-)
You need to break up these patches, see our patch submission guidelines
in HACKING document, 'Submitting Patches' section. Also please review
the coding style guidelines in doc/coding-style.txt.
>
> diff --git a/include/modem.h b/include/modem.h
> index 6e08275..303bc24 100644
> --- a/include/modem.h
> +++ b/include/modem.h
> @@ -112,6 +112,9 @@ int ofono_modem_set_boolean(struct ofono_modem *modem,
> ofono_bool_t ofono_modem_get_boolean(struct ofono_modem *modem,
> const char *key);
>
> +void ofono_modem_set_modem_info(struct ofono_modem *omodem, void *modem_info);
> +void *ofono_modem_get_modem_info(struct ofono_modem *omodem);
> +
This is not required, ofono_modem_set_string, set_integer, set_boolean
are already enough.
> int ofono_modem_driver_register(const struct ofono_modem_driver *);
> void ofono_modem_driver_unregister(const struct ofono_modem_driver *);
>
> diff --git a/plugins/telit.c b/plugins/telit.c
> index a0f7deb..aaf2a9d 100644
> --- a/plugins/telit.c
> +++ b/plugins/telit.c
> @@ -180,6 +180,7 @@ static gboolean hw_event_cb(GIOChannel *hw_io, GIOCondition condition,
> return FALSE;
> }
>
> +extern gboolean udevng_match_modem_id(struct ofono_modem *modem, char *vendorid, char *productid);
> static GAtChat *open_device(struct ofono_modem *modem,
> const char *key, char *debug)
> {
> @@ -187,6 +188,7 @@ static GAtChat *open_device(struct ofono_modem *modem,
> GAtSyntax *syntax;
> GIOChannel *channel;
> GAtChat *chat;
> + GHashTable *options = NULL;
>
> device = ofono_modem_get_string(modem, key);
> if (device == NULL)
> @@ -194,7 +196,27 @@ static GAtChat *open_device(struct ofono_modem *modem,
>
> DBG("%s %s", key, device);
>
> - channel = g_at_tty_open(device, NULL);
> + /* This is for Telit HE910. */
> + if(udevng_match_modem_id(modem, "1bc7", "0021")){
> + options = g_hash_table_new(g_str_hash, g_str_equal);
> +
> + if (options == NULL)
> + return NULL;
> +
> + g_hash_table_insert(options, "Baud", "115200");
> + g_hash_table_insert(options, "Parity", "none");
> + g_hash_table_insert(options, "StopBits", "1");
> + g_hash_table_insert(options, "DataBits", "8");
> + g_hash_table_insert(options, "XonXoff", "off");
> + g_hash_table_insert(options, "Local", "on");
> + g_hash_table_insert(options, "RtsCts", "on");
> + }
> +
> + channel = g_at_tty_open(device, options);
> + if(options){
> + g_hash_table_destroy(options);
> + }
> +
This was already taken care of by the patch from Christopher that was
applied today.
> if (channel == NULL)
> return NULL;
>
> diff --git a/plugins/udevng.c b/plugins/udevng.c
> index afb02ca..b7cdef6 100644
> --- a/plugins/udevng.c
> +++ b/plugins/udevng.c
> @@ -57,6 +57,20 @@ struct device_info {
> char *sysattr;
> };
>
> +
> +gboolean udevng_match_modem_id(struct ofono_modem *modem, char *vendorid, char *productid)
> +{
> + struct modem_info *modem_info = ofono_modem_get_modem_info(modem);
> +
> + if(!modem_info){
> + return FALSE;
> + }
> + if (g_strcmp0(modem_info->vendor, vendorid) || g_strcmp0(modem_info->model, productid)){
> + return FALSE;
> + }
> + return TRUE;
> +}
> +
> static gboolean setup_isi(struct modem_info *modem)
> {
> const char *node = NULL;
> @@ -620,6 +634,17 @@ static gboolean setup_telit(struct modem_info *modem)
> else if (g_strcmp0(info->number, "03") == 0)
> aux = info->devnode;
> }
> + /* This for Telit HE910 */
> + else if (!g_strcmp0(modem->vendor, "1bc7")&& !g_strcmp0(modem->model, "0021")){
> + if (g_strcmp0(info->interface, "2/2/1") == 0) {
> + if (g_strcmp0(info->number, "00") == 0)
> + mdm = info->devnode;
> + else if (g_strcmp0(info->number, "02") == 0)
> + diag = info->devnode;
> + else if (g_strcmp0(info->number, "06") == 0)
> + aux = info->devnode;
> + }
> + }
> }
>
> if (aux == NULL || mdm == NULL)
> @@ -629,7 +654,8 @@ static gboolean setup_telit(struct modem_info *modem)
>
> ofono_modem_set_string(modem->modem, "Modem", mdm);
> ofono_modem_set_string(modem->modem, "Aux", aux);
> - ofono_modem_set_string(modem->modem, "GPS", gps);
> + //ofono_modem_set_string(modem->modem, "GPS", gps);
> + ofono_modem_set_string(modem->modem, "Diag", diag);
Please do not leave dead code in your patch submissions.
>
> return TRUE;
> }
> @@ -988,6 +1014,7 @@ static struct {
> { "simcom", "option", "05c6", "9000" },
> { "telit", "usbserial", "1bc7" },
> { "telit", "option", "1bc7" },
> + { "telit", "cdc_acm", "1bc7", "0021" },
> { "nokia", "option", "0421", "060e" },
> { "nokia", "option", "0421", "0623" },
> { "samsung", "option", "04e8", "6889" },
> @@ -1113,6 +1140,7 @@ static gboolean create_modem(gpointer key, gpointer value, gpointer user_data)
> if (modem->modem == NULL)
> return TRUE;
>
> + ofono_modem_set_modem_info(modem->modem, modem);
> for (i = 0; driver_list[i].name; i++) {
> if (g_str_equal(driver_list[i].name, modem->driver) == FALSE)
> continue;
> diff --git a/src/modem.c b/src/modem.c
> index 3c7c80a..207dce8 100644
> --- a/src/modem.c
> +++ b/src/modem.c
> @@ -87,6 +87,7 @@ struct ofono_modem {
> void *driver_data;
> char *driver_type;
> char *name;
> + void *modem_info;
> };
>
> struct ofono_devinfo {
> @@ -119,6 +120,16 @@ struct modem_property {
> void *value;
> };
>
> +void ofono_modem_set_modem_info(struct ofono_modem *omodem, void *modem_info)
> +{
> + omodem->modem_info = modem_info;
> +}
> +
> +void *ofono_modem_get_modem_info(struct ofono_modem *omodem)
> +{
> + return omodem->modem_info;
> +}
> +
> static const char *modem_type_to_string(enum ofono_modem_type type)
> {
> switch (type) {
Regards,
-Denis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] Support Telit cdc acm device
2012-12-17 16:34 ` Denis Kenzior
@ 2012-12-17 18:39 ` Ming Li Wu
0 siblings, 0 replies; 9+ messages in thread
From: Ming Li Wu @ 2012-12-17 18:39 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]
Hi Denis,
>> + /* This is for Telit HE910. */
>> + if(udevng_match_modem_id(modem, "1bc7", "0021")){
>> + options = g_hash_table_new(g_str_hash, g_str_equal);
>> +
>> + if (options == NULL)
>> + return NULL;
>> +
>> + g_hash_table_insert(options, "Baud", "115200");
>> + g_hash_table_insert(options, "Parity", "none");
>> + g_hash_table_insert(options, "StopBits", "1");
>> + g_hash_table_insert(options, "DataBits", "8");
>> + g_hash_table_insert(options, "XonXoff", "off");
>> + g_hash_table_insert(options, "Local", "on");
>> + g_hash_table_insert(options, "RtsCts", "on");
>> + }
>> +
>> + channel = g_at_tty_open(device, options);
>> + if(options){
>> + g_hash_table_destroy(options);
>> + }
>> +
>
> This was already taken care of by the patch from Christopher that was
> applied today.
>
I have two questions about settings of serial ports:
1. Are the following settings necessary?
g_hash_table_insert(options, "XonXoff", "off");
g_hash_table_insert(options, "Local", "on");
g_hash_table_insert(options, "RtsCts", "on");
2.Should settings of modem port and aux port be different?
Thanks!
Mingli
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] Drop checking whether +CMER is supported.
2012-12-17 16:22 ` [PATCH 2/3] Drop checking whether +CMER is supported Mingli Wu
2012-12-17 16:27 ` Denis Kenzior
@ 2012-12-18 10:08 ` Christopher Vogl
1 sibling, 0 replies; 9+ messages in thread
From: Christopher Vogl @ 2012-12-18 10:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 657 bytes --]
On 17/12/12 17:22, Mingli Wu wrote:
> For Telit HE910, ofono always got "\r\n+CME ERROR: 14\r\n"
> after issuing "AT+CMER=3,0,0,2\r" command. "CME ERROR: 14"
> means that SIM is busy. Now we igonre the result of the
> command "AT+CMER=3,0,0,2\r", and register network anyway.
> ---
I submitted some patches which will solve this problem.
You should not get CME ERROR: 14 anymore and hence
the netreg atom will not be removed.
There is not need to make changes in the network registration atom.
Telit supports +CMER but without waiting for the modem to be ready
the command will fail.
Regards,
Christopher
--
Scanned by MailScanner.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] Drop checking whether +CMER is supported.
@ 2013-03-29 15:40 Etienne Mabille
0 siblings, 0 replies; 9+ messages in thread
From: Etienne Mabille @ 2013-03-29 15:40 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 6736 bytes --]
Hi Christopher,
I am trying to setup the Telit HE910 with oFono-1.3, I adapted
a few files using the 1.12 version :
drivers/atmodem/sim.c
plugins/telit.c
plugins/udevng.c
I still have this CMER problem though, and I was wondering what patch
you are refering to in the previous message, so that I can apply it to
my version of oFono.
Thank you in advance,
Etienne
Here is the end of the log from oFono just in case :
ofonod[1680]: plugins/telit.c:telit_post_online() 0x88e8290
ofonod[1680]: Aux: > AT+CGREG=?\r
ofonod[1680]: Aux: < \r\n
ofonod[1680]: Aux: < +CGREG: (0-2)\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CRSM=192,28489\r
ofonod[1680]: Aux: < \r\n+CRSM: 148,4\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CREG=?\r
ofonod[1680]: Aux: < \r\n
ofonod[1680]: Aux: < +CREG: (0-2)\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CSCS?\r
ofonod[1680]: Aux: < \r\n+CSCS: "IRA"\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CUSD=1\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: Aux: > AT+CAOC=2\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: Aux: > AT+CCWE=1\r
ofonod[1680]: Aux: < \r\n+CME ERROR: 3\r\n
ofonod[1680]: Aux: > AT+CGREG=2\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: Aux: > AT+CGAUTO=0\r
ofonod[1680]: Aux: < \r\nERROR\r\n
ofonod[1680]: Aux: > AT+CGEREP=2,1\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: Aux: > AT+CRSM=192,20256\r
ofonod[1680]: Aux: < \r\n+CME ERROR: 4\r\n
ofonod[1680]: Aux: > AT+CREG=2\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: Aux: > AT+CPSB=1\r
ofonod[1680]: Aux: < \r\nERROR\r\n
ofonod[1680]: Aux: > AT+CRSM=192,28618\r
ofonod[1680]: Aux: < \r\n+CRSM: 148,4\r\n\r\nOK\r\n
ofonod[1680]: Unable to read waiting messages numbers from SIM
ofonod[1680]: Aux: > AT+CIND=?\r
ofonod[1680]: Aux: < \r\n+CIND:
(("battchg",(0-5,99)),("signal",(0-7,99)),("service",(0,1)),("sounder",(0,1)),("message",(0,1)),("call",(0,1)),("roam",(0,1)),("smsfull",(0,1)),("rssi",(0-5,99)))\r\n\r\nOK\r\n
ofonod[1680]: src/sim.c:ofono_sim_add_spn_watch() 0x88e7308
ofonod[1680]: src/network.c:__ofono_netreg_add_status_watch() 0x88eb670
ofonod[1680]: Aux: > AT+CRSM=192,28617\r
ofonod[1680]: Aux: < \r\n+CRSM: 148,4\r\n\r\nOK\r\n
ofonod[1680]: Unable to read mailbox identifies from SIM
ofonod[1680]: Aux: > AT+CMER=3,0,0,1\r
ofonod[1680]: Aux: < \r\n+CME ERROR: 14\r\n
ofonod[1680]: Aux: > AT+CREG?\r
ofonod[1680]: Aux: < \r\n+CREG: 2,2\r\n\r\nOK\r\n
ofonod[1680]: src/network.c:current_operator_callback() 0x88eb670, (nil)
ofonod[1680]: src/gprs.c:netreg_status_changed() 2
ofonod[1680]: Aux: > AT+CRSM=192,28433\r
ofonod[1680]: Aux: < \r\n+CRSM:
144,0,000000016F11040011005501010000\r\n\r\nOK\r\n
ofonod[1680]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 15
ofonod[1680]: Aux: > AT+CRSM=176,28433,0,0,1\r
ofonod[1680]: Aux: < \r\n+CRSM: 144,0,5A\r\n\r\nOK\r\n
ofonod[1680]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 1
ofonod[1680]: src/simfs.c:sim_fs_op_read_block_cb() bufoff: 0,
dataoff: 0, tocopy: 1
ofonod[1680]: Aux: > AT+CRSM=192,28435\r
ofonod[1680]: Aux: < \r\n+CRSM:
144,0,000000016F13040011005501010000\r\n\r\nOK\r\n
ofonod[1680]: drivers/atmodem/sim.c:at_crsm_info_cb() crsm_info_cb: 90, 00, 15
ofonod[1680]: Aux: > AT+CRSM=176,28435,0,0,1\r
ofonod[1680]: Aux: < \r\n+CRSM: 144,0,55\r\n\r\nOK\r\n
ofonod[1680]: drivers/atmodem/sim.c:at_crsm_read_cb() crsm_read_cb: 90, 00, 1
ofonod[1680]: src/simfs.c:sim_fs_op_read_block_cb() bufoff: 0,
dataoff: 0, tocopy: 1
ofonod[1680]: Aux: > AT+CRSM=192,28613\r
ofonod[1680]: Aux: < \r\n+CRSM: 148,4\r\n\r\nOK\r\n
ofonod[1680]: src/simfs.c:sim_fs_op_read_block() bufoff: 0, seekoff:
39, toread: 17
ofonod[1680]: EFspn read successfully, but couldn't parse
ofonod[1680]: Aux: > AT+CRSM=192,28621\r
ofonod[1680]: Aux: < \r\n+CME ERROR: 4\r\n
ofonod[1680]: 3GPP MBDN not provided, parsing CPHS..
ofonod[1680]: Aux: > AT+CRSM=192,28437\r
ofonod[1680]: Aux: < \r\n+CRSM: 148,4\r\n\r\nOK\r\n
ofonod[1680]: Modem: < \r\n#MWI: 1,1\r\n
ofonod[1680]: Aux: < \r\n#MWI: 1,1\r\n
ofonod[1680]: Aux: < \r\n#QSS: 3\r\n
ofonod[1680]: plugins/telit.c:telit_qss_notify() 0x88e8290
ofonod[1680]: plugins/telit.c:switch_sim_state_status() 0x88e8290, SIM status: 3
ofonod[1680]: Aux: > AT+CSCS=?\r
ofonod[1680]: Aux: < \r\n
ofonod[1680]: Aux: < +CSCS:
("GSM","IRA","8859-1","PCCP437","UCS2")\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CSMS=?\r
ofonod[1680]: Aux: < \r\n+CSMS: (0,1)\r\n\r\nOK\r\n
ofonod[1680]: drivers/atmodem/sms.c:at_csms_query_cb() CSMS query
parsed successfully
ofonod[1680]: Aux: > AT+CPBS=?\r
ofonod[1680]: Aux: < \r\n+CPBS:
("SM","FD","LD","MC","RC","MB","DC","ME")\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CSMS=1\r
ofonod[1680]: Aux: < \r\n+CSMS: 1,1,1\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CSMS?\r
ofonod[1680]: Aux: < \r\n+CSMS: 1,1,1,1\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CMGF=?\r
ofonod[1680]: Aux: < \r\n
ofonod[1680]: Aux: < +CMGF: (0,1)\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CPMS=?\r
ofonod[1680]: Aux: < \r\n+CPMS: ("SM"),("SM"),("SM")\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CMGF=0\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: Aux: > AT+CPMS="SM","SM","SM"\r
ofonod[1680]: Aux: < \r\n
ofonod[1680]: Aux: < +CPMS: 0,100,0,100,0,100\r\n\r\nOK\r\n
ofonod[1680]: Aux: > AT+CNMI=?\r
ofonod[1680]: Aux: < \r\n
ofonod[1680]: Aux: < +CNMI: (0-3),(0-3),(0,2),(0-2),(0,1)\r\n\r\nOK\r\n
ofonod[1680]: drivers/atmodem/sms.c:build_cnmi_string()
ofonod[1680]: drivers/atmodem/sms.c:construct_ack_pdu()
ofonod[1680]: Aux: > AT+CNMI=2,2,2,1,0\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: src/network.c:__ofono_netreg_add_status_watch() 0x88eb670
ofonod[1680]: src/sms.c:sms_restore_tx_queue()
ofonod[1680]: plugins/push-notification.c:sms_watch() registered
ofonod[1680]: plugins/smart-messaging.c:sms_watch() registered
ofonod[1680]: Aux: > AT+CMGL=4\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: drivers/atmodem/sms.c:at_cmgl_done()
ofonod[1680]: Aux: > AT+CGSMS=3\r
ofonod[1680]: Aux: < \r\nOK\r\n
ofonod[1680]: Modem: < AT+CREG?\r\r\n+CREG: 0,2\r\n\r\nOK\r\n
On 17/12/12 17:22, Mingli Wu wrote:
>* For Telit HE910, ofono always got "\r\n+CME ERROR: 14\r\n"*>* after issuing "AT+CMER=3,0,0,2\r" command. "CME ERROR: 14"*>* means that SIM is busy. Now we igonre the result of the*>* command "AT+CMER=3,0,0,2\r", and register network anyway.*>* ---*
I submitted some patches which will solve this problem.
You should not get CME ERROR: 14 anymore and hence
the netreg atom will not be removed.
There is not need to make changes in the network registration atom.
Telit supports +CMER but without waiting for the modem to be ready
the command will fail.
Regards,
Christopher
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 7809 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-03-29 15:40 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 16:22 [PATCH 0/3] Telit HE910 Mingli Wu
2012-12-17 16:22 ` [PATCH 1/3] Support Telit cdc acm device Mingli Wu
2012-12-17 16:34 ` Denis Kenzior
2012-12-17 18:39 ` Ming Li Wu
2012-12-17 16:22 ` [PATCH 2/3] Drop checking whether +CMER is supported Mingli Wu
2012-12-17 16:27 ` Denis Kenzior
2012-12-18 10:08 ` Christopher Vogl
2012-12-17 16:22 ` [PATCH 3/3] Delay 10 seconds between CFUN=4 and CFUN=1 Mingli Wu
-- strict thread matches above, loose matches on Subject: below --
2013-03-29 15:40 [PATCH 2/3] Drop checking whether +CMER is supported Etienne Mabille
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.