From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis <frederic.danis@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH V3 4/4] voicecall: add +BLDN support for HFP emulator
Date: Wed, 01 Jun 2011 13:24:23 +0200 [thread overview]
Message-ID: <1306927463-10642-5-git-send-email-frederic.danis@linux.intel.com> (raw)
In-Reply-To: <1306927463-10642-1-git-send-email-frederic.danis@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]
---
src/voicecall.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/src/voicecall.c b/src/voicecall.c
index f176e25..c4a15a2 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2474,6 +2474,10 @@ static void emulator_hfp_unregister(struct ofono_atom *atom)
OFONO_ATOM_TYPE_EMULATOR_HFP,
emulator_remove_handler,
"D");
+ __ofono_modem_foreach_registered_atom(modem,
+ OFONO_ATOM_TYPE_EMULATOR_HFP,
+ emulator_remove_handler,
+ "+BLDN");
__ofono_modem_remove_atom_watch(modem, vc->hfp_watch);
}
@@ -3094,6 +3098,35 @@ fail:
};
}
+static void emulator_bldn_cb(struct ofono_emulator *em,
+ struct ofono_emulator_request *req, void *userdata)
+{
+ struct ofono_voicecall *vc = userdata;
+ const char *number;
+ struct ofono_error result;
+ GError *error = NULL;
+
+ switch (ofono_emulator_request_get_type(req)) {
+ case OFONO_EMULATOR_REQUEST_TYPE_COMMAND_ONLY:
+ if (vc->settings == NULL)
+ goto fail;
+
+ number = g_key_file_get_string(vc->settings, SETTINGS_GROUP,
+ "Number", &error);
+ if (number == NULL || number[0] == '\0')
+ goto fail;
+
+ emulator_dial(em, vc, number);
+ break;
+
+ default:
+fail:
+ 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)
@@ -3111,6 +3144,7 @@ static void emulator_hfp_watch(struct ofono_atom *atom,
ofono_emulator_add_handler(em, "+CHLD", emulator_chld_cb, data, NULL);
ofono_emulator_add_handler(em, "+VTS", emulator_vts_cb, data, NULL);
ofono_emulator_add_handler(em, "D", emulator_atd_cb, data, NULL);
+ ofono_emulator_add_handler(em, "+BLDN", emulator_bldn_cb, data, NULL);
}
void ofono_voicecall_register(struct ofono_voicecall *vc)
--
1.7.1
prev parent reply other threads:[~2011-06-01 11:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 11:24 [PATCH V3 0/4] Add dial support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-06-01 11:24 ` [PATCH V3 1/4] voicecall: create generic dial function =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-06-02 1:27 ` Denis Kenzior
2011-06-01 11:24 ` [PATCH V3 2/4] voicecall: add ATD support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-06-02 2:08 ` Denis Kenzior
2011-06-07 12:58 ` Frederic Danis
2011-06-06 2:09 ` Denis Kenzior
2011-06-07 15:01 ` Frederic Danis
2011-06-01 11:24 ` [PATCH V3 3/4] voicecall: save last dialed number =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis
2011-06-02 1:28 ` Denis Kenzior
2011-06-01 11:24 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Danis [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1306927463-10642-5-git-send-email-frederic.danis@linux.intel.com \
--to=frederic.danis@linux.intel.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox