Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] 6lowpan: header cleanup
From: Alexander Aring @ 2014-03-05 13:29 UTC (permalink / raw)
  To: marcel
  Cc: gustavo, johan.hedberg, davem, alex.bluesman.smirnov, dbaryshkov,
	linux-bluetooth, netdev, Alexander Aring

Hi,

this patch series fix a missing include of 6LoWPAN header and move it
into the include/net directory. Since we did some code sharing with
bluetooth 6LoWPAN the header turns into a generic header for 6LoWPAN.
Instead to use a relative path in bluetooth 6LoWPAN we can now use
include <net/6lowpan.h>.

- Alex

Alexander Aring (2):
  6lowpan: add missing include of net/ipv6.h
  6lowpan: move 6lowpan header to include/net

 {net/ieee802154 => include/net}/6lowpan.h | 2 ++
 net/bluetooth/6lowpan.c                   | 2 +-
 net/ieee802154/6lowpan_iphc.c             | 3 +--
 net/ieee802154/6lowpan_rtnl.c             | 2 +-
 net/ieee802154/reassembly.c               | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
 rename {net/ieee802154 => include/net}/6lowpan.h (99%)

-- 
1.9.0

^ permalink raw reply

* [PATCH net-next 1/2] 6lowpan: add missing include of net/ipv6.h
From: Alexander Aring @ 2014-03-05 13:29 UTC (permalink / raw)
  To: marcel
  Cc: gustavo, johan.hedberg, davem, alex.bluesman.smirnov, dbaryshkov,
	linux-bluetooth, netdev, Alexander Aring
In-Reply-To: <1394026145-18981-1-git-send-email-alex.aring@gmail.com>

The 6lowpan.h file contains some static inline function which use
internal ipv6 api structs. Add a include of ipv6.h to be sure that it's
known before.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 net/ieee802154/6lowpan.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h
index 0dccf62..f7d372b 100644
--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -53,6 +53,8 @@
 #ifndef __6LOWPAN_H__
 #define __6LOWPAN_H__
 
+#include <net/ipv6.h>
+
 #define UIP_802154_SHORTADDR_LEN	2  /* compressed ipv6 address length */
 #define UIP_IPH_LEN			40 /* ipv6 fixed header size */
 #define UIP_PROTO_UDP			17 /* ipv6 next header value for UDP */
-- 
1.9.0

^ permalink raw reply related

* [PATCH net-next 2/2] 6lowpan: move 6lowpan header to include/net
From: Alexander Aring @ 2014-03-05 13:29 UTC (permalink / raw)
  To: marcel
  Cc: gustavo, johan.hedberg, davem, alex.bluesman.smirnov, dbaryshkov,
	linux-bluetooth, netdev, Alexander Aring
In-Reply-To: <1394026145-18981-1-git-send-email-alex.aring@gmail.com>

This header is used by bluetooth and ieee802154 branch. This patch
move this header to the include/net directory to avoid a use of a
relative path in include.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
 {net/ieee802154 => include/net}/6lowpan.h | 0
 net/bluetooth/6lowpan.c                   | 2 +-
 net/ieee802154/6lowpan_iphc.c             | 3 +--
 net/ieee802154/6lowpan_rtnl.c             | 2 +-
 net/ieee802154/reassembly.c               | 2 +-
 5 files changed, 4 insertions(+), 5 deletions(-)
 rename {net/ieee802154 => include/net}/6lowpan.h (100%)

diff --git a/net/ieee802154/6lowpan.h b/include/net/6lowpan.h
similarity index 100%
rename from net/ieee802154/6lowpan.h
rename to include/net/6lowpan.h
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index adb3ea0..73492b9 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -27,7 +27,7 @@
 
 #include "6lowpan.h"
 
-#include "../ieee802154/6lowpan.h" /* for the compression support */
+#include <net/6lowpan.h> /* for the compression support */
 
 #define IFACE_NAME_TEMPLATE "bt%d"
 #define EUI64_ADDR_LEN 8
diff --git a/net/ieee802154/6lowpan_iphc.c b/net/ieee802154/6lowpan_iphc.c
index 860aa2d..211b568 100644
--- a/net/ieee802154/6lowpan_iphc.c
+++ b/net/ieee802154/6lowpan_iphc.c
@@ -54,11 +54,10 @@
 #include <linux/if_arp.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
+#include <net/6lowpan.h>
 #include <net/ipv6.h>
 #include <net/af_ieee802154.h>
 
-#include "6lowpan.h"
-
 /*
  * Uncompress address function for source and
  * destination address(non-multicast).
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c
index e472618..1bbab89 100644
--- a/net/ieee802154/6lowpan_rtnl.c
+++ b/net/ieee802154/6lowpan_rtnl.c
@@ -52,10 +52,10 @@
 #include <net/af_ieee802154.h>
 #include <net/ieee802154.h>
 #include <net/ieee802154_netdev.h>
+#include <net/6lowpan.h>
 #include <net/ipv6.h>
 
 #include "reassembly.h"
-#include "6lowpan.h"
 
 static LIST_HEAD(lowpan_devices);
 
diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c
index 4511fc2..1cc2336 100644
--- a/net/ieee802154/reassembly.c
+++ b/net/ieee802154/reassembly.c
@@ -24,10 +24,10 @@
 #include <linux/export.h>
 
 #include <net/ieee802154_netdev.h>
+#include <net/6lowpan.h>
 #include <net/ipv6.h>
 #include <net/inet_frag.h>
 
-#include "6lowpan.h"
 #include "reassembly.h"
 
 static struct inet_frags lowpan_frags;
-- 
1.9.0

^ permalink raw reply related

* Re: [PATCH v2 2/5] monitor: Use miliseconds instead of seconds in the timeout
From: Anderson Lizardo @ 2014-03-05 13:39 UTC (permalink / raw)
  To: Lukasz Rymanowski; +Cc: BlueZ development
In-Reply-To: <1394011361-9469-2-git-send-email-lukasz.rymanowski@tieto.com>

Hi Lukasz,

On Wed, Mar 5, 2014 at 5:22 AM, Lukasz Rymanowski
<lukasz.rymanowski@tieto.com> wrote:
> -static inline int timeout_set(int fd, unsigned int seconds)
> +static inline int timeout_set(int fd, unsigned int msec)
>  {
>         struct itimerspec itimer;
> +       unsigned int sec = msec / 1000;
>
>         memset(&itimer, 0, sizeof(itimer));
>         itimer.it_interval.tv_sec = 0;
>         itimer.it_interval.tv_nsec = 0;
> -       itimer.it_value.tv_sec = seconds;
> -       itimer.it_value.tv_nsec = 0;
> +       itimer.it_value.tv_sec = sec;
> +       itimer.it_value.tv_nsec = (msec - (sec * 1000)) * 1000;

Would you not be multiplying by 1000000 (i.e. 10^6) instead?

Also, why not use:

itimer.it_value.tv_nsec = (msec % 1000) * 1000000;

>
>         return timerfd_settime(fd, 0, &itimer, NULL);
>  }

Best Regards,
-- 
Anderson Lizardo
http://www.indt.org/?lang=en
INdT - Manaus - Brazil

^ permalink raw reply

* [PATCH] android/avdtp: Fix crash when DISCOVER failed
From: Andrzej Kaczmarek @ 2014-03-05 14:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek

Discover callback is only set when avdtp_discover was successful so we
need to check if it's set before calling.
---
 android/avdtp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/android/avdtp.c b/android/avdtp.c
index f104e3e..96c7d0d 100644
--- a/android/avdtp.c
+++ b/android/avdtp.c
@@ -937,7 +937,8 @@ static void finalize_discovery(struct avdtp *session, int err)
 	if (discover->id > 0)
 		g_source_remove(discover->id);
 
-	discover->cb(session, session->seps, err ? &avdtp_err : NULL,
+	if (discover->cb)
+		discover->cb(session, session->seps, err ? &avdtp_err : NULL,
 							discover->user_data);
 	g_free(discover);
 }
-- 
1.8.5.4


^ permalink raw reply related

* Re: Controlling LEDs and rumble on sixaxis
From: Andrea @ 2014-03-05 14:06 UTC (permalink / raw)
  To: Antonio Ospite; +Cc: linux-bluetooth
In-Reply-To: <20140304231118.3500abb703a7c1a7679d01f1@ao2.it>

On 04/03/14 22:11, Antonio Ospite wrote:
> 
> With older kernels you can already set LEDs and rumble by sending the
> HID output report 01 via hidraw (actually there is a regression
> preventing that via BT in some versions). See the code in the BlueZ

I think the kernels I use have this regressions as the plugin does not set anything.
(Szymon mentioned something like that)
could you please give me a link to the fix so I can track if and when they are fixed for me.

> sixaxis plugin or in the newer linux kernel for the report format.
> 
> With recent/newer kernels you can use the sysfs leds class under
> /sys/class/leds/ to control the LEDs and the force feedback api[1] to
> control the rumble.

sounds simple. is this functionality affected by the above regression?

> dbus is not necessary, but depending on your application you may want to
> use libudev to add the hotplug detection of the controller.
> 

I only mentioned dbus as I found I can use it to disconnect the controller (Bluetooth).
Happy to skip it altogether. If there is a better way?

Andrea


^ permalink raw reply

* [PATCH 01/10] unit/avrcp: Refactor check attributes code
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Make check_attributes() function which would handle attributes check.
---
 unit/test-avrcp.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index 803dd6b..7ce2801 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -288,6 +288,20 @@ static const struct avrcp_passthrough_handler passthrough_handlers[] = {
 		{ },
 };
 
+static bool check_attributes(const uint8_t *params)
+{
+	int i;
+
+	for (i = 1; i <= params[0]; i++) {
+		DBG("params[%d] = 0x%02x", i, params[i]);
+		if (params[i] > AVRCP_ATTRIBUTE_LAST ||
+		    params[i] == AVRCP_ATTRIBUTE_ILEGAL)
+			return false;
+	}
+
+	return true;
+}
+
 static ssize_t avrcp_handle_get_capabilities(struct avrcp *session,
 						uint8_t transaction,
 						uint16_t params_len,
@@ -326,16 +340,10 @@ static ssize_t avrcp_handle_get_player_attr_text(struct avrcp *session,
 						uint8_t *params,
 						void *user_data)
 {
-	int i;
-
 	DBG("params[0] %d params_len %d", params[0], params_len);
 
-	for (i = 1; i <= params[0]; i++) {
-		DBG("params[%d] = 0x%02x", i, params[i]);
-		if (params[i] > AVRCP_ATTRIBUTE_LAST ||
-			params[i] == AVRCP_ATTRIBUTE_ILEGAL)
-			return -EINVAL;
-	}
+	if (!check_attributes(params))
+		return -EINVAL;
 
 	params[0] = 0;
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 02/10] unit/avrcp: Add attributes check in list_player_vals()
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Add check and fix test case since it was testing that response is
received but attribute 0 is illegal one.
---
 unit/test-avrcp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index 7ce2801..c3064da 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -356,11 +356,15 @@ static ssize_t avrcp_handle_list_player_values(struct avrcp *session,
 						uint8_t *params,
 						void *user_data)
 {
-	DBG("params[0] %d params_len %d", params[0], params_len);
+	DBG("params[0] 0x%02x params_len %d", params[0], params_len);
 
 	if (params_len != 1)
 		return -EINVAL;
 
+	if (params[0] > AVRCP_ATTRIBUTE_LAST ||
+		    params[0] == AVRCP_ATTRIBUTE_ILEGAL)
+		return -EINVAL;
+
 	params[0] = 0;
 
 	return 1;
@@ -604,7 +608,7 @@ int main(int argc, char *argv[])
 			raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
 				0x00, 0x19, 0x58,
 				AVRCP_LIST_PLAYER_VALUES,
-				0x00, 0x00, 0x01, 0x00),
+				0x00, 0x00, 0x01, AVRCP_ATTRIBUTE_EQUALIZER),
 			raw_pdu(0x02, 0x11, 0x0e, 0x0c, 0x48, 0x00,
 				0x00, 0x19, 0x58,
 				AVRCP_LIST_PLAYER_VALUES,
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 03/10] unit/avrcp: Add /TP/PAS/BI-02-C test
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Test verifies that List player application setting values returns error
when invalid attribute id is provided.
---
 unit/test-avrcp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index c3064da..089ec21 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -667,5 +667,18 @@ int main(int argc, char *argv[])
 				AVRCP_GET_PLAYER_ATTRIBUTE_TEXT,
 				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
 
+	/* List player application setting values invalid behavior - TG */
+	define_test("/TP/PAS/BI-02-C", test_server,
+			raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
+				0x00, 0x19, 0x58,
+				AVRCP_LIST_PLAYER_VALUES,
+				0x00, 0x00, 0x01,
+				/* Invalid attribute id */
+				0x7f),
+			raw_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_REJECTED,
+				0x48, 0x00, 0x00, 0x19, 0x58,
+				AVRCP_LIST_PLAYER_VALUES,
+				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
+
 	return g_test_run();
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 04/10] unit/avrcp: Add attributes and value check
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Adds check to get_player_value_text() and update test case.
---
 unit/test-avrcp.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index 089ec21..f7550f7 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -376,11 +376,28 @@ static ssize_t avrcp_handle_get_player_value_text(struct avrcp *session,
 						uint8_t *params,
 						void *user_data)
 {
-	DBG("");
+	int i;
 
-	if (params_len != 1)
+	DBG("attr_id %d num_vals %d len %d", params[0], params[1], params_len);
+
+	if (params_len != 2 + params[1])
 		return -EINVAL;
 
+	if (params[0] > AVRCP_ATTRIBUTE_LAST ||
+		    params[0] == AVRCP_ATTRIBUTE_ILEGAL)
+		return -EINVAL;
+
+	for (i = 2; i < 2 + params[1]; i++) {
+		DBG("Value 0x%02x", params[i]);
+
+		/* Check for invalid value */
+		switch (params[0]) {
+		case AVRCP_ATTRIBUTE_EQUALIZER:
+			if (params[i] < 0x01 || params[i] > 0x02)
+				return -EINVAL;
+		}
+	}
+
 	params[0] = 0;
 
 	return 1;
@@ -618,7 +635,8 @@ int main(int argc, char *argv[])
 			raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
 				0x00, 0x19, 0x58,
 				AVRCP_GET_PLAYER_VALUE_TEXT,
-				0x00, 0x00, 0x01, 0x00),
+				0x00, 0x00, 0x03, AVRCP_ATTRIBUTE_EQUALIZER,
+				0x01, 0x01),
 			raw_pdu(0x02, 0x11, 0x0e, 0x0c, 0x48, 0x00,
 				0x00, 0x19, 0x58,
 				AVRCP_GET_PLAYER_VALUE_TEXT,
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 05/10] unit/avrcp: Add /TP/PAS/BI-03-C test
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Test verifies thst Get player application setting value text returns
error for invalid attribute value.
---
 unit/test-avrcp.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index f7550f7..3a26a06 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -698,5 +698,19 @@ int main(int argc, char *argv[])
 				AVRCP_LIST_PLAYER_VALUES,
 				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
 
