From 49450bf6f01f8f08ee585bda8f75ac7d7f40d0af Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Mon, 16 Feb 2015 13:36:45 +0100 Subject: [PATCH] android/gatt: Fix Find By Type request 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 a46c30fff..53b19833d 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -6314,10 +6314,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); -- 2.47.3