[PATCH BlueZ v2] Replace SendDTMF by StartDTMF/StopDTMF in maemo6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SendDTMF method call is replaced by StartDTMF/StopDTMF in maemo6 telephony
driver. StartDTMF/StopDTMF places DTMF tone in queue on modem side playing
it minimum required time. When using SendDTMF, modem ignores new tone
until currently playing one is not finished.

Downside of StartDTMF/StopDTMF combination is absence of audio feedback to
hands-free.
---
 audio/telephony-maemo6.c |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index a5845c4..ad5d06f 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -732,17 +732,26 @@ void telephony_dial_number_req(void *telephony_device, const char *number)
 						CME_ERROR_AG_FAILURE);
 }
 
-void telephony_transmit_dtmf_req(void *telephony_device, char tone)
+static void start_dtmf_reply(DBusPendingCall *call, void *user_data)
 {
-	int ret;
-	char buf[2] = { tone, '\0' }, *buf_ptr = buf;
+	send_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH,
+				CSD_CALL_INTERFACE, "StopDTMF",
+				NULL, NULL,
+				DBUS_TYPE_INVALID);
+}
 
-	DBG("telephony-maemo6: transmit dtmf: %s", buf);
+static void start_dtmf(void *telephony_device, char tone)
+{
+	int ret;
 
+	/*
+	 * Stop tone immediately, modem will place it in queue and play
+	 * required time.
+	 */
 	ret = send_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH,
-				CSD_CALL_INTERFACE, "SendDTMF",
-				NULL, NULL,
-				DBUS_TYPE_STRING, &buf_ptr,
+				CSD_CALL_INTERFACE, "StartDTMF",
+				start_dtmf_reply, NULL,
+				DBUS_TYPE_BYTE, &tone,
 				DBUS_TYPE_INVALID);
 	if (ret < 0) {
 		telephony_transmit_dtmf_rsp(telephony_device,
@@ -753,6 +762,13 @@ void telephony_transmit_dtmf_req(void *telephony_device, char tone)
 	telephony_transmit_dtmf_rsp(telephony_device, CME_ERROR_NONE);
 }
 
+void telephony_transmit_dtmf_req(void *telephony_device, char tone)
+{
+	DBG("telephony-maemo6: transmit dtmf: %c", tone);
+
+	start_dtmf(telephony_device, tone);
+}
+
 void telephony_subscriber_number_req(void *telephony_device)
 {
 	DBG("telephony-maemo6: subscriber number request");
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux