From d65ee066a1187cd868843111253c0462092f19a0 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 29 May 2012 10:55:26 -0300 Subject: [PATCH] GATT: Avoid unneeded discover transaction This patch fix unneeded discover characteristics transaction when the last characteristic declaration contains the handle number equals to the end handle of the primary service. --- attrib/gatt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attrib/gatt.c b/attrib/gatt.c index b9c2bbb28..6f9a11de0 100644 --- a/attrib/gatt.c +++ b/attrib/gatt.c @@ -303,7 +303,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen, att_data_list_free(list); err = 0; - if (last != 0) { + if (last != 0 && (last + 1 < dc->end)) { buf = g_attrib_get_buffer(dc->attrib, &buflen); bt_uuid16_create(&uuid, GATT_CHARAC_UUID); -- 2.47.3