+	/* Get player application setting value text invalid behavior - TG */
+	define_test("/TP/PAS/BI-03-C", test_server,
+			raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
+				0x00, 0x19, 0x58,
+				AVRCP_GET_PLAYER_VALUE_TEXT,
+				0x00, 0x00, 0x03, AVRCP_ATTRIBUTE_EQUALIZER,
+				0x01,
+				/* Invalid setting value */
+				0x7f),
+			raw_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_REJECTED,
+				0x48, 0x00, 0x00, 0x19, 0x58,
+				AVRCP_GET_PLAYER_VALUE_TEXT,
+				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
+
 	return g_test_run();
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 06/10] unit/avrcp: Add /TP/PAS/BI-04-C test
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Test verifies that Get current player application setting value return
error when given invalid attribute id.
---
 unit/test-avrcp.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index 3a26a06..447f3af 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -414,6 +414,9 @@ static ssize_t avrcp_handle_get_current_player_value(struct avrcp *session,
 
 	DBG("params[0] %d params_len %d", params[0], params_len);
 
+	if (!check_attributes(params))
+		return -EINVAL;
+
 	attributes = g_memdup(&params[1], params[0]);
 
 	for (i = 0; i < params[0]; i++) {
@@ -712,5 +715,18 @@ int main(int argc, char *argv[])
 				AVRCP_GET_PLAYER_VALUE_TEXT,
 				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
 
+	/* Get current player application setting value invalid behavior - TG */
+	define_test("/TP/PAS/BI-04-C", test_server,
+			raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
+				0x00, 0x19, 0x58,
+				AVRCP_GET_CURRENT_PLAYER_VALUE,
+				0x00, 0x00, 0x02, 0x01,
+				/* Invalid attribute */
+				0x7f),
+			raw_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_REJECTED,
+				0x48, 0x00, 0x00, 0x19, 0x58,
+				AVRCP_GET_CURRENT_PLAYER_VALUE,
+				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
+
 	return g_test_run();
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 07/10] unit/avrcp: Add /TP/PAS/BI-05-C test
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Test verifies that Set player application setting value returns error on
invalid attribute value.
---
 unit/test-avrcp.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index 447f3af..b67b89c 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -431,6 +431,34 @@ static ssize_t avrcp_handle_get_current_player_value(struct avrcp *session,
 	return params[0] * 2 + 1;
 }
 
+static ssize_t avrcp_handle_set_player_value(struct avrcp *session,
+						uint8_t transaction,
+						uint16_t params_len,
+						uint8_t *params,
+						void *user_data)
+{
+	int i;
+
+	DBG("params[0] %d params_len %d", params[0], params_len);
+
+	if (params_len != params[0] * 2 + 1)
+		return -EINVAL;
+
+	for (i = 0; i < params[0]; i++) {
+		uint8_t attr = params[i * 2 + 1];
+		uint8_t val = params[i * 2 + 2];
+
+		DBG("attr 0x%02x val 0x%02x", attr, val);
+		switch (attr) {
+		case AVRCP_ATTRIBUTE_REPEAT_MODE:
+			if (val < 0x01 || val > 0x05)
+				return -EINVAL;
+		}
+	}
+
+	return 1;
+}
+
 static const struct avrcp_control_handler control_handlers[] = {
 		{ AVRCP_GET_CAPABILITIES,
 					AVC_CTYPE_STATUS, AVC_CTYPE_STABLE,
@@ -450,6 +478,9 @@ static const struct avrcp_control_handler control_handlers[] = {
 		{ AVRCP_GET_CURRENT_PLAYER_VALUE,
 					AVC_CTYPE_STATUS, AVC_CTYPE_STABLE,
 					avrcp_handle_get_current_player_value },
+		{ AVRCP_SET_PLAYER_VALUE,
+					AVC_CTYPE_CONTROL, AVC_CTYPE_STABLE,
+					avrcp_handle_set_player_value },
 		{ },
 };
 
@@ -728,5 +759,17 @@ int main(int argc, char *argv[])
 				AVRCP_GET_CURRENT_PLAYER_VALUE,
 				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
 
+	/* Set player application setting value invalid behavior - TG */
+	define_test("/TP/PAS/BI-05-C", test_server,
+			raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x48, 0x00,
+				0x00, 0x19, 0x58,
+				AVRCP_SET_PLAYER_VALUE,
+				0x00, 0x00, 0x03, 0x01,
+				AVRCP_ATTRIBUTE_REPEAT_MODE, 0x7f),
+			raw_pdu(0x02, 0x11, 0x0e, AVC_CTYPE_REJECTED,
+				0x48, 0x00, 0x00, 0x19, 0x58,
+				AVRCP_SET_PLAYER_VALUE,
+				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
+
 	return g_test_run();
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 08/10] android/avrcp: Add avrcp_get_play_status() function
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

---
 android/avrcp-lib.c | 8 ++++++++
 android/avrcp-lib.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
index 63a1f88..cd39071 100644
--- a/android/avrcp-lib.c
+++ b/android/avrcp-lib.c
@@ -395,6 +395,14 @@ int avrcp_set_player_value(struct avrcp *session, uint8_t *attributes,
 				func, user_data);
 }
 
+int avrcp_get_play_status(struct avrcp *session, avctp_rsp_cb func,
+								void *user_data)
+{
+	return avrcp_send_req(session, AVC_CTYPE_STATUS, AVC_SUBUNIT_PANEL,
+				AVRCP_GET_PLAY_STATUS, NULL, 0, func,
+				user_data);
+}
+
 int avrcp_get_play_status_rsp(struct avrcp *session, uint8_t transaction,
 				uint32_t position, uint32_t duration,
 				uint8_t status)
diff --git a/android/avrcp-lib.h b/android/avrcp-lib.h
index 6bfdff2..ba1d84a 100644
--- a/android/avrcp-lib.h
+++ b/android/avrcp-lib.h
@@ -143,6 +143,8 @@ int avrcp_set_player_value(struct avrcp *session, uint8_t *attributes,
 int avrcp_get_current_player_value(struct avrcp *session, uint8_t *attrs,
 					uint8_t attr_count, avctp_rsp_cb func,
 					void *user_data);
+int avrcp_get_play_status(struct avrcp *session, avctp_rsp_cb func,
+							void *user_data);
 
 int avrcp_get_play_status_rsp(struct avrcp *session, uint8_t transaction,
 				uint32_t position, uint32_t duration,
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 09/10] unit/avrcp: Add /TP/MDI/BV-01-C test
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Test verifies Get play status command.
---
 unit/test-avrcp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index b67b89c..8682e63 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -530,6 +530,9 @@ static void test_client(gconstpointer data)
 						NULL, NULL);
 	}
 
+	if (g_str_equal(context->data->test_name, "/TP/MDI/BV-01-C"))
+		avrcp_get_play_status(context->session, NULL, NULL);
+
 	execute_context(context);
 }
 
