All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation
@ 2014-06-27  8:27 Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 02/15] android/dis: Strip dependencies from deviceinfo plugin Luiz Augusto von Dentz
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

---
v3: Fix passing wrong handle to g_attrib_register in ScPP

 profiles/deviceinfo/deviceinfo.c => android/dis.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 copy profiles/deviceinfo/deviceinfo.c => android/dis.c (100%)

diff --git a/profiles/deviceinfo/deviceinfo.c b/android/dis.c
similarity index 100%
copy from profiles/deviceinfo/deviceinfo.c
copy to android/dis.c
-- 
1.9.3


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

* [PATCH BlueZ v3 02/15] android/dis: Strip dependencies from deviceinfo plugin
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 03/15] android/dis: Add bt_dis_set_notification Luiz Augusto von Dentz
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

This strip any dependecy from deviceinfo plugin so the code can be reused
by HoG implementation.
---
 android/Android.mk  |   1 +
 android/Makefile.am |   1 +
 android/dis.c       | 154 ++++++++++++++++++++++++----------------------------
 android/dis.h       |  32 +++++++++++
 4 files changed, 106 insertions(+), 82 deletions(-)
 create mode 100644 android/dis.h

diff --git a/android/Android.mk b/android/Android.mk
index fc7b59d..7485c0f 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -35,6 +35,7 @@ include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
 	bluez/android/main.c \
 	bluez/android/bluetooth.c \
+	bluez/android/dis.c \
 	bluez/android/hog.c \
 	bluez/android/hidhost.c \
 	bluez/android/socket.c \
diff --git a/android/Makefile.am b/android/Makefile.am
index 51c8253..0349f38 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -38,6 +38,7 @@ android_bluetoothd_SOURCES = android/main.c \
 				src/shared/uhid.h src/shared/uhid.c \
 				android/bluetooth.h android/bluetooth.c \
 				android/hidhost.h android/hidhost.c \
+				android/dis.h android/dis.c \
 				android/hog.h android/hog.c \
 				android/ipc-common.h \
 				android/ipc.h android/ipc.c \
diff --git a/android/dis.c b/android/dis.c
index 208598a..7914293 100644
--- a/android/dis.c
+++ b/android/dis.c
@@ -29,55 +29,86 @@
 
 #include <glib.h>
 
+#include "src/log.h"
+
 #include "lib/uuid.h"
-#include "src/plugin.h"
-#include "src/adapter.h"
-#include "src/device.h"
-#include "src/profile.h"
-#include "src/service.h"
 #include "src/shared/util.h"
+
 #include "attrib/gattrib.h"
-#include "src/attio.h"
 #include "attrib/att.h"
 #include "attrib/gatt.h"
-#include "src/log.h"
+
+#include "android/dis.h"
 
 #define PNP_ID_SIZE	7
 
-struct deviceinfo {
-	struct btd_device	*dev;		/* Device reference */
+struct bt_dis {
+	int			ref_count;
+	uint8_t			source;
+	uint16_t		vendor;
+	uint16_t		product;
+	uint16_t		version;
 	GAttrib			*attrib;	/* GATT connection */
-	guint			attioid;	/* Att watcher id */
-	struct att_range	*svc_range;	/* DeviceInfo range */
+	struct gatt_primary	*primary;	/* Primary details */
 	GSList			*chars;		/* Characteristics */
 };
 
 struct characteristic {
 	struct gatt_char	attr;	/* Characteristic */
-	struct deviceinfo	*d;	/* deviceinfo where the char belongs */
+	struct bt_dis		*d;	/* deviceinfo where the char belongs */
 };
 
-static void deviceinfo_driver_remove(struct btd_service *service)
+static void dis_free(struct bt_dis *dis)
+{
+	if (dis->attrib)
+		g_attrib_unref(dis->attrib);
+
+	g_slist_free_full(dis->chars, g_free);
+
+	g_free(dis->primary);
+	g_free(dis);
+}
+
+struct bt_dis *bt_dis_new(void *primary)
 {
-	struct deviceinfo *d = btd_service_get_user_data(service);
+	struct bt_dis *dis;
 
-	if (d->attioid > 0)
-		btd_device_remove_attio_callback(d->dev, d->attioid);
+	dis = g_try_new0(struct bt_dis, 1);
+	if (!dis)
+		return NULL;
 
-	if (d->attrib != NULL)
-		g_attrib_unref(d->attrib);
+	if (primary)
+		dis->primary = g_memdup(primary, sizeof(*dis->primary));
 
-	g_slist_free_full(d->chars, g_free);
+	return bt_dis_ref(dis);
+}
+
+struct bt_dis *bt_dis_ref(struct bt_dis *dis)
+{
+	if (!dis)
+		return NULL;
 
-	btd_device_unref(d->dev);
-	g_free(d->svc_range);
-	g_free(d);
+	__sync_fetch_and_add(&dis->ref_count, 1);
+
+	return dis;
+}
+
+void bt_dis_unref(struct bt_dis *dis)
+{
+	if (!dis)
+		return;
+
+	if (__sync_sub_and_fetch(&dis->ref_count, 1))
+		return;
+
+	dis_free(dis);
 }
 
 static void read_pnpid_cb(guint8 status, const guint8 *pdu, guint16 len,
 							gpointer user_data)
 {
 	struct characteristic *ch = user_data;
+	struct bt_dis *dis = ch->d;
 	uint8_t value[PNP_ID_SIZE];
 	ssize_t vlen;
 
@@ -97,8 +128,10 @@ static void read_pnpid_cb(guint8 status, const guint8 *pdu, guint16 len,
 		return;
 	}
 
-	btd_device_set_pnpid(ch->d->dev, value[0], get_le16(&value[1]),
-				get_le16(&value[3]), get_le16(&value[5]));
+	dis->source = value[0];
+	dis->vendor = get_le16(&value[1]);
+	dis->product = get_le16(&value[3]);
+	dis->version = get_le16(&value[5]);
 }
 
 static void process_deviceinfo_char(struct characteristic *ch)
@@ -111,7 +144,7 @@ static void process_deviceinfo_char(struct characteristic *ch)
 static void configure_deviceinfo_cb(uint8_t status, GSList *characteristics,
 								void *user_data)
 {
-	struct deviceinfo *d = user_data;
+	struct bt_dis *d = user_data;
 	GSList *l;
 
 	if (status != 0) {
@@ -136,71 +169,28 @@ static void configure_deviceinfo_cb(uint8_t status, GSList *characteristics,
 		process_deviceinfo_char(ch);
 	}
 }
-static void attio_connected_cb(GAttrib *attrib, gpointer user_data)
-{
-	struct deviceinfo *d = user_data;
-
-	d->attrib = g_attrib_ref(attrib);
-
-	gatt_discover_char(d->attrib, d->svc_range->start, d->svc_range->end,
-					NULL, configure_deviceinfo_cb, d);
-}
 
-static void attio_disconnected_cb(gpointer user_data)
+bool bt_dis_attach(struct bt_dis *dis, void *attrib)
 {
-	struct deviceinfo *d = user_data;
+	struct gatt_primary *primary = dis->primary;
 
-	g_attrib_unref(d->attrib);
-	d->attrib = NULL;
-}
-
-static int deviceinfo_register(struct btd_service *service,
-						struct gatt_primary *prim)
-{
-	struct btd_device *device = btd_service_get_device(service);
-	struct deviceinfo *d;
+	if (dis->attrib || !primary)
+		return false;
 
-	d = g_new0(struct deviceinfo, 1);
-	d->dev = btd_device_ref(device);
-	d->svc_range = g_new0(struct att_range, 1);
-	d->svc_range->start = prim->range.start;
-	d->svc_range->end = prim->range.end;
+	dis->attrib = g_attrib_ref(attrib);
 
-	btd_service_set_user_data(service, d);
+	gatt_discover_char(dis->attrib, primary->range.start,
+						primary->range.end, NULL,
+						configure_deviceinfo_cb, dis);
 
-	d->attioid = btd_device_add_attio_callback(device, attio_connected_cb,
-						attio_disconnected_cb, d);
-	return 0;
+	return true;
 }
 
-static int deviceinfo_driver_probe(struct btd_service *service)
+void bt_dis_detach(struct bt_dis *dis)
 {
-	struct btd_device *device = btd_service_get_device(service);
-	struct gatt_primary *prim;
-
-	prim = btd_device_get_primary(device, DEVICE_INFORMATION_UUID);
-	if (prim == NULL)
-		return -EINVAL;
-
-	return deviceinfo_register(service, prim);
-}
-
-static struct btd_profile deviceinfo_profile = {
-	.name		= "deviceinfo",
-	.remote_uuid	= DEVICE_INFORMATION_UUID,
-	.device_probe	= deviceinfo_driver_probe,
-	.device_remove	= deviceinfo_driver_remove
-};
-
-static int deviceinfo_init(void)
-{
-	return btd_profile_register(&deviceinfo_profile);
-}
+	if (!dis->attrib)
+		return;
 
-static void deviceinfo_exit(void)
-{
-	btd_profile_unregister(&deviceinfo_profile);
+	g_attrib_unref(dis->attrib);
+	dis->attrib = NULL;
 }
-
-BLUETOOTH_PLUGIN_DEFINE(deviceinfo, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
-					deviceinfo_init, deviceinfo_exit)
diff --git a/android/dis.h b/android/dis.h
new file mode 100644
index 0000000..6cc0b58
--- /dev/null
+++ b/android/dis.h
@@ -0,0 +1,32 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2014  Intel Corporation. All rights reserved.
+ *
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+struct bt_dis;
+
+struct bt_dis *bt_dis_new(void *primary);
+
+struct bt_dis *bt_dis_ref(struct bt_dis *dis);
+void bt_dis_unref(struct bt_dis *dis);
+
+bool bt_dis_attach(struct bt_dis *dis, void *gatt);
+void bt_dis_detach(struct bt_dis *dis);
-- 
1.9.3


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

* [PATCH BlueZ v3 03/15] android/dis: Add bt_dis_set_notification
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 02/15] android/dis: Strip dependencies from deviceinfo plugin Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 04/15] android/dis: Only cache the handle not all the characteristics Luiz Augusto von Dentz
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

Function bt_dis_set_notification can be used to set notify callback.
---
 android/dis.c | 21 +++++++++++++++++++++
 android/dis.h |  7 +++++++
 2 files changed, 28 insertions(+)

diff --git a/android/dis.c b/android/dis.c
index 7914293..3237c03 100644
--- a/android/dis.c
+++ b/android/dis.c
@@ -51,6 +51,8 @@ struct bt_dis {
 	GAttrib			*attrib;	/* GATT connection */
 	struct gatt_primary	*primary;	/* Primary details */
 	GSList			*chars;		/* Characteristics */
+	bt_dis_notify		notify;
+	void			*notify_data;
 };
 
 struct characteristic {
@@ -132,6 +134,13 @@ static void read_pnpid_cb(guint8 status, const guint8 *pdu, guint16 len,
 	dis->vendor = get_le16(&value[1]);
 	dis->product = get_le16(&value[3]);
 	dis->version = get_le16(&value[5]);
+
+	DBG("source: 0x%02X vendor: 0x%04X product: 0x%04X version: 0x%04X",
+			dis->source, dis->vendor, dis->product, dis->version);
+
+	if (dis->notify)
+		dis->notify(dis->source, dis->vendor, dis->product,
+						dis->version, dis->notify_data);
 }
 
 static void process_deviceinfo_char(struct characteristic *ch)
@@ -194,3 +203,15 @@ void bt_dis_detach(struct bt_dis *dis)
 	g_attrib_unref(dis->attrib);
 	dis->attrib = NULL;
 }
+
+bool bt_dis_set_notification(struct bt_dis *dis, bt_dis_notify func,
+							void *user_data)
+{
+	if (!dis)
+		return false;
+
+	dis->notify = func;
+	dis->notify_data = user_data;
+
+	return true;
+}
diff --git a/android/dis.h b/android/dis.h
index 6cc0b58..faf27b3 100644
--- a/android/dis.h
+++ b/android/dis.h
@@ -30,3 +30,10 @@ void bt_dis_unref(struct bt_dis *dis);
 
 bool bt_dis_attach(struct bt_dis *dis, void *gatt);
 void bt_dis_detach(struct bt_dis *dis);
+
+typedef void (*bt_dis_notify) (uint8_t source, uint16_t vendor,
+					uint16_t product, uint16_t version,
+					void *user_data);
+
+bool bt_dis_set_notification(struct bt_dis *dis, bt_dis_notify func,
+							void *user_data);
-- 
1.9.3


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

* [PATCH BlueZ v3 04/15] android/dis: Only cache the handle not all the characteristics
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 02/15] android/dis: Strip dependencies from deviceinfo plugin Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 03/15] android/dis: Add bt_dis_set_notification Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 05/15] android/hog: Add support for reading device details via DIS Luiz Augusto von Dentz
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

---
 android/dis.c | 33 +++++++++------------------------
 1 file changed, 9 insertions(+), 24 deletions(-)

diff --git a/android/dis.c b/android/dis.c
index 3237c03..ce6e063 100644
--- a/android/dis.c
+++ b/android/dis.c
@@ -44,13 +44,13 @@
 
 struct bt_dis {
 	int			ref_count;
+	uint16_t		handle;
 	uint8_t			source;
 	uint16_t		vendor;
 	uint16_t		product;
 	uint16_t		version;
 	GAttrib			*attrib;	/* GATT connection */
 	struct gatt_primary	*primary;	/* Primary details */
-	GSList			*chars;		/* Characteristics */
 	bt_dis_notify		notify;
 	void			*notify_data;
 };
@@ -65,8 +65,6 @@ static void dis_free(struct bt_dis *dis)
 	if (dis->attrib)
 		g_attrib_unref(dis->attrib);
 
-	g_slist_free_full(dis->chars, g_free);
-
 	g_free(dis->primary);
 	g_free(dis);
 }
@@ -109,8 +107,7 @@ void bt_dis_unref(struct bt_dis *dis)
 static void read_pnpid_cb(guint8 status, const guint8 *pdu, guint16 len,
 							gpointer user_data)
 {
-	struct characteristic *ch = user_data;
-	struct bt_dis *dis = ch->d;
+	struct bt_dis *dis = user_data;
 	uint8_t value[PNP_ID_SIZE];
 	ssize_t vlen;
 
@@ -143,13 +140,6 @@ static void read_pnpid_cb(guint8 status, const guint8 *pdu, guint16 len,
 						dis->version, dis->notify_data);
 }
 
