Return-Path: From: Marcin Kraglak To: linux-bluetooth@vger.kernel.org Subject: [PATCHv2 2/2] android/gatt: Search included services in Secondary Services Date: Thu, 6 Nov 2014 13:57:06 +0100 Message-Id: <1415278626-20784-2-git-send-email-marcin.kraglak@tieto.com> In-Reply-To: <1415278626-20784-1-git-send-email-marcin.kraglak@tieto.com> References: <1415278626-20784-1-git-send-email-marcin.kraglak@tieto.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: 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 6b57145..56123ce 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -2416,6 +2416,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) { @@ -2426,9 +2427,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