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:
parent
350c3d7734
commit
e48434bc71
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue