Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] android/hid: Add handling of incoming connections
From: Luiz Augusto von Dentz @ 2013-10-31 12:19 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 android/hid.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/android/hid.c b/android/hid.c
index 49e9c52..92efd72 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -45,6 +45,8 @@
 #define MAX_READ_BUFFER		4096
 
 static GIOChannel *notification_io = NULL;
+static GIOChannel *ctrl_io = NULL;
+static GIOChannel *intr_io = NULL;
 static GSList *devices = NULL;
 
 struct hid_device {
@@ -313,12 +315,94 @@ void bt_hid_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len)
 	ipc_send_rsp(io, HAL_SERVICE_ID_HIDHOST, status);
 }
 
+static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
+{
+	struct hid_device *hdev;
+	bdaddr_t dst;
+	char address[18];
+	uint16_t psm;
+	GError *gerr = NULL;
+	GSList *l;
+
+	if (err) {
+		error("%s", err->message);
+		return;
+	}
+
+	bt_io_get(chan, &err,
+			BT_IO_OPT_DEST_BDADDR, &dst,
+			BT_IO_OPT_PSM, &psm,
+			BT_IO_OPT_INVALID);
+	if (err) {
+		error("%s", gerr->message);
+		g_io_channel_shutdown(chan, TRUE, NULL);
+		return;
+	}
+
+	ba2str(&dst, address);
+	DBG("Incoming connection from %s on PSM %d", address, psm);
+
+	switch (psm) {
+	case L2CAP_PSM_HIDP_CTRL:
+		l = g_slist_find_custom(devices, &dst, device_cmp);
+		if (l)
+			return;
+
+		hdev = g_new0(struct hid_device, 1);
+		bacpy(&hdev->dst, &dst);
+		hdev->ctrl_io = g_io_channel_ref(chan);
+
+		devices = g_slist_append(devices, hdev);
+
+		hdev->ctrl_watch = g_io_add_watch(hdev->ctrl_io,
+					G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+					ctrl_watch_cb, hdev);
+
+		break;
+
+	case L2CAP_PSM_HIDP_INTR:
+		l = g_slist_find_custom(devices, &dst, device_cmp);
+		if (!l)
+			return;
+
+		hdev = l->data;
+		hdev->intr_io = g_io_channel_ref(chan);
+		hdev->intr_watch = g_io_add_watch(hdev->intr_io,
+				G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+				intr_watch_cb, hdev);
+		break;
+	}
+}
+
 bool bt_hid_register(GIOChannel *io, const bdaddr_t *addr)
 {
+	GError *err = NULL;
+
 	DBG("");
 
 	notification_io = g_io_channel_ref(io);
 
+	ctrl_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &err,
+				BT_IO_OPT_PSM, L2CAP_PSM_HIDP_CTRL,
+				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
+				BT_IO_OPT_INVALID);
+	if (!ctrl_io) {
+		error("Failed to listen on control channel");
+		g_error_free(err);
+		return false;
+	}
+
+	intr_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &err,
+				BT_IO_OPT_PSM, L2CAP_PSM_HIDP_INTR,
+				BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
+				BT_IO_OPT_INVALID);
+	if (!intr_io) {
+		error("Failed to listen on interrupt channel");
+		g_io_channel_unref(ctrl_io);
+		g_error_free(err);
+		return false;
+	}
+
 	return true;
 }
 
@@ -328,4 +412,10 @@ void bt_hid_unregister(void)
 
 	g_io_channel_unref(notification_io);
 	notification_io = NULL;
+
+	g_io_channel_unref(ctrl_io);
+	ctrl_io = NULL;
+
+	g_io_channel_unref(intr_io);
+	intr_io = NULL;
 }
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH BlueZ 2/3] android/hal-hidhost: Add implementation of .connection_state_cb
From: Luiz Augusto von Dentz @ 2013-10-31 12:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1383221988-1601-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 android/hal-hidhost.c   | 25 +++++++++++++++++++++++++
 android/hal-ipc-api.txt |  1 +
 android/hal-ipc.c       |  3 +++
 android/hal-msg.h       | 14 ++++++++++++++
 android/hal.h           |  1 +
 5 files changed, 44 insertions(+)

diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index 032e961..9354b95 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -31,6 +31,31 @@ static bool interface_ready(void)
 	return bt_hh_cbacks != NULL;
 }
 
+static void handle_conn_state(void *buf)
+{
+	struct hal_ev_hid_conn_state *ev = buf;
+
+	if (bt_hh_cbacks->connection_state_cb)
+		bt_hh_cbacks->connection_state_cb((bt_bdaddr_t *) (ev->bdaddr),
+								ev->state);
+}
+
+/* will be called from notification thread context */
+void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
+{
+	if (!interface_ready())
+		return;
+
+	switch (opcode) {
+	case HAL_EV_HID_CONN_STATE:
+		handle_conn_state(buf);
+		break;
+	default:
+		DBG("Unhandled callback opcode=0x%x", opcode);
+		break;
+	}
+}
+
 static bt_status_t hh_connect(bt_bdaddr_t *bd_addr)
 {
 	struct hal_cmd_hid_connect cmd;
diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index a5d1980..6b11684 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -574,6 +574,7 @@ Notifications:
 	Opcode 0x81 - Connection State notification
 
 		Notification parameters: Remote address (6 octets)
+		                         Connection State (1 octets)
 
 		Valid connection states: 0x00 = Connected
 		                         0x01 = Connecting
diff --git a/android/hal-ipc.c b/android/hal-ipc.c
index f68e789..14be69b 100644
--- a/android/hal-ipc.c
+++ b/android/hal-ipc.c
@@ -49,6 +49,9 @@ static void notification_dispatch(struct hal_hdr *msg, int fd)
 	case HAL_SERVICE_ID_BLUETOOTH:
 		bt_notify_adapter(msg->opcode, msg->payload, msg->len);
 		break;
+	case HAL_SERVICE_ID_HIDHOST:
+		bt_notify_hh(msg->opcode, msg->payload, msg->len);
+		break;
 	case HAL_SERVICE_ID_A2DP:
 		bt_notify_av(msg->opcode, msg->payload, msg->len);
 		break;
diff --git a/android/hal-msg.h b/android/hal-msg.h
index dfe73cc..b792411 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -423,6 +423,20 @@ struct hal_ev_le_test_mode {
 	uint16_t num_packets;
 } __attribute__((packed));
 
+#define HAL_HID_STATE_CONNECTED		0x00
+#define HAL_HID_STATE_CONNECTING	0x01
+#define HAL_HID_STATE_DISCONNECTED	0x02
+#define HAL_HID_STATE_DISCONNECTING	0x03
+#define HAL_HID_STATE_NO_HID		0x07
+#define HAL_HID_STATE_FAILED		0x08
+#define HAL_HID_STATE_UNKNOWN		0x09
+
+#define HAL_EV_HID_CONN_STATE		0x81
+struct hal_ev_hid_conn_state {
+	uint8_t bdaddr[6];
+	uint8_t state;
+} __attribute__((packed));
+
 #define HAL_EV_AV_CONNECTION_STATE	0x81
 struct hal_ev_av_connection_state {
 	uint8_t state;
diff --git a/android/hal.h b/android/hal.h
index a377649..5d6a93e 100644
--- a/android/hal.h
+++ b/android/hal.h
@@ -29,4 +29,5 @@ btav_interface_t *bt_get_av_interface(void);
 void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len);
 void bt_thread_associate(void);
 void bt_thread_disassociate(void);
+void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len);
 void bt_notify_av(uint16_t opcode, void *buf, uint16_t len);
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH BlueZ 3/3] android/hid: Add handling of HAL_EV_HID_CONN_STATE
From: Luiz Augusto von Dentz @ 2013-10-31 12:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1383221988-1601-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This patches generate proper events when the connection state changes:

>hidhost connect
BlueZ D: android/hal-hidhost.c:hh_connect()
connection_state_cb: bd_addr= connection_state=BTHH_CONN_STATE_CONNECTING
if_hh->connect: BT_STATUS_SUCCESS
connection_state_cb: bd_addr= connection_state=BTHH_CONN_STATE_CONNECTED
>hidhost disconnect
BlueZ D: android/hal-hidhost.c:hh_disconnect()
connection_state_cb: bd_addr= connection_state=BTHH_CONN_STATE_DISCONNECTING
if_hh->disconnect: BT_STATUS_SUCCESS
connection_state_cb: bd_addr= connection_state=BTHH_CONN_STATE_DISCONNECTED
---
 android/hid.c | 46 +++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 39 insertions(+), 7 deletions(-)

diff --git a/android/hid.c b/android/hid.c
index 92efd72..5caa25b 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -51,6 +51,7 @@ static GSList *devices = NULL;
 
 struct hid_device {
 	bdaddr_t	dst;
+	uint8_t		state;
 	GIOChannel	*ctrl_io;
 	GIOChannel	*intr_io;
 	guint		ctrl_watch;
@@ -104,18 +105,34 @@ static gboolean intr_io_watch_cb(GIOChannel *chan, gpointer data)
 	return TRUE;
 }
 
+static void bt_hid_set_state(struct hid_device *hdev, uint8_t state)
+{
+	struct hal_ev_hid_conn_state ev;
+	char address[18];
+
+	if (hdev->state == state)
+		return;
+
+	hdev->state = state;
+
+	ba2str(&hdev->dst, address);
+	DBG("device %s state %u", address, state);
+
+	bdaddr2android(&hdev->dst, ev.bdaddr);
+	ev.state = state;
+
+	ipc_send(notification_io, HAL_SERVICE_ID_HIDHOST,
+				HAL_EV_HID_CONN_STATE, sizeof(ev), &ev, -1);
+}
+
 static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond,
 								gpointer data)
 {
 	struct hid_device *hdev = data;
-	char address[18];
 
 	if (cond & G_IO_IN)
 		return intr_io_watch_cb(chan, data);
 
-	ba2str(&hdev->dst, address);
-	DBG("Device %s disconnected", address);
-
 	/* Checking for ctrl_watch avoids a double g_io_channel_shutdown since
 	 * it's likely that ctrl_watch_cb has been queued for dispatching in
 	 * this mainloop iteration */
@@ -143,7 +160,7 @@ static gboolean ctrl_watch_cb(GIOChannel *chan, GIOCondition cond,
 	char address[18];
 
 	ba2str(&hdev->dst, address);
-	DBG("Device %s disconnected", address);
+	bt_hid_set_state(hdev, HAL_HID_STATE_DISCONNECTED);
 
 	/* Checking for intr_watch avoids a double g_io_channel_shutdown since
 	 * it's likely that intr_watch_cb has been queued for dispatching in
@@ -175,6 +192,8 @@ static void interrupt_connect_cb(GIOChannel *chan, GError *conn_err,
 				G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
 				intr_watch_cb, hdev);
 
+	bt_hid_set_state(hdev, HAL_HID_STATE_CONNECTED);
+
 	return;
 
 failed:
@@ -203,6 +222,7 @@ static void control_connect_cb(GIOChannel *chan, GError *conn_err,
 	DBG("");
 
 	if (conn_err) {
+		bt_hid_set_state(hdev, HAL_HID_STATE_DISCONNECTED);
 		error("%s", conn_err->message);
 		goto failed;
 	}
@@ -270,6 +290,7 @@ static uint8_t bt_hid_connect(struct hal_cmd_hid_connect *cmd, uint16_t len)
 	}
 
 	devices = g_slist_append(devices, hdev);
+	bt_hid_set_state(hdev, HAL_HID_STATE_CONNECTING);
 
 	return HAL_STATUS_SUCCESS;
 }
@@ -277,6 +298,7 @@ static uint8_t bt_hid_connect(struct hal_cmd_hid_connect *cmd, uint16_t len)
 static uint8_t bt_hid_disconnect(struct hal_cmd_hid_disconnect *cmd,
 								uint16_t len)
 {
+	struct hid_device *hdev;
 	GSList *l;
 	bdaddr_t dst;
 
@@ -291,7 +313,16 @@ static uint8_t bt_hid_disconnect(struct hal_cmd_hid_disconnect *cmd,
 	if (!l)
 		return HAL_STATUS_FAILED;
 
-	hid_device_free(l->data);
+	hdev = l->data;
+
+	/* Wait either channels to HUP */
+	if (hdev->intr_io)
+		g_io_channel_shutdown(hdev->intr_io, TRUE, NULL);
+
+	if (hdev->ctrl_io)
+		g_io_channel_shutdown(hdev->ctrl_io, TRUE, NULL);
+
+	bt_hid_set_state(hdev, HAL_HID_STATE_DISCONNECTING);
 
 	return HAL_STATUS_SUCCESS;
 }
@@ -357,7 +388,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
 		hdev->ctrl_watch = g_io_add_watch(hdev->ctrl_io,
 					G_IO_HUP | G_IO_ERR | G_IO_NVAL,
 					ctrl_watch_cb, hdev);
-
+		bt_hid_set_state(hdev, HAL_HID_STATE_CONNECTING);
 		break;
 
 	case L2CAP_PSM_HIDP_INTR:
@@ -370,6 +401,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
 		hdev->intr_watch = g_io_add_watch(hdev->intr_io,
 				G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
 				intr_watch_cb, hdev);
+		bt_hid_set_state(hdev, HAL_HID_STATE_CONNECTED);
 		break;
 	}
 }
-- 
1.8.3.1


^ permalink raw reply related

* [RFC] android/daemon: Fix not reporting scan mode to Java
From: Andrei Emeltchenko @ 2013-10-31 12:42 UTC (permalink / raw)
  To: linux-bluetooth

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

After set_adapter_property() higher layer expects callback to be returned
even if property is not changes. Otherwise Java timeouts and reset Bluetooth
enetring to the loop.
...
BluetoothAdapterState( 2850): Timeout will setting scan mode..
  Continuing with disable...
...
---
 android/adapter.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/android/adapter.c b/android/adapter.c
index 892e6bb..3622a72 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -631,21 +631,21 @@ static uint8_t set_scan_mode(void *buf, uint16_t len)
 	switch (*mode) {
 	case HAL_ADAPTER_SCAN_MODE_NONE:
 		if (!cur_conn && !cur_disc)
-			return HAL_STATUS_DONE;
+			goto done;
 
 		conn = false;
 		disc = false;
 		break;
 	case HAL_ADAPTER_SCAN_MODE_CONN:
 		if (cur_conn && !cur_disc)
-			return HAL_STATUS_DONE;
+			goto done;
 
 		conn = true;
 		disc = false;
 		break;
 	case HAL_ADAPTER_SCAN_MODE_CONN_DISC:
 		if (cur_conn && cur_disc)
-			return HAL_STATUS_DONE;
+			goto done;
 
 		conn = true;
 		disc = true;
@@ -665,6 +665,12 @@ static uint8_t set_scan_mode(void *buf, uint16_t len)
 	}
 
 	return HAL_STATUS_SUCCESS;
+
+done:
+	/* Android expects property changed callback */
+	scan_mode_changed();
+
+	return HAL_STATUS_DONE;
 }
 
 static uint8_t set_property(void *buf, uint16_t len)
-- 
1.7.10.4


^ permalink raw reply related

* Re: [PATCH BlueZ 1/3] android/hid: Add handling of incoming connections
From: Johan Hedberg @ 2013-10-31 13:00 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1383221988-1601-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Thu, Oct 31, 2013, Luiz Augusto von Dentz wrote:
> ---
>  android/hid.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 90 insertions(+)

All three patches have been applied (with one minor coding style fix to
2/3). Thanks.

Johan

^ permalink raw reply

* [PATCH v2 1/2] android: Always enable SSP if supported by controller
From: Szymon Janc @ 2013-10-31 13:15 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

There is no HAL function to enable/disable SSP so always enable it if
supported by controller.
---

v2:
  use missing_settings mask for checking if setting is enabled

 android/adapter.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/android/adapter.c b/android/adapter.c
