[PATCH 2/3] android/gatt: Search included services in Secondary Services

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check type of service and perform include service discovery with valid
range.
---
 android/gatt.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index 87a7a12..1edc8b0 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -2412,6 +2412,7 @@ static bool search_included_services(struct app_connection *connection,
 							struct service *service)
 {
 	struct get_included_data *data;
+	uint16_t start, end;
 
 	data = new0(struct get_included_data, 1);
 	if (!data) {
@@ -2422,9 +2423,17 @@ static bool search_included_services(struct app_connection *connection,
 	data->prim = service;
 	data->conn = connection;
 
-	gatt_find_included(connection->device->attrib,
-				service->prim.range.start,
-				service->prim.range.end, get_included_cb, data);
+	if (service->primary) {
+		start = service->prim.range.start;
+		end = service->prim.range.end;
+	} else {
+		start = service->incl.range.start;
+		end = service->incl.range.end;
+	}
+
+	gatt_find_included(connection->device->attrib, start, end,
+							get_included_cb, data);
+
 	return true;
 }
 
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux