All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/19] Bluetooth HFP-specific extensions
@ 2011-10-12 12:35 Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 01/19] handsfree: Copyright statement correction Mikel Astiz
                   ` (18 more replies)
  0 siblings, 19 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

This patch series is a revision of the HFP extensions proposed before,
including some other minor extensions.

Mikel Astiz (19):
  handsfree: Copyright statement correction
  handsfree: Copyright statement correction
  hfpmodem: Copyright statement correction
  doc: Add initial Handsfree API documentation
  hfpmodem: Set initial state for inband ringing
  hfpmodem: Support for +BSIR unsol. result codes
  doc: Handsfree API support for +BINP=1
  handsfree: Expose RequestPhoneNumber in D-Bus API
  hfpmodem: Support of number requests (AT+BINP=1)
  handsfree: Removed ASYNC flag from GetProperties
  doc: Voice recognition function added in Handsfree
  include: Voice recognition in handsfree public api
  handsfree: Implement voice recognition function
  hfpmodem: Support for AT+BVRA
  doc: Handsfree exposes supported AG features
  include: AG features added to handsfree public api
  handsfree: Supported AG features exposed in D-Bus
  hfpmodem: Report features supported by AG
  hfp_hf: Switched to permissive AT syntax parser

 doc/handsfree-api.txt        |   65 +++++++++++++
 drivers/hfpmodem/handsfree.c |  133 +++++++++++++++++++++++++++
 include/handsfree.h          |   10 ++
 plugins/hfp_hf.c             |    2 +-
 src/handsfree.c              |  205 +++++++++++++++++++++++++++++++++++++++++-
 5 files changed, 412 insertions(+), 3 deletions(-)
 create mode 100644 doc/handsfree-api.txt

-- 
1.7.6.4


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v2 01/19] handsfree: Copyright statement correction
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:07   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 02/19] " Mikel Astiz
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 include/handsfree.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/handsfree.h b/include/handsfree.h
index 4f43fa7..d39d919 100644
--- a/include/handsfree.h
+++ b/include/handsfree.h
@@ -3,6 +3,7 @@
  *  oFono - Open Source Telephony
  *
  *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2011 BMW Car IT GmbH. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 02/19] handsfree: Copyright statement correction
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 01/19] handsfree: Copyright statement correction Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:07   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 03/19] hfpmodem: " Mikel Astiz
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 src/handsfree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/handsfree.c b/src/handsfree.c
index acc9745..ae5007e 100644
--- a/src/handsfree.c
+++ b/src/handsfree.c
@@ -3,6 +3,7 @@
  *  oFono - Open Source Telephony
  *
  *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2011 BMW Car IT GmbH. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 03/19] hfpmodem: Copyright statement correction
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 01/19] handsfree: Copyright statement correction Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 02/19] " Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:07   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 04/19] doc: Add initial Handsfree API documentation Mikel Astiz
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 drivers/hfpmodem/handsfree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index 752c43b..d3b5b44 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -3,6 +3,7 @@
  *  oFono - Open Source Telephony
  *
  *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2011 BMW Car IT GmbH. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 04/19] doc: Add initial Handsfree API documentation
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (2 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 03/19] hfpmodem: " Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:08   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 05/19] hfpmodem: Set initial state for inband ringing Mikel Astiz
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

These basic features have already been implemented.
---
 doc/handsfree-api.txt |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 doc/handsfree-api.txt

diff --git a/doc/handsfree-api.txt b/doc/handsfree-api.txt
new file mode 100644
index 0000000..4b2b156
--- /dev/null
+++ b/doc/handsfree-api.txt
@@ -0,0 +1,30 @@
+Handsfree hierarchy
+===================
+
+Service		org.ofono
+Interface	org.ofono.Handsfree
+Object path	[variable prefix]/{modem0,modem1,...}
+
+Methods		dict GetProperties()
+
+			Returns properties for the Handsfree Interface. See the
+			properties section for available properties.
+
+		void SetProperty(string property, variant value)
+
+			Changes the value of the specified property. Only
+			properties that are listed as readwrite are
+			changeable. On success a PropertyChanged signal
+			will be emitted.
+
+			Possible Errors: [service].Error.InProgress
+					 [service].Error.InvalidArguments
+
+Signals		PropertyChanged(string property, variant value)
+
+			Signal is emitted whenever a property has changed.
+			The new value is passed as the signal argument.
+
+Properties	boolean InbandRinging [readonly]
+
+			Boolean representing whether inband ringing is enabled.
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 05/19] hfpmodem: Set initial state for inband ringing
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (3 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 04/19] doc: Add initial Handsfree API documentation Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:09   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 06/19] hfpmodem: Support for +BSIR unsol. result codes Mikel Astiz
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

According to the HFP specification, inband ringing will be enabled by
default if the AG supports it. This setting could later be changed by
the unsolicited result code +BSIR.
---
 drivers/hfpmodem/handsfree.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index d3b5b44..12a23fc 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -44,6 +44,7 @@
 
 struct hf_data {
 	GAtChat *chat;
+	unsigned int ag_features;
 };
 
 static gboolean hfp_handsfree_register(gpointer user_data)
@@ -52,6 +53,9 @@ static gboolean hfp_handsfree_register(gpointer user_data)
 
 	ofono_handsfree_register(hf);
 
+	if (hd->ag_features & HFP_AG_FEATURE_IN_BAND_RING_TONE)
+		ofono_handsfree_set_inband_ringing(hf, TRUE);
+
 	return FALSE;
 }
 
@@ -64,6 +68,7 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
 	DBG("");
 	hd = g_new0(struct hf_data, 1);
 	hd->chat = g_at_chat_clone(info->chat);
+	hd->ag_features = info->ag_features;
 
 	ofono_handsfree_set_data(hf, hd);
 
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 06/19] hfpmodem: Support for +BSIR unsol. result codes
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (4 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 05/19] hfpmodem: Set initial state for inband ringing Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:14   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 07/19] doc: Handsfree API support for +BINP=1 Mikel Astiz
                   ` (12 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 drivers/hfpmodem/handsfree.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index 12a23fc..be6b83c 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -45,11 +45,28 @@
 struct hf_data {
 	GAtChat *chat;
 	unsigned int ag_features;
+	unsigned int vendor;
 };
 
+static void bsir_notify(GAtResult *result, gpointer user_data)
+{
+	struct ofono_handsfree *hf = user_data;
+	struct hf_data *hd = ofono_handsfree_get_data(hf);
+	int value;
+
+	if (at_util_parse_reg_unsolicited(result, "+BSIR:", &value,
+				NULL, NULL, NULL, hd->vendor) == FALSE)
+		return;
+
+	ofono_handsfree_set_inband_ringing(hf, (ofono_bool_t) value);
+}
+
 static gboolean hfp_handsfree_register(gpointer user_data)
 {
 	struct ofono_handsfree *hf = user_data;
+	struct hf_data *hd = ofono_handsfree_get_data(hf);
+
+	g_at_chat_register(hd->chat, "+BSIR:", bsir_notify, FALSE, hf, NULL);
 
 	ofono_handsfree_register(hf);
 
@@ -69,6 +86,7 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
 	hd = g_new0(struct hf_data, 1);
 	hd->chat = g_at_chat_clone(info->chat);
 	hd->ag_features = info->ag_features;
+	hd->vendor = vendor;
 
 	ofono_handsfree_set_data(hf, hd);
 
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 07/19] doc: Handsfree API support for +BINP=1
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (5 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 06/19] hfpmodem: Support for +BSIR unsol. result codes Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:35   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 08/19] handsfree: Expose RequestPhoneNumber in D-Bus API Mikel Astiz
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 doc/handsfree-api.txt |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/doc/handsfree-api.txt b/doc/handsfree-api.txt
index 4b2b156..023233c 100644
--- a/doc/handsfree-api.txt
+++ b/doc/handsfree-api.txt
@@ -20,6 +20,19 @@ Methods		dict GetProperties()
 			Possible Errors: [service].Error.InProgress
 					 [service].Error.InvalidArguments
 
