From 6e31be7dbe997c21c2a056e161370a92a4378206 Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Tue, 8 Apr 2014 11:22:21 +0200 Subject: [PATCH] android/gatt: Use cached primary services if possible --- android/gatt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/android/gatt.c b/android/gatt.c index c1bd54d8c..b02245eb6 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -1145,6 +1145,14 @@ static void handle_client_search_service(const void *buf, uint16_t len) /*TODO: Handle filter uuid */ + /* Use cache if possible */ + if (!queue_isempty(dev->services)) { + status = HAL_STATUS_SUCCESS; + send_client_all_primary(GATT_SUCCESS, dev->services, + dev->conn_id); + goto reply; + } + if (!gatt_discover_primary(dev->attrib, NULL, primary_cb, dev)) { status = HAL_STATUS_FAILED; goto reply; -- 2.47.3