@@ -771,5 +774,13 @@ int main(int argc, char *argv[])
 				AVRCP_SET_PLAYER_VALUE,
 				0x00, 0x00, 0x01, AVRCP_STATUS_INVALID_PARAM));
 
+	/* Media Information Commands */
+
+	/* Get play status - CT */
+	define_test("/TP/MDI/BV-01-C", test_client,
+			raw_pdu(0x00, 0x11, 0x0e, 0x01, 0x48, 0x00,
+				0x00, 0x19, 0x58, AVRCP_GET_PLAY_STATUS,
+				0x00, 0x00, 0x00));
+
 	return g_test_run();
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 10/10] doc: Update test coverage document
From: Andrei Emeltchenko @ 2014-03-05 14:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1394029952-3319-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

---
 doc/test-coverage.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/test-coverage.txt b/doc/test-coverage.txt
index 6568286..ab9b1e4 100644
--- a/doc/test-coverage.txt
+++ b/doc/test-coverage.txt
@@ -18,7 +18,7 @@ test-ringbuf		   3	Ring buffer functionality
 test-queue		   1	Queue handling functionality
 test-avdtp		  60	AVDTP qualification test cases
 test-avctp		   9	AVCTP qualification test cases
-test-avrcp		  24	AVRCP qualification test cases
+test-avrcp		  29	AVRCP qualification test cases
 test-gobex		  31	Generic OBEX functionality
 test-gobex-packet	   9	OBEX packet handling
 test-gobex-header	  28	OBEX header handling
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 1/4] android/hal-gatt-api: Rename Service ID to GATT Service ID
From: Jakub Tyszkowski @ 2014-03-05 14:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski

Use "GATT Service ID" instead "Service ID" inside ipc documentation
which is used to describe Core services like HAL_SERVICE_ID_GATT
himself.
---
 android/hal-ipc-api.txt | 46 ++++++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 43b79ec..4f1b74d 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1496,15 +1496,13 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 	Opcode 0x09 - Get Included Service command/response
 
 		Command parameters: Connection ID (4 octets)
-		                    Number of Service ID Elements (1 octet)
-		                    Service ID Elements (variable)
+		                    Number of GATT Service ID Elements (1 octet)
+		                    GATT Service ID Elements (variable)
 		Valid Number of Service ID Elements: 0x01
 		                                     0x02
-		Valid Service ID Element: UUID (16 octets)
-		                          Instance ID (1 octet)
-		                          Is Primary (1 octet)
-		Valid GATT ID: UUID (16 octets)
-		               Instance ID (1 octet)
+		Valid GATT Service ID Element: UUID (16 octets)
+		                               Instance ID (1 octet)
+		                               Is Primary (1 octet)
 		Response parameters: <none>
 
 		In case of an error, the error response will be returned.
