Return-Path: From: Jakub Tyszkowski To: linux-bluetooth@vger.kernel.org Cc: Jakub Tyszkowski Subject: [PATCH 7/7] android/gatt: Fix cached services having element_id uuid not set Date: Wed, 26 Mar 2014 18:00:59 +0100 Message-Id: <1395853259-15618-7-git-send-email-jakub.tyszkowski@tieto.com> In-Reply-To: <1395853259-15618-1-git-send-email-jakub.tyszkowski@tieto.com> References: <1395853259-15618-1-git-send-email-jakub.tyszkowski@tieto.com> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: This patch removes temporary uuid as we already have uuid in services element_id, which now is properly filled. --- android/gatt.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index 0b6b5a7..d7c7c93 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -306,7 +306,6 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data) struct hal_ev_gatt_client_search_result ev_res; struct gatt_primary *prim = l->data; struct service *p; - bt_uuid_t uuid; p = new0(struct service, 1); if (!p) { @@ -323,6 +322,11 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data) memset(&ev_res, 0, sizeof(ev_res)); + if (bt_string_to_uuid(&p->id.uuid, prim->uuid) < 0) { + error("gatt: Cannot convert string to uuid"); + continue; + } + /* Put primary service to our local list */ memcpy(&p->primary, prim, sizeof(p->primary)); if (!queue_push_tail(dev->services, p)) { @@ -339,12 +343,7 @@ static void primary_cb(uint8_t status, GSList *services, void *user_data) ev_res.srvc_id.is_primary = 1; ev_res.srvc_id.inst_id = 0; - if (bt_string_to_uuid(&uuid, prim->uuid) < 0) { - error("gatt: Cannot convert string to uuid"); - continue; - } - - uuid2android(&uuid, &ev_res.srvc_id.uuid); + uuid2android(&p->id.uuid, &ev_res.srvc_id.uuid); ipc_send_notif(hal_ipc, HAL_SERVICE_ID_GATT , HAL_EV_GATT_CLIENT_SEARCH_RESULT, -- 1.9.0