-static void process_deviceinfo_char(struct characteristic *ch)
-{
-	if (g_strcmp0(ch->attr.uuid, PNPID_UUID) == 0)
-		gatt_read_char(ch->d->attrib, ch->attr.value_handle,
-							read_pnpid_cb, ch);
-}
-
 static void configure_deviceinfo_cb(uint8_t status, GSList *characteristics,
 								void *user_data)
 {
@@ -164,18 +154,12 @@ static void configure_deviceinfo_cb(uint8_t status, GSList *characteristics,
 
 	for (l = characteristics; l; l = l->next) {
 		struct gatt_char *c = l->data;
-		struct characteristic *ch;
-
-		ch = g_new0(struct characteristic, 1);
-		ch->attr.handle = c->handle;
-		ch->attr.properties = c->properties;
-		ch->attr.value_handle = c->value_handle;
-		memcpy(ch->attr.uuid, c->uuid, MAX_LEN_UUID_STR + 1);
-		ch->d = d;
-
-		d->chars = g_slist_append(d->chars, ch);
 
-		process_deviceinfo_char(ch);
+		if (strcmp(c->uuid, PNPID_UUID) == 0) {
+			d->handle = c->value_handle;
+			gatt_read_char(d->attrib, d->handle, read_pnpid_cb, d);
+			break;
+		}
 	}
 }
 
@@ -188,7 +172,8 @@ bool bt_dis_attach(struct bt_dis *dis, void *attrib)
 
 	dis->attrib = g_attrib_ref(attrib);
 
-	gatt_discover_char(dis->attrib, primary->range.start,
+	if (!dis->handle)
+		gatt_discover_char(dis->attrib, primary->range.start,
 						primary->range.end, NULL,
 						configure_deviceinfo_cb, dis);
 
-- 
1.9.3


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

* [PATCH BlueZ v3 05/15] android/hog: Add support for reading device details via DIS
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (2 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 04/15] android/dis: Only cache the handle not all the characteristics Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 06/15] lib/uuid: Add define for Scan Parameter UUID Luiz Augusto von Dentz
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

If primary is not provided meaning primary should be auto discovered it
probably means other primary services such as Device Information
Service are not being handled either so just handle DIS as well in such
case.
---
 android/hog.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 49 insertions(+), 12 deletions(-)

diff --git a/android/hog.c b/android/hog.c
index c88fe9d..007146a 100644
--- a/android/hog.c
+++ b/android/hog.c
@@ -52,6 +52,7 @@
 
 #include "btio/btio.h"
 
+#include "android/dis.h"
 #include "android/hog.h"
 
 #define HOG_UUID		"00001812-0000-1000-8000-00805f9b34fb"
@@ -89,6 +90,7 @@ struct bt_hog {
 	uint16_t		proto_mode_handle;
 	uint16_t		ctrlpt_handle;
 	uint8_t			flags;
+	struct bt_dis		*dis;
 };
 
 struct report {
@@ -644,6 +646,7 @@ static void report_free(void *data)
 
 static void hog_free(struct bt_hog *hog)
 {
+	bt_dis_unref(hog->dis);
 	bt_uhid_unref(hog->uhid);
 	g_slist_free_full(hog->reports, report_free);
 	g_attrib_unref(hog->attrib);
@@ -747,6 +750,30 @@ static void find_included_cb(uint8_t status, GSList *services, void *user_data)
 						char_discovered_cb, hog);
 }
 
+static void dis_notify(uint8_t source, uint16_t vendor, uint16_t product,
+					uint16_t version, void *user_data)
+{
+	struct bt_hog *hog = user_data;
+
+	hog->vendor = vendor;
+	hog->product = product;
+	hog->version = version;
+}
+
+static void hog_attach_dis(struct bt_hog *hog, struct gatt_primary *primary)
+{
+	if (hog->dis) {
+		bt_dis_attach(hog->dis, hog->attrib);
+		return;
+	}
+
+	hog->dis = bt_dis_new(primary);
+	if (hog->dis) {
+		bt_dis_set_notification(hog->dis, dis_notify, hog);
+		bt_dis_attach(hog->dis, hog->attrib);
+	}
+}
+
 static void primary_cb(uint8_t status, GSList *services, void *user_data)
 {
 	struct bt_hog *hog = user_data;
@@ -769,26 +796,30 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data)
 	for (l = services; l; l = l->next) {
 		primary = l->data;
 
+		if (strcmp(primary->uuid, DEVICE_INFORMATION_UUID) == 0) {
+			hog_attach_dis(hog, primary);
+			continue;
+		}
+
 		if (strcmp(primary->uuid, HOG_UUID) == 0)
-			break;
+			hog->primary = g_memdup(primary, sizeof(*primary));
 	}
 
-	if (!l) {
-		for (l = services; l; l = l->next) {
-			primary = l->data;
+	if (hog->primary) {
+		gatt_discover_char(hog->attrib, hog->primary->range.start,
+						hog->primary->range.end, NULL,
+						char_discovered_cb, hog);
 
-			gatt_find_included(hog->attrib, primary->range.start,
-					primary->range.end, find_included_cb,
-					hog);
-		}
 		return;
 	}
 
-	hog->primary = g_memdup(primary, sizeof(*primary));
+	for (l = services; l; l = l->next) {
+		primary = l->data;
 
-	gatt_discover_char(hog->attrib, hog->primary->range.start,
-						hog->primary->range.end, NULL,
-						char_discovered_cb, hog);
+		gatt_find_included(hog->attrib, primary->range.start,
+				primary->range.end, find_included_cb,
+				hog);
+	}
 }
 
 bool bt_hog_attach(struct bt_hog *hog, void *gatt)
@@ -806,6 +837,9 @@ bool bt_hog_attach(struct bt_hog *hog, void *gatt)
 		return true;
 	}
 
+	if (hog->dis)
+		bt_dis_attach(hog->dis, gatt);
+
 	if (hog->reports == NULL) {
 		gatt_discover_char(hog->attrib, primary->range.start,
 						primary->range.end, NULL,
@@ -838,6 +872,9 @@ void bt_hog_detach(struct bt_hog *hog)
 		g_attrib_unregister(hog->attrib, r->notifyid);
 	}
 
+	if (hog->dis)
+		bt_dis_detach(hog->dis);
+
 	g_attrib_unref(hog->attrib);
 	hog->attrib = NULL;
 }
-- 
1.9.3


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

* [PATCH BlueZ v3 06/15] lib/uuid: Add define for Scan Parameter UUID
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (3 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 05/15] android/hog: Add support for reading device details via DIS Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 07/15] android/scpp: Add copy to Scan Parameter Profile implementation Luiz Augusto von Dentz
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

---
 lib/uuid.h                | 1 +
 profiles/scanparam/scan.c | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/uuid.h b/lib/uuid.h
index 814fd92..b44d6ae 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -60,6 +60,7 @@ extern "C" {
 #define IMMEDIATE_ALERT_UUID	"00001802-0000-1000-8000-00805f9b34fb"
 #define LINK_LOSS_UUID		"00001803-0000-1000-8000-00805f9b34fb"
 #define TX_POWER_UUID		"00001804-0000-1000-8000-00805f9b34fb"
+#define SCAN_PARAMETERS_UUID	"00001813-0000-1000-8000-00805f9b34fb"
 
 #define SAP_UUID		"0000112D-0000-1000-8000-00805f9b34fb"
 
diff --git a/profiles/scanparam/scan.c b/profiles/scanparam/scan.c
index 25c906e..3eece9d 100644
--- a/profiles/scanparam/scan.c
+++ b/profiles/scanparam/scan.c
@@ -42,8 +42,6 @@
 #include "attrib/gatt.h"
 #include "src/attio.h"
 
-#define SCAN_PARAMETERS_UUID		"00001813-0000-1000-8000-00805f9b34fb"
-
 #define SCAN_INTERVAL_WIN_UUID		0x2A4F
 #define SCAN_REFRESH_UUID		0x2A31
 
-- 
1.9.3


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

* [PATCH BlueZ v3 07/15] android/scpp: Add copy to Scan Parameter Profile implementation
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (4 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 06/15] lib/uuid: Add define for Scan Parameter UUID Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 08/15] android/scpp: Strip dependencies from scan plugin Luiz Augusto von Dentz
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

---
 profiles/scanparam/scan.c => android/scpp.c | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 copy profiles/scanparam/scan.c => android/scpp.c (100%)

diff --git a/profiles/scanparam/scan.c b/android/scpp.c
similarity index 100%
copy from profiles/scanparam/scan.c
copy to android/scpp.c
-- 
1.9.3


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

* [PATCH BlueZ v3 08/15] android/scpp: Strip dependencies from scan plugin
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (5 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 07/15] android/scpp: Add copy to Scan Parameter Profile implementation Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 09/15] android/scpp: Add bt_scpp_set_interval and bt_scpp_set_window Luiz Augusto von Dentz
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

This strip any dependecy from scan plugin so the code can be reused
by HoG implementation.
---
 android/Android.mk  |   1 +
 android/Makefile.am |   1 +
 android/scpp.c      | 168 ++++++++++++++++++++++++----------------------------
 android/scpp.h      |  32 ++++++++++
 4 files changed, 110 insertions(+), 92 deletions(-)
 create mode 100644 android/scpp.h

diff --git a/android/Android.mk b/android/Android.mk
index 7485c0f..fdc352a 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -36,6 +36,7 @@ LOCAL_SRC_FILES := \
 	bluez/android/main.c \
 	bluez/android/bluetooth.c \
 	bluez/android/dis.c \
+	bluez/android/scpp.c \
 	bluez/android/hog.c \
 	bluez/android/hidhost.c \
 	bluez/android/socket.c \
diff --git a/android/Makefile.am b/android/Makefile.am
index 0349f38..ffcb199 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -39,6 +39,7 @@ android_bluetoothd_SOURCES = android/main.c \
 				android/bluetooth.h android/bluetooth.c \
 				android/hidhost.h android/hidhost.c \
 				android/dis.h android/dis.c \
+				android/scpp.h android/scpp.c \
 				android/hog.h android/hog.c \
 				android/ipc-common.h \
 				android/ipc.h android/ipc.c \
diff --git a/android/scpp.c b/android/scpp.c
index 3eece9d..c73a015 100644
--- a/android/scpp.c
+++ b/android/scpp.c
@@ -29,18 +29,18 @@
 #include <stdbool.h>
 #include <errno.h>
 
-#include "lib/uuid.h"
+#include <glib.h>
+
 #include "src/log.h"
-#include "src/plugin.h"
-#include "src/adapter.h"
-#include "src/device.h"
-#include "src/profile.h"
-#include "src/service.h"
+
+#include "lib/uuid.h"
 #include "src/shared/util.h"
+
 #include "attrib/att.h"
 #include "attrib/gattrib.h"
 #include "attrib/gatt.h"
-#include "src/attio.h"
+
+#include "android/scpp.h"
 
 #define SCAN_INTERVAL_WIN_UUID		0x2A4F
 #define SCAN_REFRESH_UUID		0x2A31
@@ -49,11 +49,10 @@
 #define SCAN_WINDOW		0x0030
 #define SERVER_REQUIRES_REFRESH	0x00
 