index a3f9aa6..c6fcf96 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -490,6 +490,7 @@ static void read_info_complete(uint8_t status, uint16_t length, const void *para
 							void *user_data)
 {
 	const struct mgmt_rp_read_info *rp = param;
+	uint32_t missing_settings;
 	int err;
 
 	DBG("");
@@ -528,6 +529,13 @@ static void read_info_complete(uint8_t status, uint16_t length, const void *para
 	load_link_keys(NULL);
 
 	set_io_capability();
+
+	missing_settings = adapter->current_settings ^
+						adapter->supported_settings;
+
+	if (missing_settings & MGMT_SETTING_SSP)
+		set_mode(MGMT_OP_SET_SSP, 0x01);
+
 	set_mode(MGMT_OP_SET_PAIRABLE, 0x01);
 
 	return;
-- 
1.8.4.1


^ permalink raw reply related

* [PATCH v2 2/2] android: Set pairable mode only if it is not set
From: Szymon Janc @ 2013-10-31 13:15 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1383225309-7260-1-git-send-email-szymon.janc@tieto.com>

There is no need to set already set setting.
---
 android/adapter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/android/adapter.c b/android/adapter.c
index c6fcf96..f1a4258 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -536,7 +536,8 @@ static void read_info_complete(uint8_t status, uint16_t length, const void *para
 	if (missing_settings & MGMT_SETTING_SSP)
 		set_mode(MGMT_OP_SET_SSP, 0x01);
 
-	set_mode(MGMT_OP_SET_PAIRABLE, 0x01);
+	if (missing_settings & MGMT_SETTING_PAIRABLE)
+		set_mode(MGMT_OP_SET_PAIRABLE, 0x01);
 
 	return;
 
-- 
1.8.4.1


^ permalink raw reply related

* [PATCH] android: Add supported uuids when adapter initialized
From: Marcin Kraglak @ 2013-10-31 13:17 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Marcin Kraglak

It will set class of device with proper service hints.
We set it statically because we don't want to change
class of device while adding/removing sdp services.
---
 android/adapter.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/android/adapter.c b/android/adapter.c
index a3f9aa6..5a1cc9b 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -39,6 +39,29 @@
 
 static GIOChannel *notification_io = NULL;
 
+/*
+ * This is an array of supported uuids and service hints. We add them via mgmt
+ * interface when adapter is initialized. Uuids are in reverse orded.
+ */
+static const struct mgmt_cp_add_uuid sup_uuids[] = {
+	/* OBEX_OPP_UUID */
+	{ .uuid = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
+			0x00, 0x10, 0x00, 0x00, 0x05, 0x11, 0x00, 0x00 },
+	.svc_hint = 0x10 },
+	/* HFP_AG_UUID */
+	{ .uuid = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
+			0x00, 0x10, 0x00, 0x00, 0x1f, 0x11, 0x00, 0x00 },
+	.svc_hint = 0x40 },
+	/* ADVANCED_AUDIO_UUID */
+	{ .uuid = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
+			0x00, 0x10, 0x00, 0x00, 0x0d, 0x11, 0x00, 0x00 },
+	.svc_hint = 0x08 },
+	/* PANU_UUID */
+	{ .uuid = { 0xfb, 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00, 0x80,
+			0x00, 0x10, 0x00, 0x00, 0x15, 0x11, 0x00, 0x00 },
+	.svc_hint = 0x02 }
+};
+
 struct bt_adapter {
 	uint16_t index;
 	struct mgmt *mgmt;
@@ -438,6 +461,38 @@ static void load_link_keys(GSList *keys)
 	}
 }
 
