Open Source Telephony
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau <frederic.dalleau@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 3/7] voicecall: add +CHLD=0 support for HFP emulator
Date: Mon, 02 May 2011 17:48:04 +0200	[thread overview]
Message-ID: <1304351288-3894-4-git-send-email-frederic.dalleau@linux.intel.com> (raw)
In-Reply-To: <1304351288-3894-1-git-send-email-frederic.dalleau@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

---
 src/voicecall.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index 3507f33..9225de9 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2758,6 +2758,22 @@ static void emulator_chld_cb(struct ofono_emulator *em,
 			goto fail;
 
 		switch (chld) {
+		case 0:
+			if (vc->driver->set_udub == NULL)
+				goto fail;
+
+			if (vc->driver->release_all_held == NULL)
+				goto fail;
+
+			if (voicecalls_have_waiting(vc)) {
+				vc->driver->set_udub(vc,
+						emulator_generic_cb, em);
+				return;
+			}
+
+			vc->driver->release_all_held(vc,
+					emulator_generic_cb, em);
+			return;
 		case 1:
 			if (vc->driver->release_all_active == NULL)
 				goto fail;
@@ -2781,8 +2797,15 @@ static void emulator_chld_cb(struct ofono_emulator *em,
 		memcpy(buf, "+CHLD=", 6);
 		info = buf + 6;
 
-		if (vc->driver->release_all_active)
+		if (vc->driver->release_all_held && vc->driver->set_udub)
+			*info++ = '0';
+
+		if (vc->driver->release_all_active) {
+			if (info - buf > 6)
+				*info++ = ',';
+
 			*info++ = '1';
+		}
 
 		if (vc->driver->hold_all_active) {
 			if (info - buf > 6)
-- 
1.7.1


  parent reply	other threads:[~2011-05-02 15:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 15:48 [PATCH 0/7] Add CHLD support to HFP profile =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-02 15:48 ` [PATCH 1/7] voicecall: Fix variable initialization =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-02 15:48 ` [PATCH 2/7] voicecall: add +CHLD support for HFP emulator =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-02 15:48 ` =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau [this message]
2011-05-02 15:48 ` [PATCH 4/7] voicecall: add +CHLD=3 " =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-02 15:48 ` [PATCH 5/7] voicecall: add +CHLD=4 " =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-02 15:48 ` [PATCH 6/7] voicecall: add +CHLD=1X " =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-02 15:48 ` [PATCH 7/7] voicecall: add +CHLD=2X " =?unknown-8bit?q?Fr=C3=A9d=C3=A9ric?= Dalleau
2011-05-05  3:37 ` [PATCH 0/7] Add CHLD support to HFP profile Denis Kenzior

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=1304351288-3894-4-git-send-email-frederic.dalleau@linux.intel.com \
    --to=frederic.dalleau@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