@@ -1512,10 +1510,10 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 	Opcode 0x0a - Get Characteristic command/response
 
 		Command parameters: Connection ID (4 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    Number of GATT ID Elements (1 octet)
 		                    GATT ID Elements (variable)
-		Valid Service ID: as described in Get Included Service
+		Valid GATT Service ID: as described in Get Included Service
 		Valid Number of GATT ID Elements: 0x00
 		                                  0x01
 		Valid GATT ID Element: as described in Get Included Service
@@ -1526,10 +1524,10 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 	Opcode 0x0b - Get Descriptor command/response
 
 		Command parameters: Connection ID (4 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    Number of GATT ID Elements (1 octet)
 		                    GATT ID Elements (variable)
-		Valid Service ID: as described in Get Included Service
+		Valid GATT Service ID: as described in Get Included Service
 		Valid Number of GATT ID Elements: 0x01
 		                                  0x02
 		Valid GATT ID Element: as described in Get Included Service
@@ -1540,10 +1538,10 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 	Opcode 0x0c - Read Characteristic command/response
 
 		Command parameters: Connection ID (4 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    GATT ID (17 octets)
 		                    Authorization (4 octets)
-		Valid Service ID: as described in Get Included Service
+		Valid GATT Service ID: as described in Get Included Service
 		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
@@ -1552,13 +1550,13 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 	Opcode 0x0d - Write Characteristic command/response
 
 		Command parameters: Connection ID (4 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    GATT ID (17 octets)
 		                    Write Type (4 octets)
 		                    Length (4 octets)
 		                    Authorization Req. (4 octets)
 		                    Value (variable)
-		Valid Service ID: as described in Get Included Service
+		Valid GATT Service ID: as described in Get Included Service
 		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
@@ -1567,11 +1565,11 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 	Opcode 0x0e - Read Descriptor command/response
 
 		Command parameters: Connection ID (4 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    GATT ID (17 octets)
 		                    Descr. GATT ID (17 octets)
 		                    Authorization Req. (4 octets)
-		Valid Service ID: as described in Get Included Service
+		Valid GATT Service ID: as described in Get Included Service
 		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
@@ -1580,14 +1578,14 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 	Opcode 0x0f - Write Descriptor command/response
 
 		Command parameters: Connection ID (4 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    GATT ID (17 octets)
 		                    Descr. GATT ID (17 octets)
 		                    Write Type (4 octets)
 		                    Length (4 octets)
 		                    Authorization Req. (4 octets)
 		                    Value (variable)
-		Valid Service ID: as described in Get Included Service
+		Valid GATT Service ID: as described in Get Included Service
 		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
@@ -1605,7 +1603,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
 		Command parameters: Client Interface (4 octets)
 		                    Remote address (6 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    GATT ID (17 octets)
 		Response parameters: <none>
 
@@ -1615,7 +1613,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
 		Command parameters: Client Interface (4 octets)
 		                    Remote address (6 octets)
-		                    Service ID (18 octets)
+		                    GATT Service ID (18 octets)
 		                    GATT ID (17 octets)
 		Response parameters: <none>
 
@@ -1973,9 +1971,9 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         GATT Service ID (18 octets)
 		                         Service Handle (4 octets)
 
-		Valid Service ID: UUID (16 octets)
-		                  Instance ID (1 octet)
-		                  Is Primary (1 octet)
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
 
 	Opcode 0x96 - Included Service Added notification
 
-- 
1.9.0


^ permalink raw reply related

* [PATCH 2/4] android/hal-ipc-api: Fix documentation structure and notation
From: Jakub Tyszkowski @ 2014-03-05 14:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1394030639-28134-1-git-send-email-jakub.tyszkowski@tieto.com>

Clean up the documentation by using 'Element # ...' notation for
variable length arrays of structs, fixing whitespaces and reordering
some parts.
---
 android/hal-ipc-api.txt | 160 +++++++++++++++++++++++++++++++++++-------------
 1 file changed, 116 insertions(+), 44 deletions(-)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 4f1b74d..05bb4db 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -330,25 +330,28 @@ Notifications:
 
 		Notification parameters: Status (1 octect)
 		                         Num properties (1 octet)
-		                         Type[i] (1 octect)
-		                         Length[i] (2 octets)
-		                         Value[i] (variable)
+		                         Type # (1 octet)
+		                         Length # (2 octets)
+		                         Value # (variable)
+		                         ...
 
 	Opcode 0x83 - Remote Device Properties notification
 
 		Notification parameters: Status (1 octect)
 		                         Remote address (6 octets)
 		                         Num properties (1 octet)
-		                         Type[i] (1 octect)
-		                         Length[i] (2 octets)
-		                         Value[i] (variable)
+		                         Type # (1 octet)
+		                         Length # (2 octets)
+		                         Value # (variable)
+		                         ...
 
 	Opcode 0x84 - Device Found notification
 
 		Notification parameters: Num properties (1 octet)
-		                         Type[i] (1 octect)
-		                         Length[i] (2 octets)
-		                         Value[i] (variable)
+		                         Type # (1 octet)
+		                         Length # (2 octets)
+		                         Value # (variable)
+		                         ...
 
 	Opcode 0x85 - Discovery State Changed notification
 
@@ -1121,10 +1124,11 @@ Android HAL name: "health" (BT_PROFILE_HEALTH_ID)
 		                    Service name (string)
 		                    Service description (string)
 		                    Number of MDEP (1 octet)
-		                    MDEP Role[i] (1 octet)
-		                    Data type[i] (1 octet)
-		                    Channel type[i] (1 octet)
-		                    MDEP description (string)
+		                    MDEP Role # (1 octet)
+		                    Data type # (1 octet)
+		                    Channel type # (1 octet)
+		                    MDEP description # (string)
+		                    ...
 		Response parameters: Application ID (2 octets)
 
 		In case of an error, the error response will be returned.
@@ -1486,10 +1490,12 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
 		Command parameters: Connection ID (4 octets)
 		                    Number of UUID Filters (1 octet)
-		                    UUID Filter (variable)
+		                    UUID Filter # (16 octets)
+		                    ...
+		Response parameters: <none>
+
 		Valid Number of UUID Filters: 0x00
 		                              0x01
-		Response parameters: <none>
 
 		In case of an error, the error response will be returned.
 
@@ -1497,14 +1503,15 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
 		Command parameters: Connection ID (4 octets)
 		                    Number of GATT Service ID Elements (1 octet)
-		                    GATT Service ID Elements (variable)
-		Valid Number of Service ID Elements: 0x01
-		                                     0x02
-		Valid GATT Service ID Element: UUID (16 octets)
-		                               Instance ID (1 octet)
-		                               Is Primary (1 octet)
+		                    GATT Service ID # UUID (16 octets)
+		                    GATT Service ID # Instance ID (1 octet)
+		                    GATT Service ID # Is Primary (1 octet)
+		                    ...
 		Response parameters: <none>
 
+		Valid Number of GATT Service ID Elements: 0x01
+		                                          0x02
+
 		In case of an error, the error response will be returned.
 
 	Opcode 0x0a - Get Characteristic command/response
@@ -1512,12 +1519,17 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		Command parameters: Connection ID (4 octets)
 		                    GATT Service ID (18 octets)
 		                    Number of GATT ID Elements (1 octet)
-		                    GATT ID Elements (variable)
-		Valid GATT Service ID: as described in Get Included Service
+		                    GATT ID # UUID (16 octets)
+		                    GATT ID # Instance ID (1 octet)
+		                    ...
+		Response parameters: <none>
+
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
 		Valid Number of GATT ID Elements: 0x00
 		                                  0x01
-		Valid GATT ID Element: as described in Get Included Service
-		Response parameters: <none>
 
 		In case of an error, the error response will be returned.
 
@@ -1526,12 +1538,17 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		Command parameters: Connection ID (4 octets)
 		                    GATT Service ID (18 octets)
 		                    Number of GATT ID Elements (1 octet)
-		                    GATT ID Elements (variable)
-		Valid GATT Service ID: as described in Get Included Service
+		                    GATT ID # UUID (16 octets)
+		                    GATT ID # Instance ID (1 octet)
+		                    ...
+		Response parameters: <none>
+
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
 		Valid Number of GATT ID Elements: 0x01
 		                                  0x02
-		Valid GATT ID Element: as described in Get Included Service
-		Response parameters: <none>
 
 		In case of an error, the error response will be returned.
 
@@ -1541,10 +1558,15 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                    GATT Service ID (18 octets)
 		                    GATT ID (17 octets)
 		                    Authorization (4 octets)
-		Valid GATT Service ID: as described in Get Included Service
-		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
+		Valid GATT ID: UUID (16 octets)
+		               Instance ID (1 octet)
+
 		In case of an error, the error response will be returned.
 
 	Opcode 0x0d - Write Characteristic command/response
@@ -1556,10 +1578,15 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                    Length (4 octets)
 		                    Authorization Req. (4 octets)
 		                    Value (variable)
-		Valid GATT Service ID: as described in Get Included Service
-		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
+		Valid GATT ID: UUID (16 octets)
+		               Instance ID (1 octet)
+
 		In case of an error, the error response will be returned.
 
 	Opcode 0x0e - Read Descriptor command/response
@@ -1569,10 +1596,18 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                    GATT ID (17 octets)
 		                    Descr. GATT ID (17 octets)
 		                    Authorization Req. (4 octets)
-		Valid GATT Service ID: as described in Get Included Service
-		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
+		Valid GATT ID: UUID (16 octets)
+		               Instance ID (1 octet)
+
+		Valid Descr. GATT ID: UUID (16 octets)
+		                      Instance ID (1 octet)
+
 		In case of an error, the error response will be returned.
 
 	Opcode 0x0f - Write Descriptor command/response
@@ -1585,10 +1620,18 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                    Length (4 octets)
 		                    Authorization Req. (4 octets)
 		                    Value (variable)
-		Valid GATT Service ID: as described in Get Included Service
-		Valid GATT ID: as described in Get Included Service
 		Response parameters: <none>
 
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
+		Valid GATT ID: UUID (16 octets)
+		               Instance ID (1 octet)
+
+		Valid Descr. GATT ID: UUID (16 octets)
+		                      Instance ID (1 octet)
+
 		In case of an error, the error response will be returned.
 
 	Opcode 0x10 - Execute Write command/response
@@ -1607,6 +1650,13 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                    GATT ID (17 octets)
 		Response parameters: <none>
 
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
+		Valid GATT ID: UUID (16 octets)
+		               Instance ID (1 octet)
+
 		In case of an error, the error response will be returned.
 
 	Opcode 0x12 - Deregister For Notification command/response
@@ -1617,6 +1667,13 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                    GATT ID (17 octets)
 		Response parameters: <none>
 
+		Valid GATT Service ID: UUID (16 octets)
+		                       Instance ID (1 octet)
+		                       Is Primary (1 octet)
+
+		Valid GATT ID: UUID (16 octets)
+		               Instance ID (1 octet)
+
 		In case of an error, the error response will be returned.
 
 	Opcode 0x13 - Read Remote RSSI command/response
@@ -1704,15 +1761,12 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		Command parameters: Server (4 octets)
 		                    GATT Service ID (18 octets)
 		                    Number of Handles (4 octet)
+		Response parameters: <none>
 
 		Valid GATT Service ID: UUID (16 octets)
-		                       Instance ID (1 octets)
+		                       Instance ID (1 octet)
 		                       Is Primary (1 octet)
 
-		Valid GATT ID: UUID (16 octets)
-		               Instance ID (1 octets)
-		Response parameters: <none>
-
 		In case of an error, the error response will be returned.
 
 	Opcode 0x1c - Add Included Service command/response
@@ -1788,6 +1842,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                    Transaction ID (4 octets)
 		                    Status (4 octets)
 		                    GATT Response (4 octets)
+		Response parameters: <none>
 
 		Valid GATT Response: GATT Value (607 octets)
 		                     Handle (2 octets)
@@ -1797,7 +1852,6 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                  Offset (2 octets)
 		                  Length (2 octets)
 		                  Authentication Request (1 octet)
-		Response parameters: <none>
 
 		In case of an error, the error response will be returned.
 
@@ -1837,6 +1891,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
 		Notification parameters: Connection ID (4 octets)
 		                         GATT Service ID (18 octets)
+
 		Valid GATT Service ID: UUID (16 octets)
 		                       Instance ID (1 octets)
 		                       Is Primary (1 octet)
@@ -1848,7 +1903,9 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         GATT Service ID (18 octets)
 		                         GATT Char. ID (17 octets)
 		                         Char Prop. (4 octets)
+
 		Valid GATT Service: As described in Search Result
+
 		Valid GATT Char. ID: UUID (16 octets)
 		                     Instance ID (1 octet)
 
@@ -1859,7 +1916,9 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         GATT Service ID (18 octets)
 		                         GATT Char. ID (17 octets)
 		                         GATT Descr. ID (17 octets)
+
 		Valid GATT Service & Char. ID: As described in Get Characteristic
+
 		Valid GATT Descr. ID: UUID (16 octets)
 		                      Instance ID (1 octet)
 
@@ -1869,6 +1928,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Status (4 octets)
 		                         GATT Service ID (18 octets)
 		                         GATT Incl. Service ID (18 octets)
+
 		Valid GATT Service & Incl. Service ID: As described in Search Result
 
 	Opcode 0x8a - Register For Notification notification
@@ -1878,7 +1938,9 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Status (4 octets)
 		                         GATT Service ID (18 octets)
 		                         GATT Char. ID (17 octets)
+
 		Valid GATT Service ID: As described in Get Characteristic
+
 		Valid GATT Char. ID: As described in Get Characteristic
 
 	Opcode 0x8b - Notify notification
@@ -1890,7 +1952,9 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Is Notify (1 octet)
 		                         Length (2 octets)
 		                         Value (variable)
-		Valid Service ID: As described in Get Characteristic
+
+		Valid GATT Service ID: As described in Get Characteristic
+
 		Valid GATT Char. ID: As described in Get Characteristic
 
 	Opcode 0x8c - Read Characteristic notification
@@ -1898,6 +1962,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		Notification parameters: Connection ID (4 octets)
 		                         Status (4 octets)
 		                         GATT Read Parameters (variable)
+
 		Valid GATT Read Parameters: GATT Service ID (18 octets)
 		                            GATT Char. ID (17 octets)
 		                            GATT Descr. ID (17 octets)
@@ -1905,7 +1970,9 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                            Status (1 octet)
 		                            Length (2 octets)
 		                            Value (variable)
+
 		Valid GATT Service ID: As described in Get Characteristic
+
 		Valid GATT Char. & Decr. ID: As described in Get Descriptor
 
 	Opcode 0x8d - Write Characteristic notification
@@ -1913,11 +1980,14 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		Notification parameters: Connection ID (4 octets)
 		                         Status (4 octets)
 		                         GATT Write Parameters (53 octets)
+
 		Valid GATT Write Parameters: GATT Service ID (18 octets)
 		                             GATT Characteristic ID (17 octets)
 		                             GATT Description ID (17 octets)
 		                             Status (1 octet)
+
 		Valid GATT Service ID: As described in Get Descriptor
+
 		Valid GATT Char. & Decr. ID: As described in Get Descriptor
 
 	Opcode 0x8e - Read Descriptor notification
@@ -1925,6 +1995,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		Notification parameters: Connection ID (4 octets)
 		                         Status (4 octets)
 		                         GATT Read Parameters (variable)
+
 		Valid GATT Read Parameters: As described in Read Characteristic
 
 	Opcode 0x8f - Write Descriptor notification
@@ -1932,6 +2003,7 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		Notification parameters: Connection ID (4 octets)
 		                         Status (4 octets)
 		                         GATT Write Parameters (53 octets)
+
 		Valid GATT Write Parameters: As described in Write Characteristic
 
 	Opcode 0x90 - Execute Write notification
-- 
1.9.0


^ permalink raw reply related

* [PATCH 3/4] android/hal-ipc-api: Add missing sections in doc
From: Jakub Tyszkowski @ 2014-03-05 14:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1394030639-28134-1-git-send-email-jakub.tyszkowski@tieto.com>

---
 android/hal-ipc-api.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 05bb4db..cd6bc92 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -758,6 +758,8 @@ Android HAL name: "handsfree" (BT_PROFILE_HANDSFREE_ID)
 
 	Service modes:               0x01 = Headset Profile only mode
 
+Commands and responses:
+
 	Opcode 0x00 - Error response
 
 		Response parameters: Status (1 octet)
@@ -1102,6 +1104,8 @@ Bluetooth Health HAL (ID 7)
 
 Android HAL name: "health" (BT_PROFILE_HEALTH_ID)
 
+Commands and responses:
+
 	Opcode 0x00 - Error response
 
 		Response parameters: Status (1 octet)
@@ -1189,6 +1193,8 @@ Bluetooth Remote Control HAL (ID 8)
 
 Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
+Commands and responses:
+
 	Opcode 0x00 - Error response
 
 		Response parameters: Status (1 octet)
@@ -1324,6 +1330,8 @@ Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
 
 		In case of an error, the error response will be returned.
 
+Notifications:
+
 	Opcode 0x81 - Remote Features notification
 
 		Notification parameters: Remote address (6 octets)
@@ -1415,6 +1423,8 @@ Bluetooth GATT HAL (ID 9)
 
 Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
+Commands and responses:
+
 	Opcode 0x00 - Error response
 
 		Response parameters: Status (1 octet)
@@ -1855,6 +1865,8 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
 		In case of an error, the error response will be returned.
 
+Notifications:
+
 	Opcode 0x81 - Register Client notification
 
 		Notification parameters: Status (4 octets)
-- 
1.9.0


^ permalink raw reply related

* [PATCH 4/4] android/hal-ipc-api: Trivial typo fix in doc
From: Jakub Tyszkowski @ 2014-03-05 14:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1394030639-28134-1-git-send-email-jakub.tyszkowski@tieto.com>

---
 android/hal-ipc-api.txt | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index cd6bc92..1ecf75f 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -321,14 +321,14 @@ Notifications:
 
 	Opcode 0x81 - Adapter State Changed notification
 
-		Notifications parameters: State (1 octect)
+		Notifications parameters: State (1 octet)
 
 		Valid state values: 0x00 = Off
 		                    0x01 = On
 
 	Opcode 0x82 - Adapter Properties Changed notification
 
-		Notification parameters: Status (1 octect)
+		Notification parameters: Status (1 octet)
 		                         Num properties (1 octet)
 		                         Type # (1 octet)
 		                         Length # (2 octets)
@@ -337,7 +337,7 @@ Notifications:
 
 	Opcode 0x83 - Remote Device Properties notification
 
-		Notification parameters: Status (1 octect)
+		Notification parameters: Status (1 octet)
 		                         Remote address (6 octets)
 		                         Num properties (1 octet)
 		                         Type # (1 octet)
@@ -355,7 +355,7 @@ Notifications:
 
 	Opcode 0x85 - Discovery State Changed notification
 
-		Notifications parameters: State (1 octect)
+		Notifications parameters: State (1 octet)
 
 	Opcode 0x86 - PIN Request notification
 
@@ -373,7 +373,7 @@ Notifications:
 
 	Opcode 0x88 - Bond State Changed notification
 
-		Notification parameters: Status (1 octect)
+		Notification parameters: Status (1 octet)
 		                         Remote address (6 octets)
 		                         Bond state (1 octet)
 
@@ -383,19 +383,19 @@ Notifications:
 
 	Opcode 0x89 - ACL State Changed notification
 
-		Notification parameters: Status (1 octect)
+		Notification parameters: Status (1 octet)
 		                         Remote address (6 octets)
 		                         ACL state (1 octet)
 
 	Opcode 0x8a - DUT Mode Receive notification
 
-		Notification parameters: Opcode (2 octects)
+		Notification parameters: Opcode (2 octets)
 		                         Length  (1 octet)
 		                         Data (variable)
 
 	Opcode 0x8b - LE Test Mode notification
 
-		Notification parameters: Status (1 octect)
+		Notification parameters: Status (1 octet)
 		                         Num packets (2 octets)
 
 
@@ -722,7 +722,7 @@ Notifications:
 
 	Opcode 0x81 - Control State notification
 
-		Notification parameters: Control state (1 octect)
+		Notification parameters: Control state (1 octet)
 		                         Status (1 octet)
 		                         Local role (1 octet)
 		                         Interface name (17 octet)
@@ -736,7 +736,7 @@ Notifications:
 
 	Opcode 0x82 - Connection State notification
 
-		Notification parameters: Connection state (1 octect)
+		Notification parameters: Connection state (1 octet)
 		                         Status (1 octet)
 		                         Remote address (6 octets)
 		                         Local role (1 octet)
@@ -950,7 +950,7 @@ Notifications:
 
 	Opcode 0x81 - Connection State notification
 
-		Notification parameters: Connection state (1 octect)
+		Notification parameters: Connection state (1 octet)
 		                         Remote address (6 octets)
 
 		Valid connection states: 0x00 = Disconnected
@@ -961,7 +961,7 @@ Notifications:
 
 	Opcode 0x82 - Audio State notification
 
-		Notification parameters: Audio state (1 octect)
+		Notification parameters: Audio state (1 octet)
 		                         Remote address (6 octets)
 
 		Valid audio states: 0x00 = Disconnected
@@ -1081,7 +1081,7 @@ Notifications:
 
 	Opcode 0x81 - Connection State notification
 
-		Notification parameters: Connection state (1 octect)
+		Notification parameters: Connection state (1 octet)
 		                         Remote address (6 octets)
 
 		Valid connection states: 0x00 = Disconnected
@@ -1091,7 +1091,7 @@ Notifications:
 
 	Opcode 0x82 - Audio State notification
 
-		Notification parameters: Audio state (1 octect)
+		Notification parameters: Audio state (1 octet)
 		                         Remote address (6 octets)
 
 		Valid connection states: 0x00 = Remote suspend
@@ -1164,7 +1164,7 @@ Notifications:
 
 	Opcode 0x81 - Application Registration State notification
 
-		Notification parameters: Application ID (2 octects)
+		Notification parameters: Application ID (2 octets)
 		                         Application state (1 octet)
 
 		Valid application states: 0x00 = Registration success
@@ -1174,7 +1174,7 @@ Notifications:
 
 	Opcode 0x82 - Channel State notification
 
-		Notification parameters: Application ID (2 octects)
+		Notification parameters: Application ID (2 octets)
 		                         Remote address (6 octets)
 		                         MDEP index (1 octet)
 		                         Channel ID (2 octets)
-- 
1.9.0


^ permalink raw reply related

* Re: [PATCH] Revert "Bluetooth: Use devname:vhci module alias for virtual HCI driver"
From: Josh Boyer @ 2014-03-05 15:28 UTC (permalink / raw)
  To: Thomas Bächler
  Cc: Marcel Holtmann, Gustavo Padovan, Johan Hedberg, linux-bluetooth,
	Linux-Kernel@Vger. Kernel. Org
In-Reply-To: <1394020752-6186-1-git-send-email-thomas@archlinux.org>

On Wed, Mar 5, 2014 at 6:59 AM, Thomas B=E4chler <thomas@archlinux.org> wro=
te:
> Adding the devname:vhci alias and thus adding a static /dev/vhci device n=
ode
> only works when assigning a fixed major/minor number. However, the code
> currently uses a dynamically assigned minor number. It is therefore impos=
sible
> to create a static device and to autoload the module when accessing it.
>
> Reverting this fixes the kmod error message
>  depmod: ERROR: Module 'hci_vhci' has devname (vhci) but lacks major and =
minor information. Ignoring.
>
> This reverts commit bfacbb9aec029b3200053d84c8cd5d7575f2d4a5.

We've had several reports of this in Fedora as well.  I hadn't gotten
around to digging into it yet, so thanks for bringing this up Thomas.

josh

> ---
>  drivers/bluetooth/hci_vhci.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
> index 1ef6990..cf05d70 100644
> --- a/drivers/bluetooth/hci_vhci.c
> +++ b/drivers/bluetooth/hci_vhci.c
> @@ -384,4 +384,3 @@ MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"=
);
>  MODULE_DESCRIPTION("Bluetooth virtual HCI driver ver " VERSION);
>  MODULE_VERSION(VERSION);
>  MODULE_LICENSE("GPL");
> -MODULE_ALIAS("devname:vhci");
> --
> 1.9.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" i=
n
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply

* Re: [PATCH] android/avdtp: Fix crash when DISCOVER failed
From: Szymon Janc @ 2014-03-05 15:46 UTC (permalink / raw)
  To: Andrzej Kaczmarek; +Cc: linux-bluetooth
In-Reply-To: <1394028150-2199-1-git-send-email-andrzej.kaczmarek@tieto.com>

Hi Andrzej,

On Wednesday 05 of March 2014 15:02:30 Andrzej Kaczmarek wrote:
> Discover callback is only set when avdtp_discover was successful so we
> need to check if it's set before calling.
> ---
>  android/avdtp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/android/avdtp.c b/android/avdtp.c
> index f104e3e..96c7d0d 100644
> --- a/android/avdtp.c
> +++ b/android/avdtp.c
> @@ -937,7 +937,8 @@ static void finalize_discovery(struct avdtp *session, int err)
>  	if (discover->id > 0)
>  		g_source_remove(discover->id);
>  
> -	discover->cb(session, session->seps, err ? &avdtp_err : NULL,
> +	if (discover->cb)
> +		discover->cb(session, session->seps, err ? &avdtp_err : NULL,
>  							discover->user_data);
>  	g_free(discover);
>  }
> 

Applied.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH] Revert "Bluetooth: Use devname:vhci module alias for virtual HCI driver"
From: Johan Hedberg @ 2014-03-05 16:11 UTC (permalink / raw)
  To: Josh Boyer; +Cc: Thomas Bächler, linux-bluetooth
In-Reply-To: <CA+5PVA5JuMLLG82YB8Z2FrOz3a0JrbeGzjamGYh1Qt89LtBEfA@mail.gmail.com>

Hi,

On Wed, Mar 05, 2014, Josh Boyer wrote:
> On Wed, Mar 5, 2014 at 6:59 AM, Thomas Bächler <thomas@archlinux.org> wrote:
> > Adding the devname:vhci alias and thus adding a static /dev/vhci device node
> > only works when assigning a fixed major/minor number. However, the code
> > currently uses a dynamically assigned minor number. It is therefore impossible
> > to create a static device and to autoload the module when accessing it.
> >
> > Reverting this fixes the kmod error message
> >  depmod: ERROR: Module 'hci_vhci' has devname (vhci) but lacks major and minor information. Ignoring.
> >
> > This reverts commit bfacbb9aec029b3200053d84c8cd5d7575f2d4a5.
> 
> We've had several reports of this in Fedora as well.  I hadn't gotten
> around to digging into it yet, so thanks for bringing this up Thomas.

How does this relate to the "Bluetooth: allocate static minor for vhci"
patch that we have in the bluetooth-next tree (also in wireless-next,
going to the 3.15 kernel). It's commit b075dd40c95d11c2c8690f6c4d6232fc.

Johan

^ permalink raw reply

* Re: [PATCH 0/8] Initial AT handling for handsfree
From: Szymon Janc @ 2014-03-05 16:14 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393947130-11999-1-git-send-email-szymon.janc@tieto.com>

On Tuesday 04 of March 2014 16:32:02 Szymon Janc wrote:
> Hi,
> 
> This adds initial minimal set of AT commands to establish SLC connection.
> 
> Szymon Janc (8):
>   android/handsfree: Add support for AT+BRSF command
>   android/handsfree: Add support for AT+CIND command
>   android/handsfree: Add support for AT+CMER command
>   android/handsfree: Distinguish between HSP and HFP connection
>   shared/hfp: Add function to check if reach end of command
>   shared/hfp: Add hfp_gw_result_get_number_default function
>   android/handsfree: Add support for AT+BIA command
>   android/handsfree: Make connection state constants name shorter
> 
>  android/hal-msg.h   |  10 +-
>  android/handsfree.c | 266 +++++++++++++++++++++++++++++++++++++++++++++++++---
>  src/shared/hfp.c    |  20 ++++
>  src/shared/hfp.h    |   4 +
>  4 files changed, 282 insertions(+), 18 deletions(-)

Updated version of those patches is now pushed upstream.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH] Revert "Bluetooth: Use devname:vhci module alias for virtual HCI driver"
From: Marcel Holtmann @ 2014-03-05 16:46 UTC (permalink / raw)
  To: Thomas Bächler
  Cc: Gustavo F. Padovan, Johan Hedberg, linux-bluetooth, linux-kernel
In-Reply-To: <1394020752-6186-1-git-send-email-thomas@archlinux.org>

Hi Thomas,

> Adding the devname:vhci alias and thus adding a static /dev/vhci device node
> only works when assigning a fixed major/minor number. However, the code
> currently uses a dynamically assigned minor number. It is therefore impossible
> to create a static device and to autoload the module when accessing it.
> 
> Reverting this fixes the kmod error message
> depmod: ERROR: Module 'hci_vhci' has devname (vhci) but lacks major and minor information. Ignoring.
> 
> This reverts commit bfacbb9aec029b3200053d84c8cd5d7575f2d4a5.

NAK. We allocated a static minor for this.

Regards

Marcel


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox