Bluetooth: gatt: Fix infinite read_by_uuid procedure

The attribute handle used to read next attribute has to be incremented
to not loop reading the same attribute.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
Mariusz Skamra 2019-05-24 15:09:32 +02:00 committed by Johan Hedberg
commit f6665c812e

View file

@ -2620,6 +2620,14 @@ static void parse_read_by_uuid(struct bt_conn *conn,
if (rsp->len > length) {
break;
}
/* Stop if it's the last handle to be read */
if (params->by_uuid.start_handle == params->by_uuid.end_handle) {
params->func(conn, 0, params, NULL, 0);
return;
}
params->by_uuid.start_handle++;
}
/* Continue reading the attributes */