+static void add_uuid_complete(uint8_t status, uint16_t length,
+					const void *param, void *user_data)
+{
+	if (status != MGMT_STATUS_SUCCESS) {
+		error("Failed to add UUID: %s (0x%02x)",
+						mgmt_errstr(status), status);
+		return;
+	}
+
+	mgmt_dev_class_changed_event(adapter->index, length, param, NULL);
+}
+
+static void add_uuids(void)
+{
+	unsigned int i;
+
+	for (i = 0; i < sizeof(sup_uuids) / sizeof(sup_uuids[0]); i++)
+		mgmt_send(adapter->mgmt, MGMT_OP_ADD_UUID, adapter->index,
+				sizeof(sup_uuids[i]), &sup_uuids[i],
+				add_uuid_complete, NULL, NULL);
+}
+
+static void clear_uuids(void)
+{
+	struct mgmt_cp_remove_uuid cp;
+
+	memset(&cp, 0, sizeof(cp));
+
+	mgmt_send(adapter->mgmt, MGMT_OP_REMOVE_UUID, adapter->index,
+			sizeof(cp), &cp, NULL, NULL, NULL);
+}
+
 static void set_mode_complete(uint8_t status, uint16_t length,
 					const void *param, void *user_data)
 {
@@ -530,6 +585,9 @@ static void read_info_complete(uint8_t status, uint16_t length, const void *para
 	set_io_capability();
 	set_mode(MGMT_OP_SET_PAIRABLE, 0x01);
 
+	clear_uuids();
+	add_uuids();
+
 	return;
 
 failed:
-- 
1.8.4.1


^ permalink raw reply related

* [PATCH] android/client: Don't alignt name property while printing
From: Szymon Janc @ 2013-10-31 13:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Received name property is guaranteed to be NULL terminated so there is
no need to use length specifier. This also fix really long space while
printing due to text alignment to the right.
---
 android/client/if-bt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/android/client/if-bt.c b/android/client/if-bt.c
index 16bd882..c9681fc 100644
--- a/android/client/if-bt.c
+++ b/android/client/if-bt.c
@@ -88,8 +88,7 @@ static char *btproperty2str(bt_property_t property)
 	switch (property.type) {
 	case BT_PROPERTY_BDNAME:
 	case BT_PROPERTY_REMOTE_FRIENDLY_NAME:
-		sprintf(p, "%*s", property.len,
-					((bt_bdname_t *) property.val)->name);
+		sprintf(p, "%s", ((bt_bdname_t *) property.val)->name);
 		break;
 
 	case BT_PROPERTY_BDADDR:
-- 
1.8.4.1


^ permalink raw reply related

* RE: l2cap sockets not properly multiplexed on ARM
From: Tim Tisdall @ 2013-10-31 13:31 UTC (permalink / raw)
  To: Alexander Holler, Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <527190DA.6000805@ahsoftware.de>

> As Anderson Lizardo already mentioned, maybe first verify that the x86=0A=
> kernel 3.4 doesn't have the same problem and that it's really a problem=
=0A=
> of the ARM kernel. Up to now he didn't say what kernel version he uses=0A=
> on x86.=0A=
=0A=
here's my desktop version:=0A=
$ uname -a=0A=
Linux tzing 3.8.0-32-generic #47-Ubuntu SMP Tue Oct 1 22:35:23 UTC 2013 x86=
_64 x86_64 x86_64 GNU/Linux=0A=
=0A=
I'm trying to get an older version of the kernel running on another machine=
 and then I'll report back=0A=

^ permalink raw reply

* Re: [PATCH] android/daemon: Fix error setting property
From: Johan Hedberg @ 2013-10-31 13:45 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1383220358-5436-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Thu, Oct 31, 2013, Andrei Emeltchenko wrote:
> Do not return error setting property which is already set. This fixes
> bug with set_scan_mode which might return HAL_STATUS_DONE.
> ---
>  android/adapter.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied. Thanks.

Johan

^ permalink raw reply

* Re: [RFC] android/daemon: Fix not reporting scan mode to Java
From: Johan Hedberg @ 2013-10-31 13:46 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1383223355-4628-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Thu, Oct 31, 2013, Andrei Emeltchenko wrote:
> After set_adapter_property() higher layer expects callback to be returned
> even if property is not changes. Otherwise Java timeouts and reset Bluetooth
> enetring to the loop.
> ...
> BluetoothAdapterState( 2850): Timeout will setting scan mode..
>   Continuing with disable...
> ...
> ---
>  android/adapter.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH v2 1/2] android: Always enable SSP if supported by controller
From: Johan Hedberg @ 2013-10-31 13:47 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1383225309-7260-1-git-send-email-szymon.janc@tieto.com>

Hi Szymon,

On Thu, Oct 31, 2013, Szymon Janc wrote:
> There is no HAL function to enable/disable SSP so always enable it if
> supported by controller.
> ---
> 
> v2:
>   use missing_settings mask for checking if setting is enabled
> 
>  android/adapter.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Both patches have been applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH] android/client: Don't alignt name property while printing
From: Johan Hedberg @ 2013-10-31 13:48 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1383225721-7579-1-git-send-email-szymon.janc@tieto.com>

Hi Szymon,

On Thu, Oct 31, 2013, Szymon Janc wrote:
> Received name property is guaranteed to be NULL terminated so there is
> no need to use length specifier. This also fix really long space while
> printing due to text alignment to the right.
> ---
>  android/client/if-bt.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied (after the obvious typo fix for the subject). Thanks.

Johan

^ permalink raw reply

* [PATCH] android/hidhost: Fix not unregistering HID
From: Andrei Emeltchenko @ 2013-10-31 13:51 UTC (permalink / raw)
  To: linux-bluetooth

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

If HID is not unregistered it cannot be registered again and we get
following error:
...
E/BluetoothHidServiceJni( 2849): Failed to initialize Bluetooth HID, status: 1
...
---
 android/hal-hidhost.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index a72410b..a81fea5 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -301,12 +301,17 @@ static bt_status_t hh_init(bthh_callbacks_t *callbacks)
 
 static void hh_cleanup(void)
 {
+	struct hal_cmd_unregister_module cmd;
+
 	DBG("");
 
 	if (!interface_ready())
 		return;
 
 	bt_hh_cbacks = NULL;
+
+	hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE,
+					sizeof(cmd), &cmd, 0, NULL, NULL);
 }
 
 static bthh_interface_t hh_if = {
-- 
1.7.10.4


^ permalink raw reply related

* Re: [PATCH 1/2] Bluetooth: Remove debug statement for features complete event
From: Johan Hedberg @ 2013-10-31 13:56 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth
In-Reply-To: <1383220473-33584-1-git-send-email-marcel@holtmann.org>

Hi Marcel,

On Thu, Oct 31, 2013, Marcel Holtmann wrote:
> The complete list of local features are available through debugfs and
> so there is no need to add a debug print here.
> 
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  net/bluetooth/hci_event.c | 6 ------
>  1 file changed, 6 deletions(-)

Both patches have been applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply

* [PATCH] android: Add support for setting adapters name
From: Grzegorz Kolodziejczyk @ 2013-10-31 14:00 UTC (permalink / raw)
  To: linux-bluetooth

---
 android/adapter.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 android/hal-msg.h |  2 ++
 2 files changed, 55 insertions(+)

diff --git a/android/adapter.c b/android/adapter.c
index 15b65e5..5dadc2e 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -129,6 +129,27 @@ static void scan_mode_changed(void)
 	g_free(ev);
 }
 