+		string RequestPhoneNumber()
+
+			Request a phone number from the AG, corresponding to the
+			last voice tag recorded in the HF. The AG may accept or
+			reject this request depending on its internal state.
+
+			This functionality is generally implemented by using
+			the +BINP=1 AT command.
+
+			Possible Errors: [service].Error.InProgress
+					 [service].Error.InvalidArguments
+					 [service].Error.Failed
+
 Signals		PropertyChanged(string property, variant value)
 
 			Signal is emitted whenever a property has changed.
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 08/19] handsfree: Expose RequestPhoneNumber in D-Bus API
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (6 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 07/19] doc: Handsfree API support for +BINP=1 Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:35   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 09/19] hfpmodem: Support of number requests (AT+BINP=1) Mikel Astiz
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 src/handsfree.c |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/src/handsfree.c b/src/handsfree.c
index ae5007e..42b71ea 100644
--- a/src/handsfree.c
+++ b/src/handsfree.c
@@ -48,6 +48,7 @@ struct ofono_handsfree {
 	const struct ofono_handsfree_driver *driver;
 	void *driver_data;
 	struct ofono_atom *atom;
+	DBusMessage *pending;
 };
 
 void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
@@ -119,11 +120,53 @@ static DBusMessage *handsfree_set_property(DBusConnection *conn,
 	return __ofono_error_invalid_args(msg);
 }
 
+static void request_phone_number_cb(const struct ofono_error *error,
+					const struct ofono_phone_number *number,
+					void *data)
+{
+	struct ofono_handsfree *hf = data;
+	DBusMessage *reply;
+	const char *phone_number;
+
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+		DBG("Phone number request callback returned error: %s",
+			telephony_error_to_str(error));
+
+		reply = __ofono_error_failed(hf->pending);
+		__ofono_dbus_pending_reply(&hf->pending, reply);
+		return;
+	}
+
+	phone_number = phone_number_to_string(number);
+	reply = dbus_message_new_method_return(hf->pending);
+	dbus_message_append_args(reply, DBUS_TYPE_STRING, &phone_number,
+					DBUS_TYPE_INVALID);
+	__ofono_dbus_pending_reply(&hf->pending, reply);
+}
+
+static DBusMessage *handsfree_request_phone_number(DBusConnection *conn,
+						DBusMessage *msg, void *data)
+{
+	struct ofono_handsfree *hf = data;
+
+	if (hf->pending)
+		return __ofono_error_busy(msg);
+
+	if (!hf->driver->request_phone_number)
+		return __ofono_error_not_supported(msg);
+
+	hf->pending = dbus_message_ref(msg);
+	hf->driver->request_phone_number(hf, request_phone_number_cb, hf);
+	return NULL;
+}
+
 static GDBusMethodTable handsfree_methods[] = {
 	{ "GetProperties",    "",    "a{sv}", handsfree_get_properties,
 		G_DBUS_METHOD_FLAG_ASYNC },
 	{ "SetProperty",      "sv",  "", handsfree_set_property,
 		G_DBUS_METHOD_FLAG_ASYNC },
+	{ "RequestPhoneNumber", "", "s", handsfree_request_phone_number,
+		G_DBUS_METHOD_FLAG_ASYNC },
 	{ NULL, NULL, NULL, NULL }
 };
 