-struct scan {
-	struct btd_device *device;
+struct bt_scpp {
+	int ref_count;
 	GAttrib *attrib;
-	struct att_range range;
-	guint attioid;
+	struct gatt_primary *primary;
 	uint16_t interval;
 	uint16_t window;
 	uint16_t iwhandle;
@@ -61,6 +60,50 @@ struct scan {
 	guint refresh_cb_id;
 };
 
+static void scpp_free(struct bt_scpp *scan)
+{
+	if (scan->attrib)
+		g_attrib_unref(scan->attrib);
+
+	g_free(scan->primary);
+	g_free(scan);
+}
+
+struct bt_scpp *bt_scpp_new(void *primary)
+{
+	struct bt_scpp *scan;
+
+	scan = g_try_new0(struct bt_scpp, 1);
+	if (!scan)
+		return NULL;
+
+	if (primary)
+		scan->primary = g_memdup(primary, sizeof(*scan->primary));
+
+	return bt_scpp_ref(scan);
+}
+
+struct bt_scpp *bt_scpp_ref(struct bt_scpp *scan)
+{
+	if (!scan)
+		return NULL;
+
+	__sync_fetch_and_add(&scan->ref_count, 1);
+
+	return scan;
+}
+
+void bt_scpp_unref(struct bt_scpp *scan)
+{
+	if (!scan)
+		return;
+
+	if (__sync_sub_and_fetch(&scan->ref_count, 1))
+		return;
+
+	scpp_free(scan);
+}
+
 static void write_scan_params(GAttrib *attrib, uint16_t handle)
 {
 	uint8_t value[4];
@@ -74,7 +117,7 @@ static void write_scan_params(GAttrib *attrib, uint16_t handle)
 static void refresh_value_cb(const uint8_t *pdu, uint16_t len,
 						gpointer user_data)
 {
-	struct scan *scan = user_data;
+	struct bt_scpp *scan = user_data;
 
 	DBG("Server requires refresh: %d", pdu[3]);
 
@@ -85,7 +128,7 @@ static void refresh_value_cb(const uint8_t *pdu, uint16_t len,
 static void ccc_written_cb(guint8 status, const guint8 *pdu,
 					guint16 plen, gpointer user_data)
 {
-	struct scan *scan = user_data;
+	struct bt_scpp *scan = user_data;
 
 	if (status != 0) {
 		error("Write Scan Refresh CCC failed: %s",
@@ -103,7 +146,7 @@ static void ccc_written_cb(guint8 status, const guint8 *pdu,
 static void discover_descriptor_cb(uint8_t status, GSList *descs,
 								void *user_data)
 {
-	struct scan *scan = user_data;
+	struct bt_scpp *scan = user_data;
 	struct gatt_desc *desc;
 	uint8_t value[2];
 
@@ -123,7 +166,7 @@ static void discover_descriptor_cb(uint8_t status, GSList *descs,
 static void refresh_discovered_cb(uint8_t status, GSList *chars,
 								void *user_data)
 {
-	struct scan *scan = user_data;
+	struct bt_scpp *scan = user_data;
 	struct gatt_char *chr;
 	uint16_t start, end;
 	bt_uuid_t uuid;
@@ -143,7 +186,7 @@ static void refresh_discovered_cb(uint8_t status, GSList *chars,
 	DBG("Scan Refresh handle: 0x%04x", chr->value_handle);
 
 	start = chr->value_handle + 1;
-	end = scan->range.end;
+	end = scan->primary->range.end;
 
 	if (start > end)
 		return;
@@ -158,7 +201,7 @@ static void refresh_discovered_cb(uint8_t status, GSList *chars,
 
 static void iwin_discovered_cb(uint8_t status, GSList *chars, void *user_data)
 {
-	struct scan *scan = user_data;
+	struct bt_scpp *scan = user_data;
 	struct gatt_char *chr;
 
 	if (status) {
@@ -175,98 +218,39 @@ static void iwin_discovered_cb(uint8_t status, GSList *chars, void *user_data)
 	write_scan_params(scan->attrib, scan->iwhandle);
 }
 
-static void attio_connected_cb(GAttrib *attrib, gpointer user_data)
+bool bt_scpp_attach(struct bt_scpp *scan, void *attrib)
 {
-	struct scan *scan = user_data;
 	bt_uuid_t iwin_uuid, refresh_uuid;
 
+	if (!scan || scan->attrib || !scan->primary)
+		return false;
+
 	scan->attrib = g_attrib_ref(attrib);
 
 	if (scan->iwhandle) {
 		write_scan_params(scan->attrib, scan->iwhandle);
-		return;
+		return true;
 	}
 
 	bt_uuid16_create(&iwin_uuid, SCAN_INTERVAL_WIN_UUID);
 	bt_uuid16_create(&refresh_uuid, SCAN_REFRESH_UUID);
 
-	gatt_discover_char(scan->attrib, scan->range.start, scan->range.end,
-					&iwin_uuid, iwin_discovered_cb, scan);
+	gatt_discover_char(scan->attrib, scan->primary->range.start,
+				scan->primary->range.end, &iwin_uuid,
+				iwin_discovered_cb, scan);
 
-	gatt_discover_char(scan->attrib, scan->range.start, scan->range.end,
-				&refresh_uuid, refresh_discovered_cb, scan);
-}
-
-static void attio_disconnected_cb(gpointer user_data)
-{
-	struct scan *scan = user_data;
+	gatt_discover_char(scan->attrib, scan->primary->range.start,
+				scan->primary->range.end, &refresh_uuid,
+				refresh_discovered_cb, scan);
 
-	g_attrib_unref(scan->attrib);
-	scan->attrib = NULL;
+	return true;
 }
 
-static int scan_register(struct btd_service *service, struct gatt_primary *prim)
+void bt_scpp_detach(struct bt_scpp *scan)
 {
-	struct btd_device *device = btd_service_get_device(service);
-	struct scan *scan;
-
-	scan = g_new0(struct scan, 1);
-	scan->device = btd_device_ref(device);
-	scan->range = prim->range;
-	scan->attioid = btd_device_add_attio_callback(device,
-							attio_connected_cb,
-							attio_disconnected_cb,
-							scan);
-
-	btd_service_set_user_data(service, scan);
-
-	return 0;
-}
-
-static void scan_param_remove(struct btd_service *service)
-{
-	struct scan *scan = btd_service_get_user_data(service);
-
-	if (scan->attrib != NULL && scan->refresh_cb_id > 0)
-		g_attrib_unregister(scan->attrib, scan->refresh_cb_id);
+	if (!scan || !scan->attrib)
+		return;
 
-	btd_device_remove_attio_callback(scan->device, scan->attioid);
-	btd_device_unref(scan->device);
 	g_attrib_unref(scan->attrib);
-	g_free(scan);
-}
-
-static int scan_param_probe(struct btd_service *service)
-{
-	struct btd_device *device = btd_service_get_device(service);
-	struct gatt_primary *prim;
-
-	DBG("Probing Scan Parameters");
-
-	prim = btd_device_get_primary(device, SCAN_PARAMETERS_UUID);
-	if (!prim)
-		return -EINVAL;
-
-	return scan_register(service, prim);
-}
-
-static struct btd_profile scan_profile = {
-	.name = "Scan Parameters Client Driver",
-	.remote_uuid = SCAN_PARAMETERS_UUID,
-	.device_probe = scan_param_probe,
-	.device_remove = scan_param_remove,
-};
-
-static int scan_param_init(void)
-{
-	return btd_profile_register(&scan_profile);
-}
-
-static void scan_param_exit(void)
-{
-	btd_profile_unregister(&scan_profile);
+	scan->attrib = NULL;
 }
-
-BLUETOOTH_PLUGIN_DEFINE(scanparam, VERSION,
-			BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
-			scan_param_init, scan_param_exit)
diff --git a/android/scpp.h b/android/scpp.h
new file mode 100644
index 0000000..f374cee
--- /dev/null
+++ b/android/scpp.h
@@ -0,0 +1,32 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2014  Intel Corporation. All rights reserved.
+ *
+ *
+ *  This library is free software; you can rescpptribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is scpptributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+struct bt_scpp;
+
+struct bt_scpp *bt_scpp_new(void *primary);
+
+struct bt_scpp *bt_scpp_ref(struct bt_scpp *scan);
+void bt_scpp_unref(struct bt_scpp *scan);
+
+bool bt_scpp_attach(struct bt_scpp *scan, void *gatt);
+void bt_scpp_detach(struct bt_scpp *scan);
-- 
1.9.3


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

* [PATCH BlueZ v3 09/15] android/scpp: Add bt_scpp_set_interval and bt_scpp_set_window
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (6 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 08/15] android/scpp: Strip dependencies from scan plugin Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 10/15] android/scpp: Check for cached handles on attach Luiz Augusto von Dentz
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

These functions can be used to change the current values.
---
 android/scpp.c | 43 +++++++++++++++++++++++++++++++++++++------
 android/scpp.h |  3 +++
 2 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/android/scpp.c b/android/scpp.c
index c73a015..751d3f2 100644
--- a/android/scpp.c
+++ b/android/scpp.c
@@ -77,6 +77,9 @@ struct bt_scpp *bt_scpp_new(void *primary)
 	if (!scan)
 		return NULL;
 
+	scan->interval = SCAN_INTERVAL;
+	scan->window = SCAN_WINDOW;
+
 	if (primary)
 		scan->primary = g_memdup(primary, sizeof(*scan->primary));
 
@@ -104,12 +107,13 @@ void bt_scpp_unref(struct bt_scpp *scan)
 	scpp_free(scan);
 }
 
-static void write_scan_params(GAttrib *attrib, uint16_t handle)
+static void write_scan_params(GAttrib *attrib, uint16_t handle,
+					uint16_t interval, uint16_t window)
 {
 	uint8_t value[4];
 
-	put_le16(SCAN_INTERVAL, &value[0]);
-	put_le16(SCAN_WINDOW, &value[2]);
+	put_le16(interval, &value[0]);
+	put_le16(window, &value[2]);
 
 	gatt_write_cmd(attrib, handle, value, sizeof(value), NULL, NULL);
 }
@@ -122,7 +126,8 @@ static void refresh_value_cb(const uint8_t *pdu, uint16_t len,
 	DBG("Server requires refresh: %d", pdu[3]);
 
 	if (pdu[3] == SERVER_REQUIRES_REFRESH)
-		write_scan_params(scan->attrib, scan->iwhandle);
+		write_scan_params(scan->attrib, scan->iwhandle, scan->interval,
+								scan->window);
 }
 
 static void ccc_written_cb(guint8 status, const guint8 *pdu,
@@ -215,7 +220,8 @@ static void iwin_discovered_cb(uint8_t status, GSList *chars, void *user_data)
 
 	DBG("Scan Interval Window handle: 0x%04x", scan->iwhandle);
 
-	write_scan_params(scan->attrib, scan->iwhandle);
+	write_scan_params(scan->attrib, scan->iwhandle, scan->interval,
+								scan->window);
 }
 
 bool bt_scpp_attach(struct bt_scpp *scan, void *attrib)
@@ -228,7 +234,8 @@ bool bt_scpp_attach(struct bt_scpp *scan, void *attrib)
 	scan->attrib = g_attrib_ref(attrib);
 
 	if (scan->iwhandle) {
-		write_scan_params(scan->attrib, scan->iwhandle);
+		write_scan_params(scan->attrib, scan->iwhandle, scan->interval,
+								scan->window);
 		return true;
 	}
 
@@ -254,3 +261,27 @@ void bt_scpp_detach(struct bt_scpp *scan)
 	g_attrib_unref(scan->attrib);
 	scan->attrib = NULL;
 }
+
+bool bt_scpp_set_interval(struct bt_scpp *scan, uint16_t value)
+{
+	if (!scan)
+		return false;
+
+	/* TODO: Check valid range */
+
+	scan->interval = value;
+
+	return true;
+}
+
+bool bt_scpp_set_window(struct bt_scpp *scan, uint16_t value)
+{
+	if (!scan)
+		return false;
+
+	/* TODO: Check valid range */
+
+	scan->window = value;
+
+	return true;
+}
diff --git a/android/scpp.h b/android/scpp.h
index f374cee..048fb9f 100644
--- a/android/scpp.h
+++ b/android/scpp.h
@@ -30,3 +30,6 @@ void bt_scpp_unref(struct bt_scpp *scan);
 
 bool bt_scpp_attach(struct bt_scpp *scan, void *gatt);
 void bt_scpp_detach(struct bt_scpp *scan);
+
+bool bt_scpp_set_interval(struct bt_scpp *scan, uint16_t value);
+bool bt_scpp_set_window(struct bt_scpp *scan, uint16_t value);
-- 
1.9.3


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

* [PATCH BlueZ v3 10/15] android/scpp: Check for cached handles on attach
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (7 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 09/15] android/scpp: Add bt_scpp_set_interval and bt_scpp_set_window Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 11/15] android/hog: Add support for Scan Parameter Service Luiz Augusto von Dentz
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

---
 android/scpp.c | 44 ++++++++++++++++++++++++++++----------------
 1 file changed, 28 insertions(+), 16 deletions(-)

diff --git a/android/scpp.c b/android/scpp.c
index 751d3f2..81d698b 100644
--- a/android/scpp.c
+++ b/android/scpp.c
@@ -148,12 +148,22 @@ static void ccc_written_cb(guint8 status, const guint8 *pdu,
 				refresh_value_cb, scan, NULL);
 }
 
+static void write_ccc(GAttrib *attrib, uint16_t handle, void *user_data)
+{
+	uint8_t value[2];
+
+	put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value);
+
+	gatt_write_char(attrib, handle, value, sizeof(value), ccc_written_cb,
+								user_data);
+}
+
 static void discover_descriptor_cb(uint8_t status, GSList *descs,
 								void *user_data)
 {
 	struct bt_scpp *scan = user_data;
 	struct gatt_desc *desc;
-	uint8_t value[2];
+
 
 	if (status != 0) {
 		error("Discover descriptors failed: %s", att_ecode2str(status));
@@ -163,9 +173,7 @@ static void discover_descriptor_cb(uint8_t status, GSList *descs,
 	/* There will be only one descriptor on list and it will be CCC */
 	desc = descs->data;
 
-	put_le16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT, value);
-	gatt_write_char(scan->attrib, desc->handle, value, sizeof(value),
-						ccc_written_cb, user_data);
+	write_ccc(scan->attrib, desc->handle, scan);
 }
 
 static void refresh_discovered_cb(uint8_t status, GSList *chars,
@@ -233,22 +241,26 @@ bool bt_scpp_attach(struct bt_scpp *scan, void *attrib)
 
 	scan->attrib = g_attrib_ref(attrib);
 
-	if (scan->iwhandle) {
+	if (scan->iwhandle)
 		write_scan_params(scan->attrib, scan->iwhandle, scan->interval,
 								scan->window);
-		return true;
+	else {
+		bt_uuid16_create(&iwin_uuid, SCAN_INTERVAL_WIN_UUID);
+		gatt_discover_char(scan->attrib, scan->primary->range.start,
+					scan->primary->range.end, &iwin_uuid,
+					iwin_discovered_cb, scan);
 	}
 
-	bt_uuid16_create(&iwin_uuid, SCAN_INTERVAL_WIN_UUID);
-	bt_uuid16_create(&refresh_uuid, SCAN_REFRESH_UUID);
-
-	gatt_discover_char(scan->attrib, scan->primary->range.start,
-				scan->primary->range.end, &iwin_uuid,
-				iwin_discovered_cb, scan);
-
-	gatt_discover_char(scan->attrib, scan->primary->range.start,
-				scan->primary->range.end, &refresh_uuid,
-				refresh_discovered_cb, scan);
+	if (scan->refresh_handle)
+		scan->refresh_cb_id = g_attrib_register(scan->attrib,
+				ATT_OP_HANDLE_NOTIFY, scan->refresh_handle,
+				refresh_value_cb, scan, NULL);
+	else {
+		bt_uuid16_create(&refresh_uuid, SCAN_REFRESH_UUID);
+		gatt_discover_char(scan->attrib, scan->primary->range.start,
+					scan->primary->range.end, &refresh_uuid,
+					refresh_discovered_cb, scan);
+	}
 
 	return true;
 }
-- 
1.9.3


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

* [PATCH BlueZ v3 11/15] android/hog: Add support for Scan Parameter Service
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (8 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 10/15] android/scpp: Check for cached handles on attach Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 12/15] android: Add initial implementation of Battery Service client Luiz Augusto von Dentz
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

If primary is not provided meaning primary should be auto discovered it
probably means other primary services such as Scan Parameter Profile
are not being handled either so just handle ScPP as well in such case.
---
 android/hog.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/android/hog.c b/android/hog.c
index 007146a..d891930 100644
--- a/android/hog.c
+++ b/android/hog.c
@@ -53,6 +53,7 @@
 #include "btio/btio.h"
 
 #include "android/dis.h"
+#include "android/scpp.h"
 #include "android/hog.h"
 
 #define HOG_UUID		"00001812-0000-1000-8000-00805f9b34fb"
@@ -91,6 +92,7 @@ struct bt_hog {
 	uint16_t		ctrlpt_handle;
 	uint8_t			flags;
 	struct bt_dis		*dis;
+	struct bt_scpp		*scpp;
 };
 
 struct report {
@@ -647,6 +649,7 @@ static void report_free(void *data)
 static void hog_free(struct bt_hog *hog)
 {
 	bt_dis_unref(hog->dis);
+	bt_scpp_unref(hog->scpp);
 	bt_uhid_unref(hog->uhid);
 	g_slist_free_full(hog->reports, report_free);
 	g_attrib_unref(hog->attrib);
@@ -774,6 +777,18 @@ static void hog_attach_dis(struct bt_hog *hog, struct gatt_primary *primary)
 	}
 }
 
+static void hog_attach_scpp(struct bt_hog *hog, struct gatt_primary *primary)
+{
+	if (hog->scpp) {
+		bt_scpp_attach(hog->scpp, hog->attrib);
+		return;
+	}
+
+	hog->scpp = bt_scpp_new(primary);
+	if (hog->scpp)
+		bt_scpp_attach(hog->scpp, hog->attrib);
+}
+
 static void primary_cb(uint8_t status, GSList *services, void *user_data)
 {
 	struct bt_hog *hog = user_data;
@@ -801,6 +816,11 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data)
 			continue;
 		}
 
+		if (strcmp(primary->uuid, SCAN_PARAMETERS_UUID) == 0) {
+			hog_attach_scpp(hog, primary);
+			continue;
+		}
+
 		if (strcmp(primary->uuid, HOG_UUID) == 0)
 			hog->primary = g_memdup(primary, sizeof(*primary));
 	}
@@ -840,6 +860,9 @@ bool bt_hog_attach(struct bt_hog *hog, void *gatt)
 	if (hog->dis)
 		bt_dis_attach(hog->dis, gatt);
 
+	if (hog->scpp)
+		bt_scpp_attach(hog->scpp, gatt);
+
 	if (hog->reports == NULL) {
 		gatt_discover_char(hog->attrib, primary->range.start,
 						primary->range.end, NULL,
@@ -875,6 +898,9 @@ void bt_hog_detach(struct bt_hog *hog)
 	if (hog->dis)
 		bt_dis_detach(hog->dis);
 
+	if (hog->scpp)
+		bt_scpp_detach(hog->scpp);
+
 	g_attrib_unref(hog->attrib);
 	hog->attrib = NULL;
 }
-- 
1.9.3


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

* [PATCH BlueZ v3 12/15] android: Add initial implementation of Battery Service client
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (9 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 11/15] android/hog: Add support for Scan Parameter Service Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 13/15] lib/uuid: Add define for Battery UUID Luiz Augusto von Dentz
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

---
 android/Android.mk  |   1 +
 android/Makefile.am |   1 +
 android/bas.c       | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 android/bas.h       |  32 ++++++++++++
 4 files changed, 171 insertions(+)
 create mode 100644 android/bas.c
 create mode 100644 android/bas.h

diff --git a/android/Android.mk b/android/Android.mk
index fdc352a..3442264 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -37,6 +37,7 @@ LOCAL_SRC_FILES := \
 	bluez/android/bluetooth.c \
 	bluez/android/dis.c \
 	bluez/android/scpp.c \
+	bluez/android/bas.c \
 	bluez/android/hog.c \
 	bluez/android/hidhost.c \
 	bluez/android/socket.c \
diff --git a/android/Makefile.am b/android/Makefile.am
index ffcb199..5c9bb35 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -40,6 +40,7 @@ android_bluetoothd_SOURCES = android/main.c \
 				android/hidhost.h android/hidhost.c \
 				android/dis.h android/dis.c \
 				android/scpp.h android/scpp.c \
+				android/bas.h android/bas.c \
 				android/hog.h android/hog.c \
 				android/ipc-common.h \
 				android/ipc.h android/ipc.c \
diff --git a/android/bas.c b/android/bas.c
new file mode 100644
index 0000000..ae7d274
--- /dev/null
+++ b/android/bas.c
@@ -0,0 +1,137 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2014  Intel Corporation. All rights reserved.
+ *
+ *
+ *  This library is free software; you can rebastribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is bastributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdbool.h>
+#include <errno.h>
+
+#include <glib.h>
+
+#include "src/log.h"
+
+#include "lib/uuid.h"
+#include "src/shared/util.h"
+
+#include "attrib/gattrib.h"
+#include "attrib/att.h"
+#include "attrib/gatt.h"
+
+#include "android/bas.h"
+
+struct bt_bas {
+	int ref_count;
+	GAttrib *attrib;
+	struct gatt_primary *primary;
+	uint16_t handle;
+};
+
+static void bas_free(struct bt_bas *bas)
+{
+	if (bas->attrib)
+		g_attrib_unref(bas->attrib);
+
+	g_free(bas->primary);
+	g_free(bas);
+}
+
+struct bt_bas *bt_bas_new(void *primary)
+{
+	struct bt_bas *bas;
+
+	bas = g_try_new0(struct bt_bas, 1);
+	if (!bas)
+		return NULL;
+
+	if (primary)
+		bas->primary = g_memdup(primary, sizeof(*bas->primary));
+
+	return bt_bas_ref(bas);
+}
+
+struct bt_bas *bt_bas_ref(struct bt_bas *bas)
+{
+	if (!bas)
+		return NULL;
+
+	__sync_fetch_and_add(&bas->ref_count, 1);
+
+	return bas;
+}
+
+void bt_bas_unref(struct bt_bas *bas)
+{
+	if (!bas)
+		return;
+
+	if (__sync_sub_and_fetch(&bas->ref_count, 1))
+		return;
+
+	bas_free(bas);
+}
+
+static void bas_discovered_cb(uint8_t status, GSList *chars, void *user_data)
+{
+	struct bt_bas *bas = user_data;
+	struct gatt_char *chr;
+
+	if (status) {
+		error("Battery: %s", att_ecode2str(status));
+		return;
+	}
+
+	chr = chars->data;
+	bas->handle = chr->value_handle;
+
+	DBG("Battery handle: 0x%04x", bas->handle);
+
+	/* TODO: Add handling for notification */
+}
+
+bool bt_bas_attach(struct bt_bas *bas, void *attrib)
+{
+	if (!bas || bas->attrib || !bas->primary)
+		return false;
+
+	bas->attrib = g_attrib_ref(attrib);
+
+	if (bas->handle > 0)
+		return true;
+
+	gatt_discover_char(bas->attrib, bas->primary->range.start,
+					bas->primary->range.end, NULL,
+					bas_discovered_cb, bas);
+
+	return true;
+}
+
+void bt_bas_detach(struct bt_bas *bas)
+{
+	if (!bas || !bas->attrib)
+		return;
+
+	g_attrib_unref(bas->attrib);
+	bas->attrib = NULL;
+}
diff --git a/android/bas.h b/android/bas.h
new file mode 100644
index 0000000..3e175b5
--- /dev/null
+++ b/android/bas.h
@@ -0,0 +1,32 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2014  Intel Corporation. All rights reserved.
+ *
+ *
+ *  This library is free software; you can rebastribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is bastributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+struct bt_bas;
+
+struct bt_bas *bt_bas_new(void *primary);
+
+struct bt_bas *bt_bas_ref(struct bt_bas *bas);
+void bt_bas_unref(struct bt_bas *bas);
+
+bool bt_bas_attach(struct bt_bas *bas, void *gatt);
+void bt_bas_detach(struct bt_bas *bas);
-- 
1.9.3


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

* [PATCH BlueZ v3 13/15] lib/uuid: Add define for Battery UUID
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (10 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 12/15] android: Add initial implementation of Battery Service client Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 14/15] android/hog: Add support for Battery Service Luiz Augusto von Dentz
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

---
 lib/uuid.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/uuid.h b/lib/uuid.h
index b44d6ae..7901d34 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -60,6 +60,7 @@ extern "C" {
 #define IMMEDIATE_ALERT_UUID	"00001802-0000-1000-8000-00805f9b34fb"
 #define LINK_LOSS_UUID		"00001803-0000-1000-8000-00805f9b34fb"
 #define TX_POWER_UUID		"00001804-0000-1000-8000-00805f9b34fb"
+#define BATTERY_UUID		"0000180f-0000-1000-8000-00805f9b34fb"
 #define SCAN_PARAMETERS_UUID	"00001813-0000-1000-8000-00805f9b34fb"
 
 #define SAP_UUID		"0000112D-0000-1000-8000-00805f9b34fb"
-- 
1.9.3


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

* [PATCH BlueZ v3 14/15] android/hog: Add support for Battery Service
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (11 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 13/15] lib/uuid: Add define for Battery UUID Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27  8:27 ` [PATCH BlueZ v3 15/15] android/hog: Add support for multiple instaces Luiz Augusto von Dentz
  2014-06-27 16:35 ` [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Szymon Janc
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

If primary is not provided meaning primary should be auto discovered it
probably means other primary services such as Battery Service are not
being handled either so just handle BaS as well in such case.
---
 android/hog.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/android/hog.c b/android/hog.c
index d891930..5fa8b94 100644
--- a/android/hog.c
+++ b/android/hog.c
@@ -54,6 +54,7 @@
 
 #include "android/dis.h"
 #include "android/scpp.h"
+#include "android/bas.h"
 #include "android/hog.h"
 
 #define HOG_UUID		"00001812-0000-1000-8000-00805f9b34fb"
@@ -93,6 +94,7 @@ struct bt_hog {
 	uint8_t			flags;
 	struct bt_dis		*dis;
 	struct bt_scpp		*scpp;
+	struct bt_bas		*bas;
 };
 
 struct report {
@@ -650,6 +652,7 @@ static void hog_free(struct bt_hog *hog)
 {
 	bt_dis_unref(hog->dis);
 	bt_scpp_unref(hog->scpp);
+	bt_bas_unref(hog->bas);
 	bt_uhid_unref(hog->uhid);
 	g_slist_free_full(hog->reports, report_free);
 	g_attrib_unref(hog->attrib);
@@ -789,6 +792,18 @@ static void hog_attach_scpp(struct bt_hog *hog, struct gatt_primary *primary)
 		bt_scpp_attach(hog->scpp, hog->attrib);
 }
 
+static void hog_attach_bas(struct bt_hog *hog, struct gatt_primary *primary)
+{
+	if (hog->bas) {
+		bt_bas_attach(hog->bas, hog->attrib);
+		return;
+	}
+
+	hog->bas = bt_bas_new(primary);
+	if (hog->bas)
+		bt_bas_attach(hog->bas, hog->attrib);
+}
+
 static void primary_cb(uint8_t status, GSList *services, void *user_data)
 {
 	struct bt_hog *hog = user_data;
@@ -821,6 +836,11 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data)
 			continue;
 		}
 
+		if (strcmp(primary->uuid, BATTERY_UUID) == 0) {
+			hog_attach_bas(hog, primary);
+			continue;
+		}
+
 		if (strcmp(primary->uuid, HOG_UUID) == 0)
 			hog->primary = g_memdup(primary, sizeof(*primary));
 	}
@@ -863,6 +883,9 @@ bool bt_hog_attach(struct bt_hog *hog, void *gatt)
 	if (hog->scpp)
 		bt_scpp_attach(hog->scpp, gatt);
 
+	if (hog->bas)
+		bt_bas_attach(hog->bas, gatt);
+
 	if (hog->reports == NULL) {
 		gatt_discover_char(hog->attrib, primary->range.start,
 						primary->range.end, NULL,
@@ -901,6 +924,9 @@ void bt_hog_detach(struct bt_hog *hog)
 	if (hog->scpp)
 		bt_scpp_detach(hog->scpp);
 
+	if (hog->bas)
+		bt_bas_detach(hog->bas);
+
 	g_attrib_unref(hog->attrib);
 	hog->attrib = NULL;
 }
-- 
1.9.3


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

* [PATCH BlueZ v3 15/15] android/hog: Add support for multiple instaces
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (12 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 14/15] android/hog: Add support for Battery Service Luiz Augusto von Dentz
@ 2014-06-27  8:27 ` Luiz Augusto von Dentz
  2014-06-27 16:35 ` [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Szymon Janc
  14 siblings, 0 replies; 16+ messages in thread
From: Luiz Augusto von Dentz @ 2014-06-27  8:27 UTC (permalink / raw)
  To: linux-bluetooth

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

This is necessary to pass PTS tests which does include 2 instances.
---
 android/hog.c | 48 ++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 40 insertions(+), 8 deletions(-)

diff --git a/android/hog.c b/android/hog.c
index 5fa8b94..01229ff 100644
--- a/android/hog.c
+++ b/android/hog.c
@@ -95,6 +95,7 @@ struct bt_hog {
 	struct bt_dis		*dis;
 	struct bt_scpp		*scpp;
 	struct bt_bas		*bas;
+	GSList			*instances;
 };
 
 struct report {
@@ -648,8 +649,11 @@ static void report_free(void *data)
 	g_free(report);
 }
 
-static void hog_free(struct bt_hog *hog)
+static void hog_free(void *data)
 {
+	struct bt_hog *hog = data;
+
+	g_slist_free_full(hog->instances, hog_free);
 	bt_dis_unref(hog->dis);
 	bt_scpp_unref(hog->scpp);
 	bt_bas_unref(hog->bas);
@@ -804,6 +808,27 @@ static void hog_attach_bas(struct bt_hog *hog, struct gatt_primary *primary)
 		bt_bas_attach(hog->bas, hog->attrib);
 }
 
+static void hog_attach_hog(struct bt_hog *hog, struct gatt_primary *primary)
+{
+	struct bt_hog *instance;
+
+	if (!hog->primary) {
+		hog->primary = g_memdup(primary, sizeof(*primary));
+		gatt_discover_char(hog->attrib, primary->range.start,
+						primary->range.end, NULL,
+						char_discovered_cb, hog);
+		return;
+	}
+
+	instance = bt_hog_new(hog->name, hog->vendor, hog->product,
+							hog->version, primary);
+	if (!instance)
+		return;
+
+	bt_hog_attach(instance, hog->attrib);
+	hog->instances = g_slist_append(hog->instances, instance);
+}
+
 static void primary_cb(uint8_t status, GSList *services, void *user_data)
 {
 	struct bt_hog *hog = user_data;
@@ -842,16 +867,11 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data)
 		}
 
 		if (strcmp(primary->uuid, HOG_UUID) == 0)
-			hog->primary = g_memdup(primary, sizeof(*primary));
+			hog_attach_hog(hog, primary);
 	}
 
-	if (hog->primary) {
-		gatt_discover_char(hog->attrib, hog->primary->range.start,
-						hog->primary->range.end, NULL,
-						char_discovered_cb, hog);
-
+	if (hog->primary)
 		return;
-	}
 
 	for (l = services; l; l = l->next) {
 		primary = l->data;
@@ -886,6 +906,12 @@ bool bt_hog_attach(struct bt_hog *hog, void *gatt)
 	if (hog->bas)
 		bt_bas_attach(hog->bas, gatt);
 
+	for (l = hog->instances; l; l = l->next) {
+		struct bt_hog *instance = l->data;
+
+		bt_hog_attach(instance, gatt);
+	}
+
 	if (hog->reports == NULL) {
 		gatt_discover_char(hog->attrib, primary->range.start,
 						primary->range.end, NULL,
@@ -912,6 +938,12 @@ void bt_hog_detach(struct bt_hog *hog)
 	if (!hog->attrib)
 		return;
 
+	for (l = hog->instances; l; l = l->next) {
+		struct bt_hog *instance = l->data;
+
+		bt_hog_detach(instance);
+	}
+
 	for (l = hog->reports; l; l = l->next) {
 		struct report *r = l->data;
 
-- 
1.9.3


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

* Re: [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation
  2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
                   ` (13 preceding siblings ...)
  2014-06-27  8:27 ` [PATCH BlueZ v3 15/15] android/hog: Add support for multiple instaces Luiz Augusto von Dentz
@ 2014-06-27 16:35 ` Szymon Janc
  14 siblings, 0 replies; 16+ messages in thread
From: Szymon Janc @ 2014-06-27 16:35 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On Friday 27 of June 2014 11:27:45 Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> ---
> v3: Fix passing wrong handle to g_attrib_register in ScPP
> 
>  profiles/deviceinfo/deviceinfo.c => android/dis.c | 0
>  1 file changed, 0 insertions(+), 0 deletions(-)
>  copy profiles/deviceinfo/deviceinfo.c => android/dis.c (100%)
> 
> diff --git a/profiles/deviceinfo/deviceinfo.c b/android/dis.c
> similarity index 100%
> copy from profiles/deviceinfo/deviceinfo.c
> copy to android/dis.c

ScPP related patches (6-11) are now applied. Thanks. 

-- 
Best regards, 
Szymon Janc

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

end of thread, other threads:[~2014-06-27 16:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-27  8:27 [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 02/15] android/dis: Strip dependencies from deviceinfo plugin Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 03/15] android/dis: Add bt_dis_set_notification Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 04/15] android/dis: Only cache the handle not all the characteristics Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 05/15] android/hog: Add support for reading device details via DIS Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 06/15] lib/uuid: Add define for Scan Parameter UUID Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 07/15] android/scpp: Add copy to Scan Parameter Profile implementation Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 08/15] android/scpp: Strip dependencies from scan plugin Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 09/15] android/scpp: Add bt_scpp_set_interval and bt_scpp_set_window Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 10/15] android/scpp: Check for cached handles on attach Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 11/15] android/hog: Add support for Scan Parameter Service Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 12/15] android: Add initial implementation of Battery Service client Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 13/15] lib/uuid: Add define for Battery UUID Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 14/15] android/hog: Add support for Battery Service Luiz Augusto von Dentz
2014-06-27  8:27 ` [PATCH BlueZ v3 15/15] android/hog: Add support for multiple instaces Luiz Augusto von Dentz
2014-06-27 16:35 ` [PATCH BlueZ v3 01/15] android/dis: Add copy to Device Info implementation Szymon Janc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.