[PATCH 04/15] android/gatt: Use cached primary services if possible

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

 



---
 android/gatt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/android/gatt.c b/android/gatt.c
index f4cf569..eb99d54 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -1148,6 +1148,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;
-- 
1.8.4

--
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