@@ -187,6 +230,12 @@ static void handsfree_unregister(struct ofono_atom *atom)
 	DBusConnection *conn = ofono_dbus_get_connection();
 	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
 	const char *path = __ofono_atom_get_path(atom);
+	struct ofono_handsfree *hf = __ofono_atom_get_data(atom);
+
+	if (hf->pending) {
+		DBusMessage *reply = __ofono_error_failed(hf->pending);
+		__ofono_dbus_pending_reply(&hf->pending, reply);
+	}
 
 	ofono_modem_remove_interface(modem, OFONO_HANDSFREE_INTERFACE);
 	g_dbus_unregister_interface(conn, path,
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 09/19] hfpmodem: Support of number requests (AT+BINP=1)
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (7 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 08/19] handsfree: Expose RequestPhoneNumber in D-Bus API Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:49   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 10/19] handsfree: Removed ASYNC flag from GetProperties Mikel Astiz
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 drivers/hfpmodem/handsfree.c |   59 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index be6b83c..392e5b7 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -42,6 +42,8 @@
 #include "hfpmodem.h"
 #include "slc.h"
 
+static const char *binp_prefix[] = { "+BINP:", NULL };
+
 struct hf_data {
 	GAtChat *chat;
 	unsigned int ag_features;
@@ -105,10 +107,67 @@ static void hfp_handsfree_remove(struct ofono_handsfree *hf)
 	g_free(hd);
 }
 
+static void hfp_request_phone_number_cb(gboolean ok, GAtResult *result,
+					gpointer user_data)
+{
+	struct cb_data *cbd = user_data;
+	ofono_handsfree_phone_cb_t cb = cbd->cb;
+	void *data = cbd->data;
+	GAtResultIter iter;
+	const char *num;
+	int type;
+	struct ofono_phone_number phone_number;
+
+	if (!ok)
+		goto fail;
+
+	g_at_result_iter_init(&iter, result);
+
+	if (!g_at_result_iter_next(&iter, "+BINP:"))
+		goto fail;
+
+	if (!g_at_result_iter_next_string(&iter, &num))
+		goto fail;
+
+	if (!g_at_result_iter_next_number(&iter, &type))
+		goto fail;
+
+	DBG("AT+BINP=1 response: %s %d", num, type);
+
+	strncpy(phone_number.number, num,
+		OFONO_MAX_PHONE_NUMBER_LENGTH);
+	phone_number.number[OFONO_MAX_PHONE_NUMBER_LENGTH] = '\0';
+	phone_number.type = type;
+
+	CALLBACK_WITH_SUCCESS(cb, &phone_number, data);
+	return;
+
+fail:
+	CALLBACK_WITH_FAILURE(cb, NULL, data);
+}
+
+static void hfp_request_phone_number(struct ofono_handsfree *hf,
+					ofono_handsfree_phone_cb_t cb,
+					void *data)
+{
+	struct hf_data *hd = ofono_handsfree_get_data(hf);
+	struct cb_data *cbd = cb_data_new(cb, data);
+
+	if (g_at_chat_send(hd->chat, "AT+BINP=1", binp_prefix,
+				hfp_request_phone_number_cb,
+				cbd, g_free) > 0)
+		return;
+
+	g_free(cbd);
+
+	CALLBACK_WITH_FAILURE(cb, NULL, data);
+}
+
 static struct ofono_handsfree_driver driver = {
 	.name			= "hfpmodem",
 	.probe			= hfp_handsfree_probe,
 	.remove			= hfp_handsfree_remove,
+	.request_phone_number	= hfp_request_phone_number,
 };
 
 void hfp_handsfree_init(void)
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 10/19] handsfree: Removed ASYNC flag from GetProperties
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (8 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 09/19] hfpmodem: Support of number requests (AT+BINP=1) Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:50   ` Denis Kenzior
  2011-10-12 12:35 ` [PATCH v2 11/19] doc: Voice recognition function added in Handsfree Mikel Astiz
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 src/handsfree.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/handsfree.c b/src/handsfree.c
index 42b71ea..579434b 100644
--- a/src/handsfree.c
+++ b/src/handsfree.c
@@ -161,8 +161,7 @@ static DBusMessage *handsfree_request_phone_number(DBusConnection *conn,
 }
 
 static GDBusMethodTable handsfree_methods[] = {
-	{ "GetProperties",    "",    "a{sv}", handsfree_get_properties,
-		G_DBUS_METHOD_FLAG_ASYNC },
+	{ "GetProperties",    "",    "a{sv}", handsfree_get_properties },
 	{ "SetProperty",      "sv",  "", handsfree_set_property,
 		G_DBUS_METHOD_FLAG_ASYNC },
 	{ "RequestPhoneNumber", "", "s", handsfree_request_phone_number,
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 11/19] doc: Voice recognition function added in Handsfree
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (9 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 10/19] handsfree: Removed ASYNC flag from GetProperties Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 12/19] include: Voice recognition in handsfree public api Mikel Astiz
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 doc/handsfree-api.txt |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/doc/handsfree-api.txt b/doc/handsfree-api.txt
index 023233c..9355946 100644
--- a/doc/handsfree-api.txt
+++ b/doc/handsfree-api.txt
@@ -41,3 +41,10 @@ Signals		PropertyChanged(string property, variant value)
 Properties	boolean InbandRinging [readonly]
 
 			Boolean representing whether inband ringing is enabled.
