ofonod crashes during enable-modem.py
by Norbert Huffschmid
Hi there,
I'm testing ofono in a bluetooth HFP setup. I have successfully paired
a smartphone and can see it via the list-modems.py script. When I try
to enable the modem, ofonod crashes with segfault:
Jan 31 16:27:40 raspberrypi ofonod[5296]: plugins/
hfp_hf.c:hfp_enable() 0x570e70
Jan 31 16:27:45 raspberrypi ofonod[5296]: src/
modem.c:modem_change_state() old state: 0, new state: 1
Jan 31 16:27:45 raspberrypi ofonod[5296]: plugins/
hfp_hf.c:hfp_pre_sim() 0x570e70
Jan 31 16:27:45 raspberrypi ofonod[5296]: drivers/hfpmodem/call-
volume.c:hfp_call_volume_probe()
Jan 31 16:27:45 raspberrypi ofonod[5296]: drivers/hfpmodem/
handsfree.c:hfp_handsfree_probe()
Jan 31 16:27:45 raspberrypi ofonod[5296]: src/
modem.c:modem_change_state() old state: 1, new state: 2
Jan 31 16:27:45 raspberrypi ofonod[5296]: plugins/
hfp_hf.c:hfp_post_sim() 0x570e70
Jan 31 16:27:45 raspberrypi ofonod[5296]: src/
modem.c:modem_change_state() old state: 2, new state: 3
Jan 31 16:27:45 raspberrypi ofonod[5296]: Service level connection
established
Jan 31 16:27:45 raspberrypi ofonod[5296]: src/
network.c:ofono_netreg_status_notify() /hfp/001BDC0365E3_EC59E7D393ED
status 1 tech -1
Jan 31 16:27:45 raspberrypi ofonod[5296]: Aborting (signal 11) [/usr/
sbin/ofonod]
This happens with ofono 1.6-2 (Debian Wheezy) on a Raspberry Pi.
Any ideas how to fix or work around this issue?
Thanks,
Norbert
6 years
[PATCH] sierra: add sim state polling after CFUN enable
by Cedric Jehasse
From: Cedric Jehasse <cedric.jehasse(a)softathome.com>
When pin is queried shortly after a Siera dongle is plugged in, "AT+CPIN?"
responds with "CME ERROR 14: SIM".
Poll the sim, as already done by several other vendor plugins.
---
plugins/sierra.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/plugins/sierra.c b/plugins/sierra.c
index a458e38..458fec2 100644
--- a/plugins/sierra.c
+++ b/plugins/sierra.c
@@ -48,6 +48,8 @@ static const char *none_prefix[] = { NULL };
struct sierra_data {
GAtChat *modem;
+ gboolean have_sim;
+ struct at_util_sim_state_query *sim_state_query;
};
static void sierra_debug(const char *str, void *user_data)
@@ -80,6 +82,9 @@ static void sierra_remove(struct ofono_modem *modem)
ofono_modem_set_data(modem, NULL);
+ /* Cleanup potential SIM state polling */
+ at_util_sim_state_query_free(data->sim_state_query);
+
/* Cleanup after hot-unplug */
g_at_chat_unref(data->modem);
@@ -119,6 +124,21 @@ static GAtChat *open_device(struct ofono_modem *modem,
return chat;
}
+static void sim_state_cb(gboolean present, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct sierra_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ at_util_sim_state_query_free(data->sim_state_query);
+ data->sim_state_query = NULL;
+
+ data->have_sim = present;
+ ofono_modem_set_powered(modem, TRUE);
+
+}
+
static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
@@ -131,7 +151,9 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
data->modem = NULL;
}
- ofono_modem_set_powered(modem, ok);
+ data->sim_state_query = at_util_sim_state_query_new(data->modem,
+ 2, 20, sim_state_cb, modem,
+ NULL);
}
static int sierra_enable(struct ofono_modem *modem)
@@ -222,7 +244,7 @@ static void sierra_pre_sim(struct ofono_modem *modem)
sim = ofono_sim_create(modem, OFONO_VENDOR_SIERRA,
"atmodem", data->modem);
- if (sim)
+ if (sim && data->have_sim == TRUE)
ofono_sim_inserted_notify(sim, TRUE);
}
--
1.9.2
6 years
Serial modem and oFono
by Enrico Sau
Hi all,
I'm now working with a serial device, which doesn't trigger udev events
when connected. It simply works with ttyS0 device.
First question is if there is any way for oFono to recognize this modem,
but I believe that the answer will be: yes, if you trigger an udev event.
Ok, so, second question, is there any way to add a modem to oFono without
going through udev plugin?
Thank you.
Enrico
6 years
[PATCH] gprs: Setup route for mmsc if there's no mms proxy
by Slava Monich
And don't setup mms route at all if mmsc/proxy host name is not in
dotted IPv4 format.
---
src/gprs.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/src/gprs.c b/src/gprs.c
index 05ab499..9c643b9 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -585,13 +585,16 @@ static void pri_context_signal_settings(struct pri_context *ctx,
context_settings_append_ipv6);
}
-static void pri_parse_proxy(struct pri_context *ctx, const char *proxy)
+static gboolean pri_parse_proxy(struct pri_context *ctx, const char *proxy)
{
char *scheme, *host, *port, *path;
+ if (proxy[0] == 0)
+ return FALSE;
+
scheme = g_strdup(proxy);
if (scheme == NULL)
- return;
+ return FALSE;
host = strstr(scheme, "://");
if (host != NULL) {
@@ -604,7 +607,7 @@ static void pri_parse_proxy(struct pri_context *ctx, const char *proxy)
ctx->proxy_port = 80;
else {
g_free(scheme);
- return;
+ return FALSE;
}
} else {
host = scheme;
@@ -626,10 +629,16 @@ static void pri_parse_proxy(struct pri_context *ctx, const char *proxy)
}
}
+ if (host[0] == 0) {
+ g_free(scheme);
+ return FALSE;
+ }
+
g_free(ctx->proxy_host);
ctx->proxy_host = g_strdup(host);
g_free(scheme);
+ return TRUE;
}
static void pri_ifupdown(const char *interface, ofono_bool_t active)
@@ -715,11 +724,16 @@ static void pri_setproxy(const char *interface, const char *proxy)
{
struct rtentry rt;
struct sockaddr_in addr;
+ in_addr_t proxy_addr;
int sk;
if (interface == NULL)
return;
+ proxy_addr = inet_addr(proxy);
+ if (proxy_addr == INADDR_NONE)
+ return;
+
sk = socket(PF_INET, SOCK_DGRAM, 0);
if (sk < 0)
return;
@@ -730,7 +744,7 @@ static void pri_setproxy(const char *interface, const char *proxy)
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = inet_addr(proxy);
+ addr.sin_addr.s_addr = proxy_addr;
memcpy(&rt.rt_dst, &addr, sizeof(rt.rt_dst));
memset(&addr, 0, sizeof(addr));
@@ -792,7 +806,8 @@ static void pri_update_mms_context_settings(struct pri_context *ctx)
if (ctx->message_proxy)
settings->ipv4->proxy = g_strdup(ctx->message_proxy);
- pri_parse_proxy(ctx, ctx->message_proxy);
+ if (!pri_parse_proxy(ctx, ctx->message_proxy))
+ pri_parse_proxy(ctx, ctx->message_center);
DBG("proxy %s port %u", ctx->proxy_host, ctx->proxy_port);
--
1.8.3.2
6 years, 1 month
SMS doubt
by Enrico Sau
Hi all,
I was wondering how should ofono behave on a SMS reception.
Should the message be saved somewhere by ofono, or another application in
needed for that?
I'm asking because after some SMS receptions, the script list-messages does
not show anything.
Thank you
Enrico
6 years, 1 month
[PATCH] network: Add NetworkRegistration.OperatorsChanged signal
by Slava Monich
This signal gets emitted when operator list has changed.
It contains the current list of operators.
---
doc/network-api.txt | 5 +++++
src/network.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/doc/network-api.txt b/doc/network-api.txt
index 83a2bc0..d635ba7 100644
--- a/doc/network-api.txt
+++ b/doc/network-api.txt
@@ -57,6 +57,11 @@ Signals PropertyChanged(string property, variant value)
This signal indicates a changed value of the given
property.
+ OperatorsChanged(array{object,dict})
+
+ Signal that gets emitted when operator list has
+ changed. It contains the current list of operators.
+
Properties string Mode [readonly]
The current registration mode. The default of this
diff --git a/src/network.c b/src/network.c
index d1bfca6..1b8b759 100644
--- a/src/network.c
+++ b/src/network.c
@@ -934,6 +934,40 @@ static void append_operator_struct_list(struct ofono_netreg *netreg,
dbus_free_string_array(children);
}
+static void network_signal_operators_changed(struct ofono_netreg *netreg)
+{
+ const char *path = __ofono_atom_get_path(netreg->atom);
+ DBusConnection *conn = ofono_dbus_get_connection();
+ DBusMessage *signal;
+ DBusMessageIter iter;
+ DBusMessageIter array;
+
+ signal = dbus_message_new_signal(path,
+ OFONO_NETWORK_REGISTRATION_INTERFACE, "OperatorsChanged");
+ if (signal == NULL) {
+ ofono_error("Unable to allocate new "
+ OFONO_NETWORK_REGISTRATION_INTERFACE
+ ".OperatorsChanged signal");
+ return;
+ }
+
+ dbus_message_iter_init_append(signal, &iter);
+ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
+ DBUS_STRUCT_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_OBJECT_PATH_AS_STRING
+ DBUS_TYPE_ARRAY_AS_STRING
+ DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING
+ DBUS_TYPE_VARIANT_AS_STRING
+ DBUS_DICT_ENTRY_END_CHAR_AS_STRING
+ DBUS_STRUCT_END_CHAR_AS_STRING,
+ &array);
+ append_operator_struct_list(netreg, &array);
+ dbus_message_iter_close_container(&iter, &array);
+
+ g_dbus_send_message(conn, signal);
+}
+
static void operator_list_callback(const struct ofono_error *error, int total,
const struct ofono_network_operator *list,
void *data)
@@ -942,6 +976,7 @@ static void operator_list_callback(const struct ofono_error *error, int total,
DBusMessage *reply;
DBusMessageIter iter;
DBusMessageIter array;
+ gboolean changed;
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
DBG("Error occurred during operator list");
@@ -950,7 +985,7 @@ static void operator_list_callback(const struct ofono_error *error, int total,
return;
}
- update_operator_list(netreg, total, list);
+ changed = update_operator_list(netreg, total, list);
reply = dbus_message_new_method_return(netreg->pending);
@@ -970,6 +1005,11 @@ static void operator_list_callback(const struct ofono_error *error, int total,
dbus_message_iter_close_container(&iter, &array);
__ofono_dbus_pending_reply(&netreg->pending, reply);
+
+ DBG("operator list %schanged", changed ? "" : "not ");
+
+ if (changed)
+ network_signal_operators_changed(netreg);
}
static DBusMessage *network_scan(DBusConnection *conn,
@@ -1041,6 +1081,8 @@ static const GDBusMethodTable network_registration_methods[] = {
static const GDBusSignalTable network_registration_signals[] = {
{ GDBUS_SIGNAL("PropertyChanged",
GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
+ { GDBUS_SIGNAL("OperatorsChanged",
+ GDBUS_ARGS({ "operators", "a(oa{sv})"})) },
{ }
};
--
1.8.3.2
6 years, 1 month
a problem about ofono dbus
by 周琼(周琼)
Hi, all:
I have a problem when accessing ofono dbus interface, after run my code,
there is error “process 14234: type invalid 0 not a basic type D-Bus not
built with -rdynamic so unable to print a backtrace Aborted”.
How to debug the issue? Would you please give some suggestion?
Thanks
Zhou qiong
6 years, 1 month
SMS and DTR
by Enrico Sau
Dear all,
I don't understand why, after every sent SMS PDU, the DTR signal is set
down.
This is a problem for me, since my modem does not answer anymore with DTR
down.
Can anyone please explain the reason and suggest how to avoid it?
Thank you
Enrico
6 years, 1 month
[help] automatic data reconnection in case of signal loss
by Mylene JOSSERAND
Hi everyone,
I am doing some tests with Ofono.
Currently, I am trying to see if Ofono can handle an automatic data
reconnection in case of signal loss.
I am doing the following test :
- Connect the modem to data connection via atmodem driver (so PPP link)
- Disconnect the antenna to lose signal
- Reconnect the antenna to get signal back
- Try to get data connection back
The atmodem driver is notified that the signal is lost so it disconnects
ppp with "gprs-context.c:ppp_disconnect() Reason: 6".
After re-connecting the antenna and that the network is back, in the
Ofono interfaces, it did not changed, I always have the
ConnectionManager interface. The difference is that the context is not
activated. So, I try to re-activate it but it failed with error :
gprs.c:pri_activate_callback() Activating context failed with error:
Unknown error type
I guess that someone should have test it before me. If it is the case,
is there something I am doing wrong ? I do not know how Ofono should
react in this case. Maybe it should remove some interfaces ? Go in
"offline" mode ?
If nobody tested it before, what should I look for ?
Thank you in advance for any help and Merry Christmas :)
Mylène
6 years, 1 month
oFono upstream test results_20150106
by Nicolas Paccou
Hello all,
Please find the test report of oFono v1.16 commit c9e426e.
During this testing, we ran 32 functional positive cases. 32 cases
passed, 0 failed and 0 blocked.
The Pass Rate is 100% (no change vs previous session). No regression has
been found.
-----------------------------------------------
*Test Objective *
The aim of this session was to validate the state of oFono upstream by
testing only major tests of most important features over all material we
had (according to what feature was supported and by priority order: 3G
dongle, Smartphone connected through HFP). oFono has been installed and
tested on Ubuntu 14.04 device.
-----------------------------------------------
*Test Environment *
For all Setup:
oFono: v1.16 (updated to commit c9e426e)
-Laptop + 3G Dongle:
usb_modeswitch: v2.1.1
modeswitch data: 20140327-1
Hardware: Laptop
Ubuntu: v14.04
Modem: Huawei E173u-2 - Operator & SIM Card: Bouygues SIM Card – Phone
number +3363999052
-Laptop + HFP
HF:
Hardware: Laptop
Ubuntu: v14.04
Bluez 4.101 (current version running on Ubuntu 14.04)
oFono has been installed with “--enable-bluez4” option
AG:
Android KK device with ORANGE SIM Card – Phone number +33647301491
-----------------------------------------------
*Issue Summary *
New bug: 0
Known bug: 1
OF-162 - Going back from a select item list releases the session
https://01.org/jira/browse/OF-162
Closed bug: 0
-----------------------------------------------
*Test Result *
*Result Summary – Basic Features*
Total Test Case
*32*
Passed
32
Failed
0
Blocked
0
TCs completed
*100,0%*
Run rate
*100%*
Pass rate total
*100%*
Blocked rate total
*0%*
Pass rate of executed
*100%*
*Test Result by feature
*
*Features (and their status in color)*
*Total*
*Pass*
*Fail*
*Blocked*
*Pass %*
*Modem Used*
Modem
*5*
5
0
0
*100%*
Tested on Laptop using 3G Dongle with a real SIM
SIM
*4*
4
0
0
*100%*
Tested on Laptop using 3G Dongle with a real SIM
Network
*2*
2
0
0
*100%*
Tested on Laptop using 3G Dongle with a real SIM
Connectivity
*8*
8
0
0
*100%*
Tested on Laptop using 3G Dongle with a real SIM
Voice Calls
*10*
10
0
0
*100%*
Tested on Laptop + HFP connected with a smartphone with a real SIM
Messaging
*2*
2
0
0
*100%*
Tested on Laptop using 3G Dongle with a real SIM
Message Waiting
*1*
1
0
0
*100%*
Tested on Laptop using 3G Dongle with a real SIM
Please find details in the attached file.*
*-----------------------------------------------
*Notes***
Please note that one oFono crash still occurs on the following conditions:
-OF-163 <https://01.org/jira/browse/OF-163>- oFono crashes when doing a
NAA Initialization+File Change Notification after having done a NAA
Initialization+Full File Change Notification with Phonesim.
Best regards,
Nicolas
6 years, 1 month