[PATCH 1/6] gat: add GAtSuspendFunc CB typedef
by Guillaume Zajac
---
gatchat/gat.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gatchat/gat.h b/gatchat/gat.h
index ddf8695..f067389 100644
--- a/gatchat/gat.h
+++ b/gatchat/gat.h
@@ -32,6 +32,7 @@ typedef void (*GAtDisconnectFunc)(gpointer user_data);
typedef void (*GAtReceiveFunc)(const unsigned char *data, gsize size,
gpointer user_data);
typedef void (*GAtDebugFunc)(const char *str, gpointer user_data);
+typedef void (*GAtSuspendFunc)(gpointer user_data);
#ifdef __cplusplus
}
--
1.7.1
11 years, 5 months
[PATCH v2 0/6] Time Independent Escape Sequence implementation
by Guillaume Zajac
This set of patch will implement the escape sequence detection implementation:
<pause> +++ <pause>
The <pause> length is fixed by the guard timeouts.
The length to detect +++ sequence is fixed by the escape time.
Guillaume Zajac (6):
gat: add GAtSuspendFunc CB typedef
gathdlc: add g_at_hdlc_set_suspend_function() prototype
gathdlc: add mechansim to detect '+++' escape sequence
gatppp: add g_at_ppp_set_suspend_function() prototype
gatppp: add g_at_ppp_set_suspend_function() definition
emulator: add ppp_suspend() CB and register it
gatchat/gat.h | 1 +
gatchat/gathdlc.c | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++
gatchat/gathdlc.h | 3 +
gatchat/gatppp.c | 8 ++++
gatchat/gatppp.h | 2 +
src/emulator.c | 10 +++++
6 files changed, 135 insertions(+), 0 deletions(-)
11 years, 5 months
[PATCH 3/6] gathdlc: add mechanism to detect ppp suspension from DUN client.
by Guillaume Zajac
---
gatchat/gathdlc.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c
index 6c39e6c..38606b8 100644
--- a/gatchat/gathdlc.c
+++ b/gatchat/gathdlc.c
@@ -66,6 +66,10 @@ struct _GAtHDLC {
gboolean in_read_handler;
gboolean destroyed;
gboolean no_carrier_detect;
+ GAtSuspendFunc suspend_func;
+ gpointer suspend_data;
+ guint cmpt;
+ guint suspend_timeout;
};
static void hdlc_record(int fd, gboolean in, guint8 *data, guint16 length)
@@ -128,6 +132,34 @@ guint32 g_at_hdlc_get_recv_accm(GAtHDLC *hdlc)
return hdlc->recv_accm;
}
+void g_at_hdlc_set_suspend_function(GAtHDLC *hdlc, GAtSuspendFunc func,
+ gpointer user_data)
+{
+ if (hdlc == NULL)
+ return;
+
+ hdlc->suspend_func = func;
+ hdlc->suspend_data = user_data;
+}
+
+static gboolean susp_timeout_cb(gpointer user_data)
+{
+ GAtHDLC *hdlc = user_data;
+
+ hdlc->cmpt = 0;
+
+ return FALSE;
+}
+
+static void hdlc_suspend(GAtHDLC *hdlc)
+{
+ g_at_io_set_write_handler(hdlc->io, NULL, NULL);
+ g_at_io_set_read_handler(hdlc->io, NULL, NULL);
+
+ if (hdlc->suspend_func)
+ hdlc->suspend_func(hdlc->suspend_data);
+}
+
static void new_bytes(struct ring_buffer *rbuf, gpointer user_data)
{
GAtHDLC *hdlc = user_data;
@@ -151,6 +183,21 @@ static void new_bytes(struct ring_buffer *rbuf, gpointer user_data)
hdlc->decode_offset == 0 && *buf == '\r')
break;
+ /* We detect the '+' character to suspend data call if
+ * 3 '+' are detected in less than 500 milliseconds
+ */
+ if (*buf == '+') {
+ if (hdlc->cmpt == 0)
+ hdlc->suspend_timeout = g_timeout_add (500,
+ susp_timeout_cb, hdlc);
+ hdlc->cmpt++;
+ if (hdlc->cmpt == 3)
+ goto suspend;
+ }
+ else {
+ hdlc->cmpt = 0;
+ }
+
if (hdlc->decode_escape == TRUE) {
unsigned char val = *buf ^ HDLC_TRANS;
@@ -195,6 +242,15 @@ out:
if (hdlc->destroyed)
g_free(hdlc);
+
+ return;
+
+suspend:
+ g_source_remove(hdlc->suspend_timeout);
+
+ ring_buffer_reset(rbuf);
+
+ hdlc_suspend(hdlc);
}
GAtHDLC *g_at_hdlc_new_from_io(GAtIO *io)
@@ -236,6 +292,8 @@ GAtHDLC *g_at_hdlc_new_from_io(GAtIO *io)
hdlc->io = g_at_io_ref(io);
g_at_io_set_read_handler(hdlc->io, new_bytes, hdlc);
+ hdlc->cmpt = 0;
+
return hdlc;
error:
--
1.7.1
11 years, 5 months
[PATCH v2 0/2] HFP: add call related indicators
by Frédéric Danis
Add call, callsetup and callheld indicators for +CIEV
Frédéric Danis (2):
emulator: add defines for call, callsetup and callheld indicators
emulator: add call, callsetup and callheld indicators
include/emulator.h | 12 +++++++
src/emulator.c | 5 +++
src/voicecall.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 109 insertions(+), 0 deletions(-)
11 years, 6 months
[PATCH v2] netreg: add +COPS support for HFP emulator
by Frédéric Danis
---
src/network.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/src/network.c b/src/network.c
index 2d0a9f8..76036a5 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1693,6 +1693,13 @@ void ofono_netreg_driver_unregister(const struct ofono_netreg_driver *d)
g_drivers = g_slist_remove(g_drivers, (void *) d);
}
+static void emulator_remove_handler(struct ofono_atom *atom, void *data)
+{
+ struct ofono_emulator *em = __ofono_atom_get_data(atom);
+
+ ofono_emulator_remove_handler(em, data);
+}
+
static void netreg_unregister(struct ofono_atom *atom)
{
struct ofono_netreg *netreg = __ofono_atom_get_data(atom);
@@ -1707,6 +1714,9 @@ static void netreg_unregister(struct ofono_atom *atom)
__ofono_modem_foreach_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP,
notify_emulator_strength, GINT_TO_POINTER(0));
+ __ofono_modem_foreach_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP,
+ emulator_remove_handler, "+COPS");
+
__ofono_modem_remove_atom_watch(modem, netreg->hfp_watch);
__ofono_watchlist_free(netreg->status_watches);
@@ -1890,12 +1900,54 @@ static void sim_spn_spdi_changed(int id, void *userdata)
sim_spn_read_cb, netreg);
}
+static void emulator_cops_cb(struct ofono_emulator *em,
+ struct ofono_emulator_request *req, void *userdata)
+{
+ struct ofono_netreg *netreg = userdata;
+ struct ofono_error result;
+ int val;
+ char name[17];
+ char buf[32];
+
+ result.error = 0;
+
+ switch (ofono_emulator_request_get_type(req)) {
+ case OFONO_EMULATOR_REQUEST_TYPE_SET:
+ ofono_emulator_request_next_number(req, &val);
+ if (val != 3)
+ goto fail;
+
+ ofono_emulator_request_next_number(req, &val);
+ if (val != 0)
+ goto fail;
+
+ result.type = OFONO_ERROR_TYPE_NO_ERROR;
+ ofono_emulator_send_final(em, &result);
+ break;
+
+ case OFONO_EMULATOR_REQUEST_TYPE_QUERY:
+ strncpy(name, get_operator_display_name(netreg), 16);
+ name[16] = '\0';
+ sprintf(buf, "+COPS: %d,0,\"%s\"", netreg->mode, name);
+ ofono_emulator_send_info(em, buf, TRUE);
+ result.type = OFONO_ERROR_TYPE_NO_ERROR;
+ ofono_emulator_send_final(em, &result);
+ break;
+
+ default:
+fail:
+ result.type = OFONO_ERROR_TYPE_FAILURE;
+ ofono_emulator_send_final(em, &result);
+ };
+}
+
static void emulator_hfp_watch(struct ofono_atom *atom,
enum ofono_atom_watch_condition cond,
void *data)
{
struct ofono_netreg *netreg = data;
struct ofono_modem *modem = __ofono_atom_get_modem(netreg->atom);
+ struct ofono_emulator *em = __ofono_atom_get_data(atom);
if (cond == OFONO_ATOM_WATCH_CONDITION_REGISTERED) {
__ofono_modem_foreach_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP,
@@ -1904,6 +1956,9 @@ static void emulator_hfp_watch(struct ofono_atom *atom,
__ofono_modem_foreach_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP,
notify_emulator_strength,
GINT_TO_POINTER(netreg->signal_strength));
+
+ ofono_emulator_add_handler(em, "+COPS", emulator_cops_cb, data,
+ NULL);
}
}
@@ -1913,6 +1968,7 @@ void ofono_netreg_register(struct ofono_netreg *netreg)
struct ofono_modem *modem = __ofono_atom_get_modem(netreg->atom);
const char *path = __ofono_atom_get_path(netreg->atom);
struct ofono_atom *sim_atom;
+ struct ofono_atom *hfp_atom;
if (!g_dbus_register_interface(conn, path,
OFONO_NETWORK_REGISTRATION_INTERFACE,
@@ -1968,6 +2024,13 @@ void ofono_netreg_register(struct ofono_netreg *netreg)
netreg->hfp_watch = __ofono_modem_add_atom_watch(modem,
OFONO_ATOM_TYPE_EMULATOR_HFP,
emulator_hfp_watch, netreg, NULL);
+
+ hfp_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_EMULATOR_HFP);
+
+ if (hfp_atom && __ofono_atom_get_registered(hfp_atom))
+ emulator_hfp_watch(hfp_atom,
+ OFONO_ATOM_WATCH_CONDITION_REGISTERED,
+ netreg);
}
void ofono_netreg_remove(struct ofono_netreg *netreg)
--
1.7.1
11 years, 6 months
[PATCH] unit: fix broken alpha id unit test cases
by Jeevaka Badrappan
---
unit/test-stkutil.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index f1cad78..aa62aac 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -129,7 +129,10 @@ static inline void check_address(const struct stk_address *command,
/* Defined in TS 102.223 Section 8.2 */
static inline void check_alpha_id(const char *command, const char *test)
{
- check_common_text(command, test);
+ if (test != NULL && strlen(test) > 0)
+ check_common_text(command, test);
+ else
+ g_assert(command == NULL);
}
/* Defined in TS 102.223 Section 8.3 */
@@ -5937,8 +5940,6 @@ static void test_setup_menu(gconstpointer data)
g_assert(command->src == STK_DEVICE_IDENTITY_TYPE_UICC);
g_assert(command->dst == STK_DEVICE_IDENTITY_TYPE_TERMINAL);
- if (test->alpha_id)
- g_assert(command->setup_menu.alpha_id);
check_alpha_id(command->setup_menu.alpha_id, test->alpha_id);
check_items(command->setup_menu.items, test->items);
check_items_next_action_indicator(&command->setup_menu.next_act,
--
1.7.0.4
11 years, 6 months
[PATCH] voicecall: allow pause to be sent through SendTones()
by Lucas De Marchi
manager_tone() converts all tone chars to uppercase. Since everywhere we
check for both 'p' and 'P' for a pause, tone_queue() should also check
both before claiming the string is invalid.
---
src/voicecall.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/voicecall.c b/src/voicecall.c
index cb5258d..4932ffa 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -287,8 +287,9 @@ static int tone_queue(struct ofono_voicecall *vc, const char *tone_str,
*/
for (i = 0; tone_str[i]; i++)
if (!g_ascii_isdigit(tone_str[i]) && tone_str[i] != 'p' &&
- tone_str[i] != '*' && tone_str[i] != '#' &&
- (tone_str[i] < 'A' || tone_str[i] > 'D'))
+ tone_str[i] != 'P' && tone_str[i] != '*' &&
+ tone_str[i] != '#' && (tone_str[i] < 'A' ||
+ tone_str[i] > 'D'))
return -EINVAL;
while ((entry = g_queue_peek_nth(vc->toneq, n++)) != NULL)
--
1.7.4.1
11 years, 6 months
[PATCH v2 0/9] HSP profile implementation
by Frédéric Dalleau
This patch will start providing an HSP profile implementation
in oFono. This is work in progress, and based of what was done for
HFP profile. Finally added the audio connection, that will provide
a base for discussion. To avoid emulator depend upon btio, there is
a callback fom the emulator to the hsp plugin to connect audio,
Some question remains :
* How should pulse audio be notified?
* What is the behavior of hsp when receiving CKPD=200?
Next step will be to dial/hangup a call.
Frédéric Dalleau (9):
bluetooth: add functions for sco connection
emulator: add hsp emulator type
hsp_ag: add hsp atom type
hsp_ag: Initial plugin commit
hsp_ag: add modem watch
emulator: add CKPD support
emulator: add audio connection API
emulator: implement audio connection API
hsp_ag: add audio connection support
Makefile.am | 3 +
include/emulator.h | 8 ++
plugins/bluetooth.c | 122 +++++++++++++++++++++++++++++++
plugins/bluetooth.h | 7 ++
plugins/hsp_ag.c | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++
src/emulator.c | 50 +++++++++++++
src/ofono.h | 1 +
7 files changed, 391 insertions(+), 0 deletions(-)
create mode 100644 plugins/hsp_ag.c
11 years, 6 months
[RESEND 3 PATCH 00/13] IPv6 Support
by Mika Liljeberg
Hi All,
Patches rebased to current master.
Regards,
MikaL
"IPv6 host walked into a bar. No-one would talk to it."
[RESEND 3 PATCH 01/13] gprs: factor out common code
[RESEND 3 PATCH 02/13] gprs: Update documentation for IPv6
[RESEND 3 PATCH 03/13] gprs: driver interface changes for IPv6
[RESEND 3 PATCH 04/13] gprs: core support for IPv6
[RESEND 3 PATCH 05/13] test: modify test scripts for IPv6
[RESEND 3 PATCH 06/13] isimodem: IPv6 support
[RESEND 3 PATCH 07/13] atmodem: update to new gprs context interface
[RESEND 3 PATCH 08/13] huaweimodem: update to new gprs context interface
[RESEND 3 PATCH 09/13] mbmmodem: update to new gprs context interface
[RESEND 3 PATCH 10/13] hsomodem: update to new gprs context interface
[RESEND 3 PATCH 11/13] ifxmodem: update to new gprs context interface
[RESEND 3 PATCH 12/13] stemodem: update to new gprs context interface
[RESEND 3 PATCH 13/13] phonesim: add IPv6 support
Makefile.am | 3 +-
doc/connman-api.txt | 9 +-
drivers/atmodem/gprs-context.c | 41 ++--
drivers/hsomodem/gprs-context.c | 48 +++--
drivers/huaweimodem/gprs-context.c | 43 +++--
drivers/ifxmodem/gprs-context.c | 36 ++--
drivers/isimodem/gprs-context.c | 119 +++++++-----
drivers/mbmmodem/gprs-context.c | 65 ++++---
drivers/stemodem/gprs-context.c | 30 ++-
include/gprs-context.h | 27 ++-
plugins/phonesim.c | 32 +++-
src/gprs.c | 390 ++++++++++++++++++++++++------------
test/set-context-property | 38 ++++
13 files changed, 580 insertions(+), 301 deletions(-)
11 years, 6 months
[PATCH v2 0/8] sms: Cancel pending message
by Lucas De Marchi
In this version I fixed some issues pointed out by Andrzej and added another
patch, not so related, but that would conflict with these ones if applied to
current master branch. Difference from previous version:
Tested with phonesim, slightly changing its plugin in oFono in order to hold
messages for a certain period.
Lucas De Marchi (8):
history: add cancelled status
examples: handle cancelled history status
message: add cancelled state
sms: factor out 'remove entry' from tx_finished()
sms: allow message submission to be cancelled
doc: add CancelMessage to MessageManager
TODO: mark task 'cancel pending SMS' as done
sms: remove check for impossible NULL condition
TODO | 9 --
doc/messagemanager-api.txt | 12 +++
examples/history.c | 5 +
include/history.h | 1 +
src/message.c | 2 +
src/message.h | 3 +-
src/sms.c | 196 +++++++++++++++++++++++++++++++++----------
7 files changed, 172 insertions(+), 56 deletions(-)
--
1.7.4
11 years, 6 months