+
+		boolean VoiceRecognition [readwrite]
+
+			Boolean representing whether voice recognition is
+			currently active in the AG. This property may be written
+			to activate or deactivate the function from the HF, or
+			the AG could autonomously initiate it.
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 12/19] include: Voice recognition in handsfree public api
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (10 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 11/19] doc: Voice recognition function added in Handsfree Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 13/19] handsfree: Implement voice recognition function Mikel Astiz
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 include/handsfree.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/handsfree.h b/include/handsfree.h
index d39d919..68b3e5b 100644
--- a/include/handsfree.h
+++ b/include/handsfree.h
@@ -31,6 +31,8 @@ extern "C" {
 
 struct ofono_handsfree;
 
+typedef void (*ofono_handsfree_cb_t)(const struct ofono_error *error,
+					void *data);
 typedef void (*ofono_handsfree_phone_cb_t)(const struct ofono_error *error,
 					const struct ofono_phone_number *number,
 					void *data);
@@ -43,10 +45,15 @@ struct ofono_handsfree_driver {
 	void (*request_phone_number) (struct ofono_handsfree *hf,
 					ofono_handsfree_phone_cb_t cb,
 					void *data);
+	void (*voice_recognition)(struct ofono_handsfree *cv,
+					ofono_bool_t enabled,
+					ofono_handsfree_cb_t cb, void *data);
 };
 
 void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
 						ofono_bool_t enabled);
+void ofono_handsfree_set_voice_recognition(struct ofono_handsfree *hf,
+						ofono_bool_t enabled);
 
 int ofono_handsfree_driver_register(const struct ofono_handsfree_driver *d);
 void ofono_handsfree_driver_unregister(
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 13/19] handsfree: Implement voice recognition function
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (11 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 12/19] include: Voice recognition in handsfree public api Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 14/19] hfpmodem: Support for AT+BVRA Mikel Astiz
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 src/handsfree.c |   72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/src/handsfree.c b/src/handsfree.c
index 579434b..bf30b9c 100644
--- a/src/handsfree.c
+++ b/src/handsfree.c
@@ -45,6 +45,9 @@ static GSList *g_drivers = NULL;
 
 struct ofono_handsfree {
 	ofono_bool_t inband_ringing;
+	ofono_bool_t voicerec_state;
+	ofono_bool_t pending_voicerec_state;
+
 	const struct ofono_handsfree_driver *driver;
 	void *driver_data;
 	struct ofono_atom *atom;
@@ -69,6 +72,24 @@ void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
 					&dbus_enabled);
 }
 
+void ofono_handsfree_set_voice_recognition(struct ofono_handsfree *hf,
+						ofono_bool_t enabled)
+{
+	DBusConnection *conn = ofono_dbus_get_connection();
+	const char *path = __ofono_atom_get_path(hf->atom);
+	dbus_bool_t dbus_enabled = enabled;
+
+	if (hf->voicerec_state == enabled)
+		return;
+
+	hf->voicerec_state = enabled;
+
+	ofono_dbus_signal_property_changed(conn, path,
+					OFONO_HANDSFREE_INTERFACE,
+					"VoiceRecognition", DBUS_TYPE_BOOLEAN,
+					&dbus_enabled);
+}
+
 static DBusMessage *handsfree_get_properties(DBusConnection *conn,
 						DBusMessage *msg, void *data)
 {
@@ -77,6 +98,7 @@ static DBusMessage *handsfree_get_properties(DBusConnection *conn,
 	DBusMessageIter iter;
 	DBusMessageIter dict;
 	dbus_bool_t inband_ringing;
+	dbus_bool_t voicerec_state;
 
 	reply = dbus_message_new_method_return(msg);
 	if (reply == NULL)
@@ -92,17 +114,49 @@ static DBusMessage *handsfree_get_properties(DBusConnection *conn,
 	ofono_dbus_dict_append(&dict, "InbandRinging", DBUS_TYPE_BOOLEAN,
 				&inband_ringing);
 
+	voicerec_state = hf->voicerec_state;
+	ofono_dbus_dict_append(&dict, "VoiceRecognition", DBUS_TYPE_BOOLEAN,
+				&voicerec_state);
+
 	dbus_message_iter_close_container(&iter, &dict);
 
 	return reply;
 }
 
+static void voicerec_set_cb(const struct ofono_error *error, void *data)
+{
+	struct ofono_handsfree *hf = data;
+	DBusConnection *conn = ofono_dbus_get_connection();
+	const char *path = __ofono_atom_get_path(hf->atom);
+
+	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+		__ofono_dbus_pending_reply(&hf->pending,
+					__ofono_error_failed(hf->pending));
+		return;
+	}
+
+	hf->voicerec_state = hf->pending_voicerec_state;
+
+	__ofono_dbus_pending_reply(&hf->pending,
+				dbus_message_new_method_return(hf->pending));
+
+	ofono_dbus_signal_property_changed(conn, path,
+					OFONO_HANDSFREE_INTERFACE,
+					"VoiceRecognition",
+					DBUS_TYPE_BOOLEAN,
+					&hf->voicerec_state);
+}
+
 static DBusMessage *handsfree_set_property(DBusConnection *conn,
 						DBusMessage *msg, void *data)
 {
+	struct ofono_handsfree *hf = data;
 	DBusMessageIter iter, var;
 	const char *name;
 
+	if (hf->pending)
+		return __ofono_error_busy(msg);
+
 	if (dbus_message_iter_init(msg, &iter) == FALSE)
 		return __ofono_error_invalid_args(msg);
 
@@ -117,6 +171,24 @@ static DBusMessage *handsfree_set_property(DBusConnection *conn,
 
 	dbus_message_iter_recurse(&iter, &var);
 
+	if (g_str_equal(name, "VoiceRecognition") == TRUE) {
+		ofono_bool_t enabled;
+
+		if (!hf->driver->voice_recognition)
+			return __ofono_error_not_implemented(msg);
+
+		if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN)
+			return __ofono_error_invalid_args(msg);
+
+		dbus_message_iter_get_basic(&var, &enabled);
+
+		hf->pending_voicerec_state = enabled;
+		hf->pending = dbus_message_ref(msg);
+		hf->driver->voice_recognition(hf, enabled, voicerec_set_cb, hf);
+
+		return NULL;
+	}
+
 	return __ofono_error_invalid_args(msg);
 }
 
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 14/19] hfpmodem: Support for AT+BVRA
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (12 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 13/19] handsfree: Implement voice recognition function Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 15/19] doc: Handsfree exposes supported AG features Mikel Astiz
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 drivers/hfpmodem/handsfree.c |   49 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index 392e5b7..5fe41c0 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -43,6 +43,7 @@
 #include "slc.h"
 
 static const char *binp_prefix[] = { "+BINP:", NULL };
