Skip to content
Permalink
Browse files

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>
  • Loading branch information...
MariuszSkamra authored and jhedberg committed May 24, 2019
1 parent 5c6e09b commit f6665c812ef4e24e0aa318b81f67ba05b1847531
Showing with 8 additions and 0 deletions.
  1. +8 −0 subsys/bluetooth/host/gatt.c
@@ -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 */

0 comments on commit f6665c8

Please sign in to comment.
You can’t perform that action at this time.