[PATCH v2 3/3] android/gatt: Fix Find By Type request

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

 



With this patch GATT will correctly response with attribute not found if
there is no attributes matching.

Issue found and fix tested on UPF50
---
 android/gatt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/android/gatt.c b/android/gatt.c
index f3a4e89..f8d5d38 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -6290,10 +6290,8 @@ static uint8_t find_by_type_request(const uint8_t *cmd, uint16_t cmd_len,
 	data.search_value = search_value;
 	data.device = device;
 
-	gatt_db_find_by_type(gatt_db, start, end, &uuid,
-						find_by_type_request_cb, &data);
-
-	if (data.error == ATT_ECODE_ATTR_NOT_FOUND) {
+	if (gatt_db_find_by_type(gatt_db, start, end, &uuid,
+					find_by_type_request_cb, &data) == 0) {
 		size_t mtu;
 		uint8_t *rsp = g_attrib_get_buffer(device->attrib, &mtu);
 
-- 
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