+static const char *bvra_prefix[] = { "+BVRA:", NULL };
 
 struct hf_data {
 	GAtChat *chat;
@@ -50,6 +51,18 @@ struct hf_data {
 	unsigned int vendor;
 };
 
+static void hf_generic_set_cb(gboolean ok, GAtResult *result,
+				gpointer user_data)
+{
+	struct cb_data *cbd = user_data;
+	ofono_handsfree_cb_t cb = cbd->cb;
+	struct ofono_error error;
+
+	decode_at_error(&error, g_at_result_final_response(result));
+
+	cb(&error, cbd->data);
+}
+
 static void bsir_notify(GAtResult *result, gpointer user_data)
 {
 	struct ofono_handsfree *hf = user_data;
@@ -63,12 +76,26 @@ static void bsir_notify(GAtResult *result, gpointer user_data)
 	ofono_handsfree_set_inband_ringing(hf, (ofono_bool_t) value);
 }
 
+static void bvra_notify(GAtResult *result, gpointer user_data)
+{
+	struct ofono_handsfree *hf = user_data;
+	struct hf_data *hd = ofono_handsfree_get_data(hf);
+	int value;
+
+	if (at_util_parse_reg_unsolicited(result, "+BVRA:", &value,
+				NULL, NULL, NULL, hd->vendor) == FALSE)
+		return;
+
+	ofono_handsfree_set_voice_recognition(hf, (ofono_bool_t) value);
+}
+
 static gboolean hfp_handsfree_register(gpointer user_data)
 {
 	struct ofono_handsfree *hf = user_data;
 	struct hf_data *hd = ofono_handsfree_get_data(hf);
 
 	g_at_chat_register(hd->chat, "+BSIR:", bsir_notify, FALSE, hf, NULL);
+	g_at_chat_register(hd->chat, "+BVRA:", bvra_notify, FALSE, hf, NULL);
 
 	ofono_handsfree_register(hf);
 
@@ -163,11 +190,33 @@ static void hfp_request_phone_number(struct ofono_handsfree *hf,
 	CALLBACK_WITH_FAILURE(cb, NULL, data);
 }
 
+static void hfp_voice_recognition(struct ofono_handsfree *hf,
+					ofono_bool_t enabled,
+					ofono_handsfree_cb_t cb, void *data)
+{
+	struct hf_data *hd = ofono_handsfree_get_data(hf);
+	struct cb_data *cbd = cb_data_new(cb, data);
+	char buf[64];
+
+	snprintf(buf, sizeof(buf), "AT+BVRA=%d",
+				(int)(enabled));
+
+	if (g_at_chat_send(hd->chat, buf, bvra_prefix,
+				hf_generic_set_cb,
+				cbd, g_free) > 0)
+		return;
+
+	g_free(cbd);
+
+	CALLBACK_WITH_FAILURE(cb, data);
+}
+
 static struct ofono_handsfree_driver driver = {
 	.name			= "hfpmodem",
 	.probe			= hfp_handsfree_probe,
 	.remove			= hfp_handsfree_remove,
 	.request_phone_number	= hfp_request_phone_number,
+	.voice_recognition	= hfp_voice_recognition,
 };
 
 void hfp_handsfree_init(void)
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 15/19] doc: Handsfree exposes supported AG features
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (13 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 14/19] hfpmodem: Support for AT+BVRA Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 16/19] include: AG features added to handsfree public api Mikel Astiz
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 doc/handsfree-api.txt |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/doc/handsfree-api.txt b/doc/handsfree-api.txt
index 9355946..dafb0ed 100644
--- a/doc/handsfree-api.txt
+++ b/doc/handsfree-api.txt
@@ -38,7 +38,22 @@ Signals		PropertyChanged(string property, variant value)
 			Signal is emitted whenever a property has changed.
 			The new value is passed as the signal argument.
 
-Properties	boolean InbandRinging [readonly]
+Properties	array{string} Features [readonly]
+
+			List of features supported by the AG. The currently
+			supported values are:
+				"3WayCalling"
+				"ECNR"
+				"VoiceRecognition"
+				"InbandRinging"
+				"AttachVoiceTag"
+				"RejectCall"
+				"EnhancedCallStatus"
+				"EnhancedCallControl"
+				"ExtendedResultCodes"
+				"CodecNegotiation"
+
+		boolean InbandRinging [readonly]
 
 			Boolean representing whether inband ringing is enabled.
 
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 16/19] include: AG features added to handsfree public api
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (14 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 15/19] doc: Handsfree exposes supported AG features Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 17/19] handsfree: Supported AG features exposed in D-Bus Mikel Astiz
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 include/handsfree.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/handsfree.h b/include/handsfree.h
index 68b3e5b..25623a1 100644
--- a/include/handsfree.h
+++ b/include/handsfree.h
@@ -50,6 +50,8 @@ struct ofono_handsfree_driver {
 					ofono_handsfree_cb_t cb, void *data);
 };
 
