Bluetooth: gatt: gatt_discover_next with inclusive handle range

This fix ensures that the handle range used for next GATT discovery is
always inclusive. Previously, the discovery procedure could not be
started with equal value of start and end handle.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This commit is contained in:
Kamil Piszczek 2018-09-20 09:21:01 +02:00 committed by Anas Nashif
commit e48434bc71

View file

@ -1166,10 +1166,12 @@ static void gatt_discover_next(struct bt_conn *conn, u16_t last_handle,
params->start_handle = last_handle;
if (params->start_handle < UINT16_MAX) {
params->start_handle++;
} else {
goto done;
}
/* Stop if over the range or the requests */
if (params->start_handle >= params->end_handle) {
if (params->start_handle > params->end_handle) {
goto done;
}