+static void adapter_name_changed(const uint8_t *name)
+{
+	struct hal_ev_adapter_props_changed *ev;
+	uint8_t buf[sizeof(*ev) + sizeof(struct hal_property) +
+							HAL_MAX_NAME_LENGTH];
+
+	memset(buf, 0, sizeof(buf));
+	ev = (void *) buf;
+
+	ev->num_props = 1;
+	ev->status = HAL_STATUS_SUCCESS;
+	ev->props[0].type = HAL_PROP_ADAPTER_NAME;
+	ev->props[0].len = HAL_MAX_NAME_LENGTH;
+	memcpy(ev->props->val, name, HAL_MAX_NAME_LENGTH);
+
+	DBG("Adapter name changed to: %s", ev->props->val);
+
+	ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
+			HAL_EV_ADAPTER_PROPS_CHANGED, sizeof(buf), ev, -1);
+}
+
 static void settings_changed(uint32_t settings)
 {
 	uint32_t changed_mask;
@@ -286,6 +307,37 @@ static bool set_mode(uint16_t opcode, uint8_t mode)
 	return false;
 }
 
+static void set_adapter_name_complete(uint8_t status, uint16_t length,
+					const void *param, void *user_data)
+{
+	const struct mgmt_cp_set_local_name *rp = param;
+
+	if (status != MGMT_STATUS_SUCCESS) {
+		error("Failed to set name: %s (0x%02x)",
+						mgmt_errstr(status), status);
+		return;
+	}
+
+	adapter_name_changed(rp->name);
+}
+
+static bool set_adapter_name(uint8_t *name, uint16_t len)
+{
+	struct mgmt_cp_set_local_name cp;
+
+	memset(&cp, 0, sizeof(cp));
+	memcpy(cp.name, name, len);
+
+	if (mgmt_send(adapter->mgmt, MGMT_OP_SET_LOCAL_NAME, adapter->index,
+			sizeof(cp), &cp, set_adapter_name_complete, NULL,
+								NULL) > 0)
+		return true;
+
+	error("Failed to set name");
+
+	return false;
+}
+
 static void read_info_complete(uint8_t status, uint16_t length, const void *param,
 							void *user_data)
 {
@@ -472,6 +524,7 @@ static uint8_t set_property(void *buf, uint16_t len)
 	case HAL_PROP_ADAPTER_SCAN_MODE:
 		return set_scan_mode(cmd->val, cmd->len);
 	case HAL_PROP_ADAPTER_NAME:
+		return set_adapter_name(cmd->val, cmd->len);
 	case HAL_PROP_ADAPTER_DISC_TIMEOUT:
 	default:
 		DBG("Unhandled property type 0x%x", cmd->type);
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 80b47d6..506d10c 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -89,6 +89,8 @@ struct hal_cmd_get_adapter_prop {
 	uint8_t type;
 } __attribute__((packed));
 
+#define HAL_MAX_NAME_LENGTH		249
+
 #define HAL_PROP_ADAPTER_NAME			0x01
 #define HAL_PROP_ADAPTER_ADDR			0x02
 #define HAL_PROP_ADAPTER_UUIDS			0x03
-- 
1.8.4.1


^ permalink raw reply related

* Re: [PATCH 00/10] Add GATT support to haltest
From: Johan Hedberg @ 2013-10-31 14:03 UTC (permalink / raw)
  To: Jerzy Kasenberg; +Cc: linux-bluetooth
In-Reply-To: <1383216315-30627-1-git-send-email-jerzy.kasenberg@tieto.com>

Hi Jerzy,

On Thu, Oct 31, 2013, Jerzy Kasenberg wrote:
> This patachset adds code to call GATT hal methods.
> Compiles on Android 4.3 and host.
> On 4.2 it's source code is not included.
> 
> Status that is used in callbacks is currently printed as number.
> This number corresponds to series of defines from file:
> external/bluedroid/stack/include/gatt_api.h
> This file looks like implementation detail for bluedroid.
> It's to be decided it defines should be copied to bluez source code.
> Until that status is printed as numbers.
> Same applies to tGATT_WRITE_TYPE which is used as argument in
> write_characteristic and write_descriptor.
> 
> Jerzy Kasenberg (10):
>   android/client: Add skeleton for GATT interface
>   android/client: Add GATT client callbacks code
>   android/client: Add complex GATT type formating
>   android/client: Add init/cleanup for GATT
>   android/client: Add helper macros to verify args
>   android/client: Add GATT client method calls
>   android/client: Add GATT complex type parsing
>   android/client: Add tab completion to GATT client
>   android/client: Add GATT server callbacks code
>   android/client: Add GATT server methods
> 
>  android/Android.mk       |    7 +
>  android/Makefile.am      |    2 +
>  android/client/haltest.c |    5 +
>  android/client/if-bt.c   |    2 +
>  android/client/if-gatt.c | 1733 ++++++++++++++++++++++++++++++++++++++++++++++
>  android/client/if-main.h |   14 +
>  6 files changed, 1763 insertions(+)
>  create mode 100644 android/client/if-gatt.c

All patches have been applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH] android/hidhost: Fix not unregistering HID
From: Johan Hedberg @ 2013-10-31 14:04 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1383227514-22944-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Thu, Oct 31, 2013, Andrei Emeltchenko wrote:
> If HID is not unregistered it cannot be registered again and we get
> following error:
> ...
> E/BluetoothHidServiceJni( 2849): Failed to initialize Bluetooth HID, status: 1
> ...
> ---
>  android/hal-hidhost.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
> index a72410b..a81fea5 100644
> --- a/android/hal-hidhost.c
> +++ b/android/hal-hidhost.c
> @@ -301,12 +301,17 @@ static bt_status_t hh_init(bthh_callbacks_t *callbacks)
>  
>  static void hh_cleanup(void)
>  {
> +	struct hal_cmd_unregister_module cmd;
> +
>  	DBG("");
>  
>  	if (!interface_ready())
>  		return;
>  
>  	bt_hh_cbacks = NULL;
> +
> +	hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE,
> +					sizeof(cmd), &cmd, 0, NULL, NULL);
>  }