+void ofono_handsfree_set_ag_features(struct ofono_handsfree *hf,
+					unsigned int ag_features);
 void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
 						ofono_bool_t enabled);
 void ofono_handsfree_set_voice_recognition(struct ofono_handsfree *hf,
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 17/19] handsfree: Supported AG features exposed in D-Bus
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (15 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 16/19] include: AG features added to handsfree public api Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 18/19] hfpmodem: Report features supported by AG Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 19/19] hfp_hf: Switched to permissive AT syntax parser Mikel Astiz
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 src/handsfree.c |   80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/src/handsfree.c b/src/handsfree.c
index bf30b9c..e19d9d3 100644
--- a/src/handsfree.c
+++ b/src/handsfree.c
@@ -41,9 +41,12 @@
 #include "ofono.h"
 #include "common.h"
 
+#define MAX_AG_FEATURE_COUNT 32
+
 static GSList *g_drivers = NULL;
 
 struct ofono_handsfree {
+	unsigned int ag_features;
 	ofono_bool_t inband_ringing;
 	ofono_bool_t voicerec_state;
 	ofono_bool_t pending_voicerec_state;
@@ -54,6 +57,76 @@ struct ofono_handsfree {
 	DBusMessage *pending;
 };
 
+static void append_ag_features(struct ofono_handsfree *hf, char **features)
+{
+	unsigned int bit;
+	int feature_count = 0;
+
+	for (bit = 1; bit != 0; bit <<= 1) {
+		if (hf->ag_features & bit) {
+			char *name = NULL;
+
+			switch ((enum hfp_ag_feature) bit) {
+			case HFP_AG_FEATURE_3WAY:
+				name = "3WayCalling";
+				break;
+			case HFP_AG_FEATURE_ECNR:
+				name = "ECNR";
+				break;
+			case HFP_AG_FEATURE_VOICE_RECOG:
+				name = "VoiceRecognition";
+				break;
+			case HFP_AG_FEATURE_IN_BAND_RING_TONE:
+				name = "InbandRinging";
+				break;
+			case HFP_AG_FEATURE_ATTACH_VOICE_TAG:
+				name = "AttachVoiceTag";
+				break;
+			case HFP_AG_FEATURE_REJECT_CALL:
+				name = "RejectCall";
+				break;
+			case HFP_AG_FEATURE_ENHANCED_CALL_STATUS:
+				name = "EnhancedCallStatus";
+				break;
+			case HFP_AG_FEATURE_ENHANCED_CALL_CONTROL:
+				name = "EnhancedCallControl";
+				break;
+			case HFP_AG_FEATURE_EXTENDED_RES_CODE:
+				name = "ExtendedResultCodes";
+				break;
+			case HFP_AG_FEATURE_CODEC_NEGOTIATION:
+				name = "CodecNegotiation";
+				break;
+			}
+
+			features[feature_count++] = name;
+		}
+	}
+
+	features[feature_count] = NULL;
+}
+
+void ofono_handsfree_set_ag_features(struct ofono_handsfree *hf,
+					unsigned int ag_features)
+{
+	DBusConnection *conn = ofono_dbus_get_connection();
+	const char *path = __ofono_atom_get_path(hf->atom);
+	char **features;
+
+	if (hf->ag_features == ag_features)
+		return;
+
+	hf->ag_features = ag_features;
+
+	features = g_new0(char *, MAX_AG_FEATURE_COUNT + 1);
+	append_ag_features(hf, features);
+	ofono_dbus_signal_array_property_changed(conn, path,
+						OFONO_HANDSFREE_INTERFACE,
+						"Features", DBUS_TYPE_STRING,
+						&features);
+	g_free(features);
+}
+
 void ofono_handsfree_set_inband_ringing(struct ofono_handsfree *hf,
 						ofono_bool_t enabled)
 {
@@ -99,6 +172,7 @@ static DBusMessage *handsfree_get_properties(DBusConnection *conn,
 	DBusMessageIter dict;
 	dbus_bool_t inband_ringing;
 	dbus_bool_t voicerec_state;
+	char **features;
 
 	reply = dbus_message_new_method_return(msg);
 	if (reply == NULL)
@@ -118,6 +192,12 @@ static DBusMessage *handsfree_get_properties(DBusConnection *conn,
 	ofono_dbus_dict_append(&dict, "VoiceRecognition", DBUS_TYPE_BOOLEAN,
 				&voicerec_state);
 
+	features = g_new0(char *, MAX_AG_FEATURE_COUNT + 1);
+	append_ag_features(hf, features);
+	ofono_dbus_dict_append_array(&dict, "Features", DBUS_TYPE_STRING,
+					&features);
+	g_free(features);
+
 	dbus_message_iter_close_container(&iter, &dict);
 
 	return reply;
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 18/19] hfpmodem: Report features supported by AG
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (16 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 17/19] handsfree: Supported AG features exposed in D-Bus Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-12 12:35 ` [PATCH v2 19/19] hfp_hf: Switched to permissive AT syntax parser Mikel Astiz
  18 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

---
 drivers/hfpmodem/handsfree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
index 5fe41c0..835dcfc 100644
--- a/drivers/hfpmodem/handsfree.c
+++ b/drivers/hfpmodem/handsfree.c
@@ -98,6 +98,7 @@ static gboolean hfp_handsfree_register(gpointer user_data)
 	g_at_chat_register(hd->chat, "+BVRA:", bvra_notify, FALSE, hf, NULL);
 
 	ofono_handsfree_register(hf);
+	ofono_handsfree_set_ag_features(hf, hd->ag_features);
 
 	if (hd->ag_features & HFP_AG_FEATURE_IN_BAND_RING_TONE)
 		ofono_handsfree_set_inband_ringing(hf, TRUE);
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 19/19] hfp_hf: Switched to permissive AT syntax parser
  2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
                   ` (17 preceding siblings ...)
  2011-10-12 12:35 ` [PATCH v2 18/19] hfpmodem: Report features supported by AG Mikel Astiz
@ 2011-10-12 12:35 ` Mikel Astiz
  2011-10-13 18:52   ` Denis Kenzior
  18 siblings, 1 reply; 32+ messages in thread
From: Mikel Astiz @ 2011-10-12 12:35 UTC (permalink / raw)
  To: ofono

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

Some phones can have trouble when using the strict AT syntax parser for
HFP. So far, this has only been evidenced with the Samsung Wave, which
works fine with the permissive syntax parser.

Several other phones have been tested with the permissive parser and
seem to work OK.
---
 plugins/hfp_hf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c
index 1008696..58ebc64 100644
--- a/plugins/hfp_hf.c
+++ b/plugins/hfp_hf.c
@@ -135,7 +135,7 @@ static int service_level_connection(struct ofono_modem *modem, int fd)
 		return -EIO;
 	}
 
-	syntax = g_at_syntax_new_gsmv1();
+	syntax = g_at_syntax_new_gsm_permissive();
 	chat = g_at_chat_new(io, syntax);
 	g_at_syntax_unref(syntax);
 	g_io_channel_unref(io);
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 01/19] handsfree: Copyright statement correction
  2011-10-12 12:35 ` [PATCH v2 01/19] handsfree: Copyright statement correction Mikel Astiz
@ 2011-10-13 18:07   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:07 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  include/handsfree.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 02/19] handsfree: Copyright statement correction
  2011-10-12 12:35 ` [PATCH v2 02/19] " Mikel Astiz
@ 2011-10-13 18:07   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:07 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  src/handsfree.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 03/19] hfpmodem: Copyright statement correction
  2011-10-12 12:35 ` [PATCH v2 03/19] hfpmodem: " Mikel Astiz
@ 2011-10-13 18:07   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:07 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  drivers/hfpmodem/handsfree.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 04/19] doc: Add initial Handsfree API documentation
  2011-10-12 12:35 ` [PATCH v2 04/19] doc: Add initial Handsfree API documentation Mikel Astiz
@ 2011-10-13 18:08   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:08 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> These basic features have already been implemented.
> ---
>  doc/handsfree-api.txt |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
>  create mode 100644 doc/handsfree-api.txt
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 05/19] hfpmodem: Set initial state for inband ringing
  2011-10-12 12:35 ` [PATCH v2 05/19] hfpmodem: Set initial state for inband ringing Mikel Astiz
@ 2011-10-13 18:09   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:09 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> According to the HFP specification, inband ringing will be enabled by
> default if the AG supports it. This setting could later be changed by
> the unsolicited result code +BSIR.
> ---
>  drivers/hfpmodem/handsfree.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Patch has been applied, however I amended it slightly due to a compiler
error.

> 
> diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
> index d3b5b44..12a23fc 100644
> --- a/drivers/hfpmodem/handsfree.c
> +++ b/drivers/hfpmodem/handsfree.c
> @@ -44,6 +44,7 @@
>  
>  struct hf_data {
>  	GAtChat *chat;
> +	unsigned int ag_features;
>  };
>  
>  static gboolean hfp_handsfree_register(gpointer user_data)
> @@ -52,6 +53,9 @@ static gboolean hfp_handsfree_register(gpointer user_data)
>  
>  	ofono_handsfree_register(hf);
>  
> +	if (hd->ag_features & HFP_AG_FEATURE_IN_BAND_RING_TONE)
> +		ofono_handsfree_set_inband_ringing(hf, TRUE);
> +

I also moved this part to happen before registering in a later commit.
1 less signal emission to worry about ;)

>  	return FALSE;
>  }
>  
> @@ -64,6 +68,7 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
>  	DBG("");
>  	hd = g_new0(struct hf_data, 1);
>  	hd->chat = g_at_chat_clone(info->chat);
> +	hd->ag_features = info->ag_features;
>  
>  	ofono_handsfree_set_data(hf, hd);
>  

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 06/19] hfpmodem: Support for +BSIR unsol. result codes
  2011-10-12 12:35 ` [PATCH v2 06/19] hfpmodem: Support for +BSIR unsol. result codes Mikel Astiz
@ 2011-10-13 18:14   ` Denis Kenzior
  2011-10-14  8:51     ` Mikel Astiz
  0 siblings, 1 reply; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:14 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  drivers/hfpmodem/handsfree.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hfpmodem/handsfree.c b/drivers/hfpmodem/handsfree.c
> index 12a23fc..be6b83c 100644
> --- a/drivers/hfpmodem/handsfree.c
> +++ b/drivers/hfpmodem/handsfree.c
> @@ -45,11 +45,28 @@
>  struct hf_data {
>  	GAtChat *chat;
>  	unsigned int ag_features;
> +	unsigned int vendor;
>  };
>  
> +static void bsir_notify(GAtResult *result, gpointer user_data)
> +{
> +	struct ofono_handsfree *hf = user_data;
> +	struct hf_data *hd = ofono_handsfree_get_data(hf);
> +	int value;
> +
> +	if (at_util_parse_reg_unsolicited(result, "+BSIR:", &value,
> +				NULL, NULL, NULL, hd->vendor) == FALSE)
> +		return;

Why exactly are you using parse_reg_unsolicited here?  That one is meant
to parse +CREG/+CGREG unsolicited responses, probably not the right
thing for BSIR, just using g_at_result_iter_next_number would be enough
here.

> +
> +	ofono_handsfree_set_inband_ringing(hf, (ofono_bool_t) value);
> +}
> +
>  static gboolean hfp_handsfree_register(gpointer user_data)
>  {
>  	struct ofono_handsfree *hf = user_data;
> +	struct hf_data *hd = ofono_handsfree_get_data(hf);
> +
> +	g_at_chat_register(hd->chat, "+BSIR:", bsir_notify, FALSE, hf, NULL);
>  
>  	ofono_handsfree_register(hf);
>  
> @@ -69,6 +86,7 @@ static int hfp_handsfree_probe(struct ofono_handsfree *hf,
>  	hd = g_new0(struct hf_data, 1);
>  	hd->chat = g_at_chat_clone(info->chat);
>  	hd->ag_features = info->ag_features;
> +	hd->vendor = vendor;

If you don't use the at_util_parse_reg_unsolicited then you don't need
the vendor information.

>  
>  	ofono_handsfree_set_data(hf, hd);
>  

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 07/19] doc: Handsfree API support for +BINP=1
  2011-10-12 12:35 ` [PATCH v2 07/19] doc: Handsfree API support for +BINP=1 Mikel Astiz
