[PATCH 2/3] Add multiparty call support for HFP voicecall driver

Zhenhua Zhang zhenhua.zhang at intel.com
Fri Nov 6 23:26:12 PST 2009


This feature is to enable CHLD=2x, 3 and 4 for multiparty call.
---
 drivers/hfpmodem/voicecall.c |   37
++++++++++++++++++++++++++++++++++---
 1 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/drivers/hfpmodem/voicecall.c b/drivers/hfpmodem/voicecall.c
index 43b4c01..fabcd6d 100644
--- a/drivers/hfpmodem/voicecall.c
+++ b/drivers/hfpmodem/voicecall.c
@@ -613,6 +613,37 @@ static void hfp_release_specific(struct
ofono_voicecall *vc, int id,
 					swap_hold_cb, req, NULL);
 }
 
+static void hfp_private_chat(struct ofono_voicecall *vc, int id,
+				ofono_voicecall_cb_t cb, void *data)
+{
+	char buf[32];
+
+	sprintf(buf, "AT+CHLD=2%d", id);
+
+	if (check_mpty_feature(vc, AG_CHLD_2x, cb, data))
+		hfp_template(buf, vc, generic_cb, 0, cb, data);
+}
+
+static void hfp_create_multiparty(struct ofono_voicecall *vc,
+					ofono_voicecall_cb_t cb, void *data)
+{
+	if (check_mpty_feature(vc, AG_CHLD_3, cb, data))
+		hfp_template("AT+CHLD=3", vc, generic_cb, 0, cb, data);
+}
+
+static void hfp_transfer(struct ofono_voicecall *vc,
+			ofono_voicecall_cb_t cb, void *data)
+{
+	/* Transfer can puts held & active calls together and disconnects
+	 * from both.  However, some networks support transfering of
+	 * dialing/ringing calls as well.
+	 */
+	unsigned int transfer = 0x1 | 0x2 | 0x4 | 0x8;
+
+	if (check_mpty_feature(vc, AG_CHLD_4, cb, data))
+		hfp_template("AT+CHLD=4", vc, generic_cb, transfer, cb, data);
+}
+
 static void ring_notify(GAtResult *result, gpointer user_data)
 {
 	struct ofono_voicecall *vc = user_data;
@@ -1014,9 +1045,9 @@ static struct ofono_voicecall_driver driver = {
 	.set_udub		= hfp_set_udub,
 	.release_all_active	= hfp_release_all_active,
 	.release_specific	= hfp_release_specific,
-	.private_chat		= NULL,
-	.create_multiparty	= NULL,
-	.transfer		= NULL,
+	.private_chat		= hfp_private_chat,
+	.create_multiparty	= hfp_create_multiparty,
+	.transfer		= hfp_transfer,
 	.deflect		= NULL,
 	.swap_without_accept	= NULL,
 	.send_tones		= NULL
-- 
1.6.2.5





More information about the ofono mailing list