From 6332cb807ce197e7e2149ac0e9ce76efd6734607 Mon Sep 17 00:00:00 2001 From: mikew-ed Date: Mon, 10 Jul 2017 07:35:50 -0700 Subject: [PATCH] get_uuid_from_handle returns wrong uuid #30 fix --- bluez/gattlib_connect.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/bluez/gattlib_connect.c b/bluez/gattlib_connect.c index 81cf428..46f13f3 100644 --- a/bluez/gattlib_connect.c +++ b/bluez/gattlib_connect.c @@ -52,7 +52,7 @@ static void events_handler(const uint8_t *pdu, uint16_t len, gpointer user_data) gatt_connection_t *conn = user_data; uint8_t opdu[ATT_MAX_MTU]; uint16_t handle, olen = 0; - uuid_t uuid; + uuid_t uuid = {}; #if BLUEZ_VERSION_MAJOR == 4 handle = att_get_u16(&pdu[1]); @@ -448,12 +448,6 @@ int get_uuid_from_handle(gatt_connection_t* connection, uint16_t handle, uuid_t* memcpy(uuid, &conn_context->characteristics[i].uuid, sizeof(uuid_t)); return 0; } - - - if (gattlib_uuid_cmp(&conn_context->characteristics[i].uuid, uuid) == 0) { - handle = conn_context->characteristics[i].value_handle; - return 0; - } } return -1; }