@ 2011-10-13 18:35   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:35 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  doc/handsfree-api.txt |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 08/19] handsfree: Expose RequestPhoneNumber in D-Bus API
  2011-10-12 12:35 ` [PATCH v2 08/19] handsfree: Expose RequestPhoneNumber in D-Bus API Mikel Astiz
@ 2011-10-13 18:35   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:35 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  src/handsfree.c |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 49 insertions(+), 0 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 09/19] hfpmodem: Support of number requests (AT+BINP=1)
  2011-10-12 12:35 ` [PATCH v2 09/19] hfpmodem: Support of number requests (AT+BINP=1) Mikel Astiz
@ 2011-10-13 18:49   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:49 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  drivers/hfpmodem/handsfree.c |   59 ++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 59 insertions(+), 0 deletions(-)
> 

Patch has been applied, but I tweaked it slightly in a follow-on commit.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 10/19] handsfree: Removed ASYNC flag from GetProperties
  2011-10-12 12:35 ` [PATCH v2 10/19] handsfree: Removed ASYNC flag from GetProperties Mikel Astiz
@ 2011-10-13 18:50   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:50 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> ---
>  src/handsfree.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 19/19] hfp_hf: Switched to permissive AT syntax parser
  2011-10-12 12:35 ` [PATCH v2 19/19] hfp_hf: Switched to permissive AT syntax parser Mikel Astiz
@ 2011-10-13 18:52   ` Denis Kenzior
  0 siblings, 0 replies; 32+ messages in thread
From: Denis Kenzior @ 2011-10-13 18:52 UTC (permalink / raw)
  To: ofono

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

Hi Mikel,

On 10/12/2011 07:35 AM, Mikel Astiz wrote:
> Some phones can have trouble when using the strict AT syntax parser for
> HFP. So far, this has only been evidenced with the Samsung Wave, which
> works fine with the permissive syntax parser.
> 
> Several other phones have been tested with the permissive parser and
> seem to work OK.
> ---
>  plugins/hfp_hf.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 06/19] hfpmodem: Support for +BSIR unsol. result codes
  2011-10-13 18:14   ` Denis Kenzior
@ 2011-10-14  8:51     ` Mikel Astiz
  0 siblings, 0 replies; 32+ messages in thread
From: Mikel Astiz @ 2011-10-14  8:51 UTC (permalink / raw)
  To: ofono

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

Hi Denis,
> Why exactly are you using parse_reg_unsolicited here?  That one is meant
> to parse +CREG/+CGREG unsolicited responses, probably not the right
> thing for BSIR, just using g_at_result_iter_next_number would be enough
> here.
>

You're right, it doesn't make any sense, and the same issue is included 
in patch 14/19. Sorry for that.

Also, I understand now why you suggested leaving the vendor information 
out in the first review.

Let me send updated patches next week.

Regards,
Mikel


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2011-10-14  8:51 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-12 12:35 [PATCH v2 00/19] Bluetooth HFP-specific extensions Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 01/19] handsfree: Copyright statement correction Mikel Astiz
2011-10-13 18:07   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 02/19] " Mikel Astiz
2011-10-13 18:07   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 03/19] hfpmodem: " Mikel Astiz
2011-10-13 18:07   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 04/19] doc: Add initial Handsfree API documentation Mikel Astiz
2011-10-13 18:08   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 05/19] hfpmodem: Set initial state for inband ringing Mikel Astiz
2011-10-13 18:09   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 06/19] hfpmodem: Support for +BSIR unsol. result codes Mikel Astiz
2011-10-13 18:14   ` Denis Kenzior
2011-10-14  8:51     ` Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 07/19] doc: Handsfree API support for +BINP=1 Mikel Astiz
2011-10-13 18:35   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 08/19] handsfree: Expose RequestPhoneNumber in D-Bus API Mikel Astiz
2011-10-13 18:35   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 09/19] hfpmodem: Support of number requests (AT+BINP=1) Mikel Astiz
2011-10-13 18:49   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 10/19] handsfree: Removed ASYNC flag from GetProperties Mikel Astiz
2011-10-13 18:50   ` Denis Kenzior
2011-10-12 12:35 ` [PATCH v2 11/19] doc: Voice recognition function added in Handsfree Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 12/19] include: Voice recognition in handsfree public api Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 13/19] handsfree: Implement voice recognition function Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 14/19] hfpmodem: Support for AT+BVRA Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 15/19] doc: Handsfree exposes supported AG features Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 16/19] include: AG features added to handsfree public api Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 17/19] handsfree: Supported AG features exposed in D-Bus Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 18/19] hfpmodem: Report features supported by AG Mikel Astiz
2011-10-12 12:35 ` [PATCH v2 19/19] hfp_hf: Switched to permissive AT syntax parser Mikel Astiz
2011-10-13 18:52   ` Denis Kenzior

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.