[PATCH 0/3] Speedup ussd driver
by Nicolas Bertrand
Speedup is using its own way to handle USSD strings, so the
implementation of this driver avoid some specific code in atmodem.
Nicolas Bertrand (3):
Speedup: Add speedup driver to handle USSD
Speedup: Use speedup specific driver for ussd
Makefile: Add speedup modem target
Makefile.am | 6 +
drivers/speedupmodem/speedupmodem.c | 49 ++++++++
drivers/speedupmodem/speedupmodem.h | 25 ++++
drivers/speedupmodem/ussd.c | 225 +++++++++++++++++++++++++++++++++++
plugins/speedup.c | 4 +-
5 files changed, 307 insertions(+), 2 deletions(-)
create mode 100644 drivers/speedupmodem/speedupmodem.c
create mode 100644 drivers/speedupmodem/speedupmodem.h
create mode 100644 drivers/speedupmodem/ussd.c
--
1.7.5.4
8 years, 9 months
[PATCH] Huawei: core does not allow concurrent online and disable operations
by Bertrand Aygon
---
plugins/huawei.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/plugins/huawei.c b/plugins/huawei.c
index 5d8875a..f025be9 100644
--- a/plugins/huawei.c
+++ b/plugins/huawei.c
@@ -115,9 +115,12 @@ static void huawei_remove(struct ofono_modem *modem)
ofono_modem_set_data(modem, NULL);
/* Cleanup after potential enable polling */
- if (data->sysinfo_poll_source > 0)
+ if (data->sysinfo_poll_source > 0) {
g_source_remove(data->sysinfo_poll_source);
+ g_free(data->online_cbd);
+ }
+
/* Cleanup after hot-unplug */
g_at_chat_unref(data->pcui);
@@ -637,15 +640,6 @@ static int huawei_disable(struct ofono_modem *modem)
g_at_chat_cancel_all(data->pcui);
g_at_chat_unregister_all(data->pcui);
- /* Cleanup potential online enable polling */
- if (data->sysinfo_poll_source > 0) {
- g_source_remove(data->sysinfo_poll_source);
- data->sysinfo_poll_source = 0;
-
- g_free(data->online_cbd);
- data->online_cbd = NULL;
- }
-
g_at_chat_send(data->pcui, "AT+CFUN=0", none_prefix,
cfun_disable, modem, NULL);
--
1.7.5.4
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
8 years, 9 months
[PATCH] hfpmodem: use full CLCC handling in dialing case
by Mike Brudevold
From: Michael Brudevold <michael.brudevold(a)logicpd.com>
A call that moves from the dialing to active state before the +CLCC response
will not properly be added as a voicecall. This is because the dialing callback
was using simplified handling and only looked for calls in the dialing or
alerting state.
AT sequence that exhibited the failure (AG device was an iPhone accessing
visual voicemail):
> +CIND: ("service",(0-1)),("call",(0-1)),("callsetup",(0-3)),
("battchg",(0-5)),("signal",(0-5)),("roam",(0-1)),("callheld",(0-2))
...
> +CIEV: 3,2
< AT+CLCC
> +CIEV: 2,1
> +CIEV: 3,0
> +CLCC: 1,0,0,0,0,"**21153**",129,"Voicemail"
---
drivers/hfpmodem/voicecall.c | 68 +-----------------------------------------
1 files changed, 1 insertions(+), 67 deletions(-)
diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index bcf4292..505601c 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -123,19 +123,6 @@ static struct ofono_call *create_call(struct ofono_voicecall *vc, int type,
return call;
}
-static struct ofono_call *new_call_notify(struct ofono_voicecall *vc, int type,
- int direction, int status,
- const char *num, int num_type, int clip)
-{
- struct ofono_call *c;
-
- c = create_call(vc, type, direction, status, num, num_type, clip);
-
- ofono_voicecall_notify(vc, c);
-
- return c;
-}
-
static void release_call(struct ofono_voicecall *vc, struct ofono_call *call)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
@@ -849,59 +836,6 @@ static void ciev_call_notify(struct ofono_voicecall *vc,
vd->cind_val[HFP_INDICATOR_CALL] = value;
}
-static void sync_dialing_cb(gboolean ok, GAtResult *result, gpointer user_data)
-{
- struct ofono_voicecall *vc = user_data;
- struct voicecall_data *vd = ofono_voicecall_get_data(vc);
- struct ofono_error error;
- GSList *calls;
- GSList *o;
- GSList *n;
- struct ofono_call *oc;
- struct ofono_call *nc;
-
- decode_at_error(&error, g_at_result_final_response(result));
-
- if (!ok)
- return;
-
- calls = at_util_parse_clcc(result);
-
- if (calls == NULL)
- return;
-
- /* Look for dialing or alerting calls on the new list */
- n = find_dialing(calls);
-
- /* Let us find if we have done the dial from HF by looking for
- * existing dialing or alerting calls
- */
- o = find_dialing(vd->calls);
-
- if (n == NULL && o) {
- oc = o->data;
- release_call(vc, oc);
- vd->calls = g_slist_remove(vd->calls, oc);
- } else if (n && o == NULL) {
- nc = n->data;
- new_call_notify(vc, nc->type, nc->direction, nc->status,
- nc->phone_number.number, nc->phone_number.type,
- nc->clip_validity);
- } else if (n && o) {
- oc = o->data;
- nc = n->data;
-
- memcpy(&oc->phone_number, &nc->phone_number,
- sizeof(struct ofono_phone_number));
- oc->status = nc->status;
- oc->clip_validity = nc->clip_validity;
- ofono_voicecall_notify(vc, oc);
- }
-
- g_slist_foreach(calls, (GFunc) g_free, NULL);
- g_slist_free(calls);
-}
-
static void ciev_callsetup_notify(struct ofono_voicecall *vc,
unsigned int value)
{
@@ -979,7 +913,7 @@ static void ciev_callsetup_notify(struct ofono_voicecall *vc,
* from AG: query and create call.
*/
g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix,
- sync_dialing_cb, vc, NULL);
+ clcc_poll_cb, vc, NULL);
break;
case 3:
--
1.7.5.4
8 years, 9 months
[PATCH v1 0/2] Handles errors while receiving messages
by Ronald Tessier
Hi,
These patches concern mmsd and are related to error handling while
receiving message.
The main idea is to try to recover error internally when possible and
drop messages that are not decodable.
Ronald Tessier (2):
service: remove files when unable to decode received msg
service: handle error while receiving messages
src/service.c | 101 +++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 80 insertions(+), 21 deletions(-)
--
1.7.4.1
8 years, 9 months
[PATCH 0/2] Fix wrong Huawei modem behavior
by Guillaume Zajac
Hi All,
When network is lost on Huawei modems during a data call, oFono core will
reset the context that was active and emit that it became inactive.
However it might happen the modem will not end the PPP session, it means
it will be active at driver level although we lost the network.
This behaviour is specific to Huawei, on ZTE for instance, the PPP ending is
initiated correctly by the modem itself everytime the network is lost.
I have thought about 2 ways to fix this:
1 - If we try to connect again although previous PPP session is
still active, just try to use the current active PPP session,
like resuming the session. However there is no AT command to
do such resume_ppp.
2- This the is the solution given in this set of patches, I just
trigger a g_at_ppp_shutdown()if we try to activate context although
it is already active, and when the no carrier is received,
we can restart the activate context logic (AT+CGDCONT, AT+CGDATA...)
Guillaume Zajac (2):
huawei: Specify vendor in creating gprs context atom
atmodem: Fix wrong behavior with Huawei modems
drivers/atmodem/gprs-context.c | 80 ++++++++++++++++++++++++++++++++++++++++
plugins/huawei.c | 2 +-
2 files changed, 81 insertions(+), 1 deletions(-)
--
1.7.4.1
8 years, 9 months
[PATCH v2] SpeedUp: enable online/offline
by Bertrand Aygon
Add speedup_set_online.
Add a polling mechanism since most speedup dongles failed in couple of
AT commands following the CFUN=1 when they are offline.
Cleanup online polling in case modem is removed during online process.
---
plugins/speedup.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 115 insertions(+), 0 deletions(-)
diff --git a/plugins/speedup.c b/plugins/speedup.c
index ca6ed13..5b8de4b 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -47,12 +47,16 @@
#include <drivers/atmodem/atutil.h>
#include <drivers/atmodem/vendor.h>
+static const char *creg_prefix[] = { "+CREG:", NULL };
static const char *none_prefix[] = { NULL };
struct speedup_data {
GAtChat *modem;
GAtChat *aux;
gboolean have_sim;
+ guint online_poll_source;
+ guint online_poll_count;
+ struct cb_data *online_cbd;
struct at_util_sim_state_query *sim_state_query;
};
@@ -232,12 +236,122 @@ static int speedup_disable(struct ofono_modem *modem)
g_at_chat_cancel_all(data->aux);
g_at_chat_unregister_all(data->aux);
+ /* Cleanup potential online enable polling */
+ if (data->online_poll_source > 0) {
+ g_source_remove(data->online_poll_source);
+ data->online_poll_source = 0;
+
+ g_free(data->online_cbd);
+ data->online_cbd = NULL;
+ }
+
g_at_chat_send(data->aux, "AT+CFUN=0", NULL,
cfun_disable, modem, NULL);
return -EINPROGRESS;
}
+static gboolean creg_online_check(gpointer user_data);
+
+static void creg_online_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+{
+ struct speedup_data *data = user_data;
+ ofono_modem_online_cb_t cb = data->online_cbd->cb;
+
+ if (ok) {
+ CALLBACK_WITH_SUCCESS(cb, data->online_cbd->data);
+ goto done;
+ }
+
+ data->online_poll_count++;
+
+ if (data->online_poll_count > 15)
+ goto failure;
+
+ data->online_poll_source = g_timeout_add_seconds(2,
+ creg_online_check, data);
+ return;
+
+failure:
+ CALLBACK_WITH_FAILURE(cb, data->online_cbd->data);
+
+done:
+ g_free(data->online_cbd);
+ data->online_cbd = NULL;
+}
+
+static gboolean creg_online_check(gpointer user_data)
+{
+ struct speedup_data *data = user_data;
+
+ data->online_poll_source = 0;
+
+ g_at_chat_send(data->aux, "AT+CREG=?", creg_prefix,
+ creg_online_cb, data, NULL);
+
+ return FALSE;
+}
+
+static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct speedup_data *data = ofono_modem_get_data(modem);
+
+ if (!ok) {
+ ofono_modem_online_cb_t cb = data->online_cbd->cb;
+
+ CALLBACK_WITH_FAILURE(cb, data->online_cbd->data);
+
+ g_free(data->online_cbd);
+ data->online_cbd = NULL;
+ return;
+ }
+
+ data->online_poll_count = 0;
+
+ creg_online_check(data);
+}
+
+static void set_offline_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_modem_online_cb_t cb = cbd->cb;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+ cb(&error, cbd->data);
+}
+
+static void speedup_set_online(struct ofono_modem *modem, ofono_bool_t online,
+ ofono_modem_online_cb_t cb, void *user_data)
+{
+ struct speedup_data *data = ofono_modem_get_data(modem);
+
+ DBG("modem %p %s", modem, online ? "online" : "offline");
+
+ if (online == TRUE) {
+ data->online_cbd = cb_data_new(cb, user_data);
+
+ if (g_at_chat_send(data->aux, "AT+CFUN=1", none_prefix,
+ set_online_cb, modem, NULL) > 0)
+ return;
+
+ g_free(data->online_cbd);
+ data->online_cbd = NULL;
+ } else {
+ struct cb_data *cbd = cb_data_new(cb, user_data);
+
+ if (g_at_chat_send(data->aux, "AT+CFUN=4",
+ none_prefix, set_offline_cb, cbd, g_free) > 0)
+ return;
+
+ g_free(cbd);
+ }
+
+ CALLBACK_WITH_FAILURE(cb, user_data);
+}
+
static void speedup_pre_sim(struct ofono_modem *modem)
{
struct speedup_data *data = ofono_modem_get_data(modem);
@@ -292,6 +406,7 @@ static struct ofono_modem_driver speedup_driver = {
.remove = speedup_remove,
.enable = speedup_enable,
.disable = speedup_disable,
+ .set_online = speedup_set_online,
.pre_sim = speedup_pre_sim,
.post_sim = speedup_post_sim,
.post_online = speedup_post_online,
--
1.7.5.4
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
8 years, 9 months
hfp voicecall fails to register in ofono with iPhone voicemail
by Mike
I'm experiencing an issue where the +CLCC response provided by an
iPhone is ignored in the case of a user utilizing visual voicemail.
The problem here is that the AT+CLCC is being sent in response to a
+CIEV indicating call setup, but by the time the +CLCC response comes
back, the call status is active. This is a problem because the
callback, sync_dialing_cb, is specifically looking for calls in the
dialing state. It looks like at least some bits from clcc_poll_cb
should be copied into sync_dialing_cb (or a helper function) because I
would think any time we get a +CLCC we would want to completely update
our call list (and therefore fix the issue I'm encountering). I'm
still digging into this, but as I'm not familiar with all the quirks
of devices out there, I'm throwing this out there in case anyone has
some ideas on this.
Thanks,
Mike
> ACL data: handle 1 flags 0x02 dlen 141
L2CAP(d): cid 0x0040 len 137 [psm 3]
RFCOMM(d): UIH: cr 1 dlci 14 pf 0 ilen 132 fcs 0xa5
0000: 0d 0a 2b 43 49 4e 44 3a 20 28 22 73 65 72 76 69 ..+CIND: ("servi
0010: 63 65 22 2c 28 30 2d 31 29 29 2c 28 22 63 61 6c ce",(0-1)),("cal
0020: 6c 22 2c 28 30 2d 31 29 29 2c 28 22 63 61 6c 6c l",(0-1)),("call
0030: 73 65 74 75 70 22 2c 28 30 2d 33 29 29 2c 28 22 setup",(0-3)),("
0040: 62 61 74 74 63 68 67 22 2c 28 30 2d 35 29 29 2c battchg",(0-5)),
0050: 28 22 73 69 67 6e 61 6c 22 2c 28 30 2d 35 29 29 ("signal",(0-5))
0060: 2c 28 22 72 6f 61 6d 22 2c 28 30 2d 31 29 29 2c ,("roam",(0-1)),
0070: 28 22 63 61 6c 6c 68 65 6c 64 22 2c 28 30 2d 32 ("callheld",(0-2
0080: 29 29 0d 0a ))..
...
> ACL data: handle 1 flags 0x02 dlen 22
L2CAP(d): cid 0x0040 len 18 [psm 3]
RFCOMM(d): UIH: cr 1 dlci 14 pf 0 ilen 14 fcs 0xa5
0000: 0d 0a 2b 43 49 45 56 3a 20 33 2c 32 0d 0a ..+CIEV: 3,2..
< ACL data: handle 1 flags 0x02 dlen 16
L2CAP(d): cid 0x7800 len 12 [psm 3]
RFCOMM(d): UIH: cr 0 dlci 14 pf 0 ilen 8 fcs 0x7f
0000: 41 54 2b 43 4c 43 43 0d AT+CLCC.
> HCI Event: Number of Completed Packets (0x13) plen 5
handle 1 packets 1
> HCI Event: Connect Request (0x04) plen 10
bdaddr 90:27:E4:58:B8:DC class 0x7a020c type eSCO
< HCI Command: Accept Synchronous Connection (0x01|0x0029) plen 21
bdaddr 90:27:E4:58:B8:DC
0000: 40 1f 00 00 40 1f 00 00 ff ff 60 00 ff 3f 00 @...@.....`..?.
> HCI Event: Command Status (0x0f) plen 4
Accept Synchronous Connection (0x01|0x0029) status 0x00 ncmd 1
> HCI Event: Synchronous Connect Complete (0x2c) plen 17
status 0x00 handle 257 bdaddr 90:27:E4:58:B8:DC type eSCO
Air mode: CVSD
> ACL data: handle 1 flags 0x02 dlen 22
L2CAP(d): cid 0x0040 len 18 [psm 3]
RFCOMM(d): UIH: cr 1 dlci 14 pf 0 ilen 14 fcs 0xa5
0000: 0d 0a 2b 43 49 45 56 3a 20 32 2c 31 0d 0a ..+CIEV: 2,1..
> ACL data: handle 1 flags 0x02 dlen 22
L2CAP(d): cid 0x0040 len 18 [psm 3]
RFCOMM(d): UIH: cr 1 dlci 14 pf 0 ilen 14 fcs 0xa5
0000: 0d 0a 2b 43 49 45 56 3a 20 33 2c 30 0d 0a ..+CIEV: 3,0..
> ACL data: handle 1 flags 0x02 dlen 56
L2CAP(d): cid 0x0040 len 52 [psm 3]
RFCOMM(d): UIH: cr 1 dlci 14 pf 0 ilen 48 fcs 0xa5
0000: 0d 0a 2b 43 4c 43 43 3a 20 31 2c 30 2c 30 2c 30 ..+CLCC: 1,0,0,0
0010: 2c 30 2c 22 2a 2a 32 31 31 35 33 2a 2a 22 2c 31 ,0,"**21153**",1
0020: 32 39 2c 22 56 6f 69 63 65 6d 61 69 6c 22 0d 0a 29,"Voicemail"..
> ACL data: handle 1 flags 0x02 dlen 14
L2CAP(d): cid 0x0040 len 10 [psm 3]
RFCOMM(d): UIH: cr 1 dlci 14 pf 0 ilen 6 fcs 0xa5
0000: 0d 0a 4f 4b 0d 0a ..OK..
8 years, 9 months
[PATCH 0/2] ussd fixes
by Nicolas Bertrand
Fix some issues with ussd:
- Crash with speedup dongles
- Crash with ZTE dongles
Nicolas Bertrand (2):
ussd: rise up buffer lenght for ussd strings
ussd: Fix speedup ussd encoding
drivers/atmodem/ussd.c | 15 +++++++++++----
plugins/speedup.c | 2 +-
2 files changed, 12 insertions(+), 5 deletions(-)
--
1.7.5.4
8 years, 9 months
Bluetooth HFP Audio
by Vijay Chavan (RBEI/ECP2)
Hello All,
I am using Ofono-0.41 on Meego-1.2 & Ubuntu-11.04 for Bluetooth HFP telephony.
All the call handing works fine but I am not able to get audio for phone calls.
Has any one tried bluetooth audio? Any clue will be a great help.
Thanks...
Mit freundlichen Grüßen / Best regards
Vijay Chavan
RBEI/ECP2
Tel. +91(80) 66575647
8 years, 9 months
[PATCH] atmodem: Use ZTE specific vendor quirk for SMS status report support
by Philippe Nunes
---
drivers/atmodem/sms.c | 37 ++++++++++++++++++++++++++++---------
1 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c
index c31eb39..27dc2c0 100644
--- a/drivers/atmodem/sms.c
+++ b/drivers/atmodem/sms.c
@@ -319,17 +319,16 @@ static void at_cnma_cb(gboolean ok, GAtResult *result, gpointer user_data)
"Further SMS reception is not guaranteed");
}
-static gboolean at_parse_pdu_common(GAtResult *result, const char *prefix,
- const char **pdu, int *pdulen)
+static gboolean at_parse_cmt(GAtResult *result, const char **pdu, int *pdulen)
{
GAtResultIter iter;
g_at_result_iter_init(&iter, result);
- if (!g_at_result_iter_next(&iter, prefix))
+ if (!g_at_result_iter_next(&iter, "+CMT:"))
return FALSE;
- if (!strcmp(prefix, "+CMT:") && !g_at_result_iter_skip_next(&iter))
+ if (!g_at_result_iter_skip_next(&iter))
return FALSE;
if (!g_at_result_iter_next_number(&iter, pdulen))
@@ -365,11 +364,26 @@ static void at_cds_notify(GAtResult *result, gpointer user_data)
int tpdu_len;
const char *hexpdu;
unsigned char pdu[176];
+ GAtResultIter iter;
- if (!at_parse_pdu_common(result, "+CDS:", &hexpdu, &tpdu_len)) {
- ofono_error("Unable to parse CDS notification");
- return;
- }
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+CDS:"))
+ goto err;
+
+ /*
+ * Quirk for ZTE firmware which is not compliant with 27.005
+ * The +CDS syntax used by ZTE is including a comma before the length
+ * +CDS: ,<length><CR><LF><pdu>
+ * As a result, we need to skip this omitted subparameter
+ */
+ if (data->vendor == OFONO_VENDOR_ZTE)
+ g_at_result_iter_skip_next(&iter);
+
+ if (!g_at_result_iter_next_number(&iter, &tpdu_len))
+ goto err;
+
+ hexpdu = g_at_result_pdu(result);
if (strlen(hexpdu) > sizeof(pdu) * 2) {
ofono_error("Bad PDU length in CDS notification");
@@ -384,6 +398,11 @@ static void at_cds_notify(GAtResult *result, gpointer user_data)
if (data->cnma_enabled)
at_ack_delivery(sms);
+
+ return;
+
+err:
+ ofono_error("Unable to parse CDS notification");
}
static void at_cmt_notify(GAtResult *result, gpointer user_data)
@@ -395,7 +414,7 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
int tpdu_len;
unsigned char pdu[176];
- if (!at_parse_pdu_common(result, "+CMT:", &hexpdu, &tpdu_len)) {
+ if (!at_parse_cmt(result, &hexpdu, &tpdu_len)) {
ofono_error("Unable to parse CMT notification");
return;
}
--
1.7.1
8 years, 9 months