Did you test this at all? It looks completely broken to me since you
pass an uninitialized variable to hal_ipc_cmd. You should be at least
setting the right service id for HID in the cmd struct.

Johan

^ permalink raw reply

* Re: [PATCH] android/hidhost: Fix not unregistering HID
From: Andrei Emeltchenko @ 2013-10-31 14:08 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <20131031140458.GB27325@x220.p-661hnu-f1>

Hi Johan,

On Thu, Oct 31, 2013 at 04:04:58PM +0200, Johan Hedberg wrote:
> Hi Andrei,
> 
> On Thu, Oct 31, 2013, Andrei Emeltchenko wrote:
> > If HID is not unregistered it cannot be registered again and we get
> > following error:
> > ...
> > E/BluetoothHidServiceJni( 2849): Failed to initialize Bluetooth HID, status: 1
> > ...
> > ---
> >  android/hal-hidhost.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
> > index a72410b..a81fea5 100644
> > --- a/android/hal-hidhost.c
> > +++ b/android/hal-hidhost.c
> > @@ -301,12 +301,17 @@ static bt_status_t hh_init(bthh_callbacks_t *callbacks)
> >  
> >  static void hh_cleanup(void)
> >  {
> > +	struct hal_cmd_unregister_module cmd;
> > +
> >  	DBG("");
> >  
> >  	if (!interface_ready())
> >  		return;
> >  
> >  	bt_hh_cbacks = NULL;
> > +
> > +	hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_UNREGISTER_MODULE,
> > +					sizeof(cmd), &cmd, 0, NULL, NULL);
> >  }
> 
> Did you test this at all? It looks completely broken to me since you
> pass an uninitialized variable to hal_ipc_cmd. You should be at least
> setting the right service id for HID in the cmd struct.

Sorry, I will send the right one (after testing)

Best regards 
Andrei Emeltchenko 

^ permalink raw reply

* RE: l2cap sockets not properly multiplexed on ARM
From: Tim Tisdall @ 2013-10-31 14:14 UTC (permalink / raw)
  To: Alexander Holler, Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <D9B9EB3A112B8F489DFFA00A6D5C0FE203241BE2@AD-BR-EX-2.adroot.flemingc.local>

Okay, I got the same issue on an x86 machine running "Linux debian 3.2.0-4-486 #1 Debian 3.2.51-1 i686 GNU/Linux".  So, it's not only the ARM machines.

What versions of the kernel are currently supported by the bluetooth team?  (ie when there are bug fixes, how far back will you backport those fixes?)  Am I coming across some issue that's already been fixed in newer versions of the kernel?

-Tim

^ permalink raw reply

* RE: l2cap sockets not properly multiplexed on ARM
From: Tim Tisdall @ 2013-10-31 14:18 UTC (permalink / raw)
  To: Alexander Holler, Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <D9B9EB3A112B8F489DFFA00A6D5C0FE203241C36@AD-BR-EX-2.adroot.flemingc.local>

Sorry, forgot to mention how I set up my testing environment...  I download=
ed the latest version of Debian 7.2 which uses the 3.2 kernel and ran it as=
 a live image off a USB drive.  So, you guys should be able to recreate it =
(if you wish) by snagging http://cdimage.debian.org/debian-cd/current-live/=
i386/iso-hybrid/debian-live-7.2-i386-standard.iso and then following http:/=
/www.debian.org/CD/faq/#write-usb to create a live usb image.=0A=
=0A=

^ permalink raw reply

* Re: l2cap sockets not properly multiplexed on ARM
From: Marcel Holtmann @ 2013-10-31 14:19 UTC (permalink / raw)
  To: Tim Tisdall; +Cc: Alexander Holler, linux-bluetooth@vger.kernel.org
In-Reply-To: <D9B9EB3A112B8F489DFFA00A6D5C0FE203241C36@AD-BR-EX-2.adroot.flemingc.local>

Hi Tim,

> Okay, I got the same issue on an x86 machine running "Linux debian 3.2.0-4-486 #1 Debian 3.2.51-1 i686 GNU/Linux".  So, it's not only the ARM machines.
> 
> What versions of the kernel are currently supported by the bluetooth team?  (ie when there are bug fixes, how far back will you backport those fixes?)  Am I coming across some issue that's already been fixed in newer versions of the kernel?

the upstream people are not backporting anything. The closest you get with upstream is if a patch is cheery picked into -stable. For everything else it is the distro’s job to backport.

Regards

Marcel


^ permalink raw reply

