From: Peter Zotov <whitequark@whitequark.ru>
To: linux-bluetooth@vger.kernel.org
Subject: Re: Handset voice dial signalling patch
Date: Thu, 14 Jan 2010 00:26:48 +0300 [thread overview]
Message-ID: <4B4E3A98.8000605@whitequark.ru> (raw)
In-Reply-To: <20100113092620.GA20024@jh-x301>
[-- Attachment #1: Type: text/plain, Size: 529 bytes --]
Johan Hedberg wrote:
>> + gboolean voice_dial;
>> + gboolean voice_dial_req;
>
> I'm not so sure that it'll be useful to have this state info in
> headset.c. I suspect for the most part voice recognition will be a
> platform specific issue that can be taken care of by the telephony
> driver. So I'd leave out these new variables for now and add them later
> if it turns out that there's actually some use for them in headset.c.
>
> After this change I think the patch could be pushed upstream.
Fixed.
--
WBR, Peter Zotov
[-- Attachment #2: bluez-4.60-voice_dial-v3.patch --]
[-- Type: text/x-patch, Size: 5110 bytes --]
diff -ur bluez-4.60.old/audio/headset.c bluez-4.60.new/audio/headset.c
--- bluez-4.60.old/audio/headset.c 2010-01-09 23:52:17.000000000 +0300
+++ bluez-4.60.new/audio/headset.c 2010-01-14 00:15:06.000000000 +0300
@@ -1084,6 +1084,11 @@
return telephony_generic_rsp(telephony_device, err);
}
+int telephony_voice_dial_rsp(void *telephony_device, cme_error_t err)
+{
+ return telephony_generic_rsp(telephony_device, err);
+}
+
int telephony_operator_selection_ind(int mode, const char *oper)
{
if (!active_devices)
@@ -1132,6 +1137,22 @@
return 0;
}
+static int voice_dial(struct audio_device *device, const char *buf)
+{
+ if (strlen(buf) < 9)
+ return -EINVAL;
+
+ gboolean start_dialing;
+ if (buf[8] == '0')
+ start_dialing = FALSE;
+ else
+ start_dialing = TRUE;
+
+ telephony_voice_dial_req(device, start_dialing);
+
+ return 0;
+}
+
static struct event event_callbacks[] = {
{ "ATA", answer_call },
{ "ATD", dial_number },
@@ -1152,6 +1173,7 @@
{ "AT+CCWA", call_waiting_notify },
{ "AT+COPS", operator_selection },
{ "AT+NREC", nr_and_ec },
+ { "AT+BVRA", voice_dial },
{ 0 }
};
diff -ur bluez-4.60.old/audio/telephony-dummy.c bluez-4.60.new/audio/telephony-dummy.c
--- bluez-4.60.old/audio/telephony-dummy.c 2010-01-09 23:52:17.000000000 +0300
+++ bluez-4.60.new/audio/telephony-dummy.c 2010-01-13 06:17:44.000000000 +0300
@@ -36,6 +36,8 @@
#include "logging.h"
#include "telephony.h"
+static DBusConnection *connection = NULL;
+
static const char *chld_str = "0,1,1x,2,2x,3,4";
static char *subscriber_number = NULL;
static char *active_call_number = NULL;
@@ -205,6 +207,18 @@
telephony_nr_and_ec_rsp(telephony_device, CME_ERROR_NONE);
}
+void telephony_voice_dial_req(void *telephony_device, gboolean enable)
+{
+ debug("telephony-dummy: got %s voice dial request",
+ enable ? "enable" : "disable");
+
+ g_dbus_emit_signal(connection, "/org/bluez/test",
+ "org.bluez.TelephonyTest", "VoiceDial",
+ DBUS_TYPE_INVALID);
+
+ telephony_voice_dial_rsp(telephony_device, CME_ERROR_NOT_SUPPORTED);
+}
+
void telephony_key_press_req(void *telephony_device, const char *keys)
{
debug("telephony-dummy: got key press request for %s", keys);
@@ -389,7 +403,10 @@
{ }
};
-static DBusConnection *connection = NULL;
+static GDBusSignalTable dummy_signals[] = {
+ { "VoiceDial", "" },
+ { }
+};
int telephony_init(void)
{
@@ -401,7 +418,7 @@
g_dbus_register_interface(connection, "/org/bluez/test",
"org.bluez.TelephonyTest",
- dummy_methods, NULL,
+ dummy_methods, dummy_signals,
NULL, NULL, NULL);
telephony_ready_ind(features, dummy_indicators, response_and_hold,
diff -ur bluez-4.60.old/audio/telephony.h bluez-4.60.new/audio/telephony.h
--- bluez-4.60.old/audio/telephony.h 2010-01-09 23:52:17.000000000 +0300
+++ bluez-4.60.new/audio/telephony.h 2010-01-13 05:48:54.000000000 +0300
@@ -155,6 +155,7 @@
void telephony_operator_selection_req(void *telephony_device);
void telephony_call_hold_req(void *telephony_device, const char *cmd);
void telephony_nr_and_ec_req(void *telephony_device, gboolean enable);
+void telephony_voice_dial_req(void *telephony_device, gboolean enable);
void telephony_key_press_req(void *telephony_device, const char *keys);
/* AG responses to HF requests. These are implemented by headset.c */
@@ -170,6 +171,7 @@
int telephony_operator_selection_rsp(void *telephony_device, cme_error_t err);
int telephony_call_hold_rsp(void *telephony_device, cme_error_t err);
int telephony_nr_and_ec_rsp(void *telephony_device, cme_error_t err);
+int telephony_voice_dial_rsp(void *telephony_device, cme_error_t err);
int telephony_key_press_rsp(void *telephony_device, cme_error_t err);
/* Event indications by AG. These are implemented by headset.c */
diff -ur bluez-4.60.old/audio/telephony-maemo.c bluez-4.60.new/audio/telephony-maemo.c
--- bluez-4.60.old/audio/telephony-maemo.c 2010-01-09 23:52:17.000000000 +0300
+++ bluez-4.60.new/audio/telephony-maemo.c 2010-01-13 11:59:52.000000000 +0300
@@ -887,6 +887,14 @@
telephony_key_press_rsp(telephony_device, CME_ERROR_NONE);
}
+void telephony_voice_dial_req(void *telephony_device, gboolean enable)
+{
+ debug("telephony-maemo: got %s voice dial request",
+ enable ? "enable" : "disable");
+
+ telephony_voice_dial_rsp(telephony_device, CME_ERROR_NOT_SUPPORTED);
+}
+
static void handle_incoming_call(DBusMessage *msg)
{
const char *number, *call_path;
diff -ur bluez-4.60.old/audio/telephony-ofono.c bluez-4.60.new/audio/telephony-ofono.c
--- bluez-4.60.old/audio/telephony-ofono.c 2010-01-09 23:52:17.000000000 +0300
+++ bluez-4.60.new/audio/telephony-ofono.c 2010-01-13 12:00:21.000000000 +0300
@@ -387,6 +387,14 @@
telephony_key_press_rsp(telephony_device, CME_ERROR_NONE);
}
+void telephony_voice_dial_req(void *telephony_device, gboolean enable)
+{
+ debug("telephony-ofono: got %s voice dial request",
+ enable ? "enable" : "disable");
+
+ telephony_voice_dial_rsp(telephony_device, CME_ERROR_NOT_SUPPORTED);
+}
+
static gboolean iter_get_basic_args(DBusMessageIter *iter,
int first_arg_type, ...)
{
next prev parent reply other threads:[~2010-01-13 21:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-13 7:36 Handset voice dial signalling patch Peter Zotov
2010-01-13 8:32 ` Johan Hedberg
2010-01-13 9:03 ` Peter Zotov
2010-01-13 9:26 ` Johan Hedberg
2010-01-13 21:26 ` Peter Zotov [this message]
2010-01-14 14:41 ` Johan Hedberg
2010-01-14 21:26 ` Peter Zotov
2010-01-15 6:57 ` Johan Hedberg
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=4B4E3A98.8000605@whitequark.ru \
--to=whitequark@whitequark.ru \
--cc=linux-bluetooth@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.