[PATCH] doc: add hfp-overview.txt
by Frédéric Danis
---
doc/hfp-overview.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
create mode 100644 doc/hfp-overview.txt
diff --git a/doc/hfp-overview.txt b/doc/hfp-overview.txt
new file mode 100644
index 0000000..3ca1213
--- /dev/null
+++ b/doc/hfp-overview.txt
@@ -0,0 +1,49 @@
+HandsFree Profile Audio Gateway diagram
+=======================================
+
+This diagram explains how oFono manages HFP AG.
+
+AT commands and unsolicited results are managed in their related atom (eg. ATA
+is managed in voicecall atom).
+The emulator atom is managing AT commands or unsolicited results that are not
+falling into a specific atom.
+
+1) HFP AG plugin registers a HFP AG server as soon as a voicecall atom exist.
+2) When a connection occurs on this server, HFP AG plugin creates and registers
+ an emulator atom.
+3) Emulator atom will start a GAtServer and registers non-atom-specific
+ AT commands to it.
+4) On emulator atom registration, voice call related atoms (voicecall, network
+ and sim) register AT callbacks they managed through emulator atom.
+
+
+*===========* *-----------------*
+| | Register | |
+| BlueZ |<---------------| HFP AG plugin |
+| | SDP record | |
+*===========* *-----------------*
+ |
+ | Start emulator on connection
+ |
+ V
+ *-----------------*
+ | |
+ *-------->| Emulator Atom |
+ | | |
+ | *-----------------*
+ | |
+ Register | | Register AT commands
+ AT | V
+ callbacks | *-----------------*
+ | | |
+ | | GAtServer |
+ | | |
+ | *-----------------*
+ |
+ *---------------------*-------------------*
+ | | |
+ *----------------* *--------------* *-------------*
+ | | | | | |
+ | Voicecall atom | | Network atom | | SIM atom |
+ | | | | | |
+ *----------------* *--------------* *-------------*
--
1.7.1
9 years, 7 months
[PATCH 0/5] Add support of remote hangup
by Nicolas Bertrand
These patchs introduce the possibility of remote hangup
by selecting the call in the call table and use the new
button "hangup".
Nicolas Bertrand (5):
controlbase: Add hangup button
callmanager: Remote hangup slot
hardwaremanipulator: add hangup signal
control: Handle hangup call
phonesim: Connect hangup signal
src/callmanager.cpp | 23 +++++++++++++++++++++++
src/callmanager.h | 3 +++
src/control.cpp | 24 +++++++++++++++++++++++-
src/control.h | 2 ++
src/controlbase.ui | 7 +++++++
src/hardwaremanipulator.h | 1 +
src/phonesim.cpp | 2 ++
7 files changed, 61 insertions(+), 1 deletions(-)
9 years, 7 months
[PATCH 1/7] sms: remove set but not used var
by Gustavo F. Padovan
---
src/sms.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/src/sms.c b/src/sms.c
index 2940762..323c5ad 100644
--- a/src/sms.c
+++ b/src/sms.c
@@ -754,9 +754,6 @@ static gboolean tx_next(gpointer user_data)
int send_mms = 0;
struct tx_queue_entry *entry = g_queue_peek_head(sms->txq);
struct pending_pdu *pdu = &entry->pdus[entry->cur_pdu];
- struct ofono_error error;
-
- error.type = OFONO_ERROR_TYPE_NO_ERROR;
DBG("tx_next: %p", entry);
--
1.7.5.1
9 years, 8 months
[PATCH] emulator: fix dun_ath_cb() not to remove GAtServer io_disconnect() CB
by Guillaume Zajac
---
src/emulator.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
index c17b901..251bed8 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -219,15 +219,19 @@ static void dun_ath_cb(GAtServer *server, GAtServerRequestType type,
if (val != 0)
goto error;
+ g_at_server_suspend(em->server);
g_at_ppp_unref(em->ppp);
em->ppp = NULL;
+ g_at_server_resume(em->server);
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
break;
case G_AT_SERVER_REQUEST_TYPE_COMMAND_ONLY:
+ g_at_server_suspend(em->server);
g_at_ppp_unref(em->ppp);
em->ppp = NULL;
+ g_at_server_resume(em->server);
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
break;
--
1.7.1
9 years, 8 months
[PATCH] voicecall: add +VTS support for HFP emulator
by Frédéric Dalleau
---
src/voicecall.c | 43 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/src/voicecall.c b/src/voicecall.c
index d46f463..846c1c4 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2421,6 +2421,10 @@ static void emulator_hfp_unregister(struct ofono_atom *atom)
OFONO_ATOM_TYPE_EMULATOR_HFP,
emulator_remove_handler,
"+CHLD");
+ __ofono_modem_foreach_registered_atom(modem,
+ OFONO_ATOM_TYPE_EMULATOR_HFP,
+ emulator_remove_handler,
+ "+VTS");
__ofono_modem_remove_atom_watch(modem, vc->hfp_watch);
}
@@ -2866,6 +2870,44 @@ fail:
ofono_emulator_send_final(em, &result);
}
+static void vts_tone_cb(int error, void *data)
+{
+ struct ofono_emulator *em = data;
+ struct ofono_error result;
+
+ result.error = 0;
+ result.type = error ? OFONO_ERROR_TYPE_FAILURE :
+ OFONO_ERROR_TYPE_NO_ERROR;
+
+ ofono_emulator_send_final(em, &result);
+}
+
+static void emulator_vts_cb(struct ofono_emulator *em,
+ struct ofono_emulator_request *req, void *userdata)
+{
+ struct ofono_voicecall *vc = userdata;
+ struct ofono_error result;
+ const char *str;
+
+ switch (ofono_emulator_request_get_type(req)) {
+ case OFONO_EMULATOR_REQUEST_TYPE_SET:
+ str = ofono_emulator_request_get_raw(req);
+
+ if (__ofono_voicecall_tone_send(vc, str, vts_tone_cb, em) < 0)
+ break;
+
+ return;
+
+ default:
+ break;
+ }
+
+ result.error = 0;
+ 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)
@@ -2881,6 +2923,7 @@ static void emulator_hfp_watch(struct ofono_atom *atom,
ofono_emulator_add_handler(em, "+CHUP", emulator_chup_cb, data, NULL);
ofono_emulator_add_handler(em, "+CLCC", emulator_clcc_cb, data, NULL);
ofono_emulator_add_handler(em, "+CHLD", emulator_chld_cb, data, NULL);
+ ofono_emulator_add_handler(em, "+VTS", emulator_vts_cb, data, NULL);
}
void ofono_voicecall_register(struct ofono_voicecall *vc)
--
1.7.1
9 years, 8 months
[PATCH 0/4] Add dial support for HFP emulator
by Frédéric Danis
Create a generic dial function that can be called by DBus or emulator
Add support of ATD and AT+BLDN
Save last dialed number in /var/lib/ofono/<modem>/voicecall to be used
by AT+BLDN
Frédéric Danis (4):
voicecall: create generic dial function
voicecall: add ATD support for HFP emulator
voicecall: save last dialed number
voicecall: add +BLDN support for HFP emulator
src/voicecall.c | 274 +++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 247 insertions(+), 27 deletions(-)
9 years, 8 months
Emulator not unregistered while sending ATH0
by Guillaume Zajac
Hi Denis,
I noticed that when I send +++ -> ATH0 during a PPP session the ppp
server is well unregistered.
However when the physical layer is removed (bluetooht or TCP), the
associated emulator is not unregistered.
As we used in gatutil.c set_close_on_unref(TRUE), it means there is
still on reference on the GIOChannel.
In the case the PPP session is ended normally, we call
ppp_ipcp_down_notify() to free the ppp_net interface.
Then the physical layer is removed and we got the emulator well
unregistered.
Do you have any idea about what is happening there?
Maybe I forgot to do something into dun_ath_cb().
Kind regards,
Guillaume
9 years, 8 months
[PATCH] isimodem: Improper handling of missed call
by Arun Ravindran
---
drivers/isimodem/voicecall.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 333f9b8..6979105 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -50,6 +50,7 @@ struct isi_call {
uint8_t id;
uint8_t call_id;
uint8_t status;
+ uint8_t prev_status;
uint8_t mode;
uint8_t mode_info;
uint8_t cause_type;
@@ -314,7 +315,7 @@ static void isi_call_status_sb_proc(struct isi_voicecall *ivc,
if (!g_isi_sb_iter_get_byte(sb, &status, 2))
return;
-
+ call->prev_status = call->status;
call->status = status;
}
@@ -401,10 +402,16 @@ static int isi_call_status_to_clcc(const struct isi_call *call)
return 5;
case CALL_STATUS_MO_RELEASE:
- case CALL_STATUS_MT_RELEASE:
- case CALL_STATUS_TERMINATED:
return 6;
+ case CALL_STATUS_MT_RELEASE:
+ if ((call->prev_status == CALL_STATUS_MT_ALERTING) ||
+ (call->prev_status == CALL_STATUS_COMING) ||
+ (call->prev_status == CALL_STATUS_WAITING))
+ return 4;
+ else
+ return 6;
+
case CALL_STATUS_ACTIVE:
case CALL_STATUS_HOLD_INITIATED:
return 0;
@@ -548,9 +555,14 @@ static void isi_call_notify(struct ofono_voicecall *ovc, struct isi_call *call)
case CALL_STATUS_MO_RELEASE:
case CALL_STATUS_MT_RELEASE:
+ isi_call_set_disconect_reason(call):
+ break;
+
case CALL_STATUS_TERMINATED:
isi_call_set_disconnect_reason(call);
- break;
+ DBG("State( CALL_STATUS_TERMINATED ) need not be reported to Core");
+ return;
+
case CALL_STATUS_ANSWERED:
DBG("State need not be reported to Core");
return;
--
1.7.1
9 years, 8 months
[PATCH_v6 0/5] *** SUBJECT HERE ***
by Guillaume Zajac
*** BLURB HERE ***
Guillaume Zajac (5):
gatppp: Add new contructor to use external fd
private-network: add header into include and Makefile.am
private-network: add request/release functions and new feature to
Makefile.am
emulator: add request/release private network calls
connman: add plugin in oFono to request/release private network
Makefile.am | 10 +-
gatchat/gatppp.c | 33 +++++-
gatchat/gatppp.h | 1 +
gatchat/ppp.h | 2 +-
gatchat/ppp_net.c | 47 +++++---
include/private-network.h | 56 +++++++++
plugins/connman.c | 299 +++++++++++++++++++++++++++++++++++++++++++++
src/emulator.c | 75 ++++++++++--
src/ofono.h | 6 +
src/private-network.c | 91 ++++++++++++++
10 files changed, 590 insertions(+), 30 deletions(-)
create mode 100644 include/private-network.h
create mode 100644 plugins/connman.c
create mode 100644 src/private-network.c
9 years, 8 months
[PATCH v3 1/7] stk: Clear 'respond_on_exit' flag after sending the terminal response
by Philippe Nunes
---
src/stk.c | 27 ++-------------------------
1 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index c86cbfb..8214b65 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -128,6 +128,7 @@ static int stk_respond(struct ofono_stk *stk, struct stk_response *rsp,
stk_command_free(stk->pending_cmd);
stk->pending_cmd = NULL;
stk->cancel_cmd = NULL;
+ stk->respond_on_exit = FALSE;
stk->driver->terminal_response(stk, tlv_len, tlv, cb, stk);
@@ -477,10 +478,8 @@ static void user_termination_cb(enum stk_agent_result result, void *user_data)
{
struct ofono_stk *stk = user_data;
- if (result == STK_AGENT_RESULT_TERMINATE) {
- stk->respond_on_exit = FALSE;
+ if (result == STK_AGENT_RESULT_TERMINATE)
send_simple_response(stk, STK_RESULT_TYPE_USER_TERMINATED);
- }
}
static void stk_alpha_id_set(struct ofono_stk *stk,
@@ -598,7 +597,6 @@ static void default_agent_notify(gpointer user_data)
stk->default_agent = NULL;
stk->current_agent = stk->session_agent;
- stk->respond_on_exit = FALSE;
}
static void session_agent_notify(gpointer user_data)
@@ -617,7 +615,6 @@ static void session_agent_notify(gpointer user_data)
stk->session_agent = NULL;
stk->current_agent = stk->default_agent;
- stk->respond_on_exit = FALSE;
if (stk->remove_agent_source) {
g_source_remove(stk->remove_agent_source);
@@ -1159,8 +1156,6 @@ static void request_selection_cb(enum stk_agent_result result, uint8_t id,
{
struct ofono_stk *stk = user_data;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
{
@@ -1243,8 +1238,6 @@ static void display_text_cb(enum stk_agent_result result, void *user_data)
static unsigned char screen_busy_result[] = { 0x01 };
static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
- stk->respond_on_exit = FALSE;
-
/*
* There are four possible paths for DisplayText with immediate
* response flag set:
@@ -1386,8 +1379,6 @@ static void request_confirmation_cb(enum stk_agent_result result,
struct stk_command_get_inkey *cmd = &stk->pending_cmd->get_inkey;
struct stk_response rsp;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
memset(&rsp, 0, sizeof(rsp));
@@ -1442,8 +1433,6 @@ static void request_key_cb(enum stk_agent_result result, char *string,
struct stk_command_get_inkey *cmd = &stk->pending_cmd->get_inkey;
struct stk_response rsp;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
memset(&rsp, 0, sizeof(rsp));
@@ -1560,8 +1549,6 @@ static void request_string_cb(enum stk_agent_result result, char *string,
gboolean packed = (qualifier & (1 << 3)) != 0;
struct stk_response rsp;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
memset(&rsp, 0, sizeof(rsp));
@@ -1699,8 +1686,6 @@ static void confirm_call_cb(enum stk_agent_result result, gboolean confirm,
struct stk_response rsp;
int err;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_TIMEOUT:
confirm = FALSE;
@@ -2283,8 +2268,6 @@ static void send_dtmf_cancel(struct ofono_stk *stk)
struct ofono_voicecall *vc = NULL;
struct ofono_atom *vc_atom;
- stk->respond_on_exit = FALSE;
-
vc_atom = __ofono_modem_find_atom(__ofono_atom_get_modem(stk->atom),
OFONO_ATOM_TYPE_VOICECALL);
if (vc_atom)
@@ -2300,8 +2283,6 @@ static void dtmf_sent_cb(int error, void *user_data)
{
struct ofono_stk *stk = user_data;
- stk->respond_on_exit = FALSE;
-
stk_alpha_id_unset(stk);
if (error == ENOENT) {
@@ -2413,8 +2394,6 @@ static void play_tone_cb(enum stk_agent_result result, void *user_data)
{
struct ofono_stk *stk = user_data;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_OK:
case STK_AGENT_RESULT_TIMEOUT:
@@ -2547,8 +2526,6 @@ static void confirm_launch_browser_cb(enum stk_agent_result result,
struct ofono_error failure = { .type = OFONO_ERROR_TYPE_FAILURE };
struct stk_response rsp;
- stk->respond_on_exit = FALSE;
-
switch (result) {
case STK_AGENT_RESULT_TIMEOUT:
confirm = FALSE;
--
1.7.1
9 years, 8 months