* Re: l2cap sockets not properly multiplexed on ARM
From: Marcel Holtmann @ 2013-10-31 14:20 UTC (permalink / raw)
  To: Tim Tisdall; +Cc: Alexander Holler, linux-bluetooth@vger.kernel.org
In-Reply-To: <D9B9EB3A112B8F489DFFA00A6D5C0FE203241BE2@AD-BR-EX-2.adroot.flemingc.local>

Hi Tim,

>> As Anderson Lizardo already mentioned, maybe first verify that the x86
>> kernel 3.4 doesn't have the same problem and that it's really a problem
>> of the ARM kernel. Up to now he didn't say what kernel version he uses
>> on x86.
> 
> here's my desktop version:
> $ uname -a
> Linux tzing 3.8.0-32-generic #47-Ubuntu SMP Tue Oct 1 22:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
> 
> I'm trying to get an older version of the kernel running on another machine and then I'll report back

I actually need to know if bluetooth-next tree still has this issue. That is first and foremost the one thing that needs to be checked.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH] android: Add support for setting adapters name
From: Andrei Emeltchenko @ 2013-10-31 14:21 UTC (permalink / raw)
  To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
In-Reply-To: <1383228038-4306-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

Hi Grzegorz,

On Thu, Oct 31, 2013 at 03:00:38PM +0100, Grzegorz Kolodziejczyk wrote:
> ---
>  android/adapter.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  android/hal-msg.h |  2 ++
>  2 files changed, 55 insertions(+)
> 
> diff --git a/android/adapter.c b/android/adapter.c
> index 15b65e5..5dadc2e 100644
> --- a/android/adapter.c
> +++ b/android/adapter.c
> @@ -129,6 +129,27 @@ static void scan_mode_changed(void)
>  	g_free(ev);
>  }
>  
> +static void adapter_name_changed(const uint8_t *name)
> +{
> +	struct hal_ev_adapter_props_changed *ev;
> +	uint8_t buf[sizeof(*ev) + sizeof(struct hal_property) +
> +							HAL_MAX_NAME_LENGTH];
> +
> +	memset(buf, 0, sizeof(buf));
> +	ev = (void *) buf;
> +
> +	ev->num_props = 1;
> +	ev->status = HAL_STATUS_SUCCESS;
> +	ev->props[0].type = HAL_PROP_ADAPTER_NAME;
> +	ev->props[0].len = HAL_MAX_NAME_LENGTH;

Do we need to pass always HAL_MAX_NAME_LENGTH ?

Best regards 
Andrei Emeltchenko 

> +	memcpy(ev->props->val, name, HAL_MAX_NAME_LENGTH);
> +
> +	DBG("Adapter name changed to: %s", ev->props->val);
> +
> +	ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
> +			HAL_EV_ADAPTER_PROPS_CHANGED, sizeof(buf), ev, -1);
> +}
> +
>  static void settings_changed(uint32_t settings)
>  {
>  	uint32_t changed_mask;
> @@ -286,6 +307,37 @@ static bool set_mode(uint16_t opcode, uint8_t mode)
>  	return false;
>  }
>  
> +static void set_adapter_name_complete(uint8_t status, uint16_t length,
> +					const void *param, void *user_data)
> +{
> +	const struct mgmt_cp_set_local_name *rp = param;
> +
> +	if (status != MGMT_STATUS_SUCCESS) {
> +		error("Failed to set name: %s (0x%02x)",
> +						mgmt_errstr(status), status);
> +		return;
> +	}
> +
> +	adapter_name_changed(rp->name);
> +}
> +
> +static bool set_adapter_name(uint8_t *name, uint16_t len)
> +{
> +	struct mgmt_cp_set_local_name cp;
> +
> +	memset(&cp, 0, sizeof(cp));
> +	memcpy(cp.name, name, len);
> +
> +	if (mgmt_send(adapter->mgmt, MGMT_OP_SET_LOCAL_NAME, adapter->index,
> +			sizeof(cp), &cp, set_adapter_name_complete, NULL,
> +								NULL) > 0)
> +		return true;
> +
> +	error("Failed to set name");
> +
> +	return false;
> +}
> +
>  static void read_info_complete(uint8_t status, uint16_t length, const void *param,
>  							void *user_data)
>  {
> @@ -472,6 +524,7 @@ static uint8_t set_property(void *buf, uint16_t len)
>  	case HAL_PROP_ADAPTER_SCAN_MODE:
>  		return set_scan_mode(cmd->val, cmd->len);
>  	case HAL_PROP_ADAPTER_NAME:
> +		return set_adapter_name(cmd->val, cmd->len);
>  	case HAL_PROP_ADAPTER_DISC_TIMEOUT:
>  	default:
>  		DBG("Unhandled property type 0x%x", cmd->type);
> diff --git a/android/hal-msg.h b/android/hal-msg.h
> index 80b47d6..506d10c 100644
> --- a/android/hal-msg.h
> +++ b/android/hal-msg.h
> @@ -89,6 +89,8 @@ struct hal_cmd_get_adapter_prop {
>  	uint8_t type;
>  } __attribute__((packed));
>  
> +#define HAL_MAX_NAME_LENGTH		249
> +
>  #define HAL_PROP_ADAPTER_NAME			0x01
>  #define HAL_PROP_ADAPTER_ADDR			0x02
>  #define HAL_PROP_ADAPTER_UUIDS			0x03
> -- 
> 1.8.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ 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