Commit 48b7f236 authored by Mariusz Skamra's avatar Mariusz Skamra Committed by Johan Hedberg
Browse files

Bluetooth: Fix assertion condition in bt_gatt_discover



This fixes invalid assert condition.

As stated in Bluetooth Core v5.0 Vol 3 Part F
3.4.4.1 Read By Type Request &&
3.4.4.9 Read by Group Type Request
"The starting handle shall be less than or equal to the
ending handle."

3.4.3.1 Find Information Request &&
3.4.3.3 Find By Type Value Request
"Only attributes with attribute handles between and
including the Starting Handle parameter and the Ending
Handle parameter that match the requested attribute type
and the attribute value that have sufficient permissions
to allow reading will be returned."

Signed-off-by: default avatarMariusz Skamra <mariusz.skamra@codecoup.pl>
parent 354c8222
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1618,7 +1618,7 @@ int bt_gatt_discover(struct bt_conn *conn,
	__ASSERT(params && params->func, "invalid parameters\n");
	__ASSERT((params->start_handle && params->end_handle),
		 "invalid parameters\n");
	__ASSERT((params->start_handle < params->end_handle),
	__ASSERT((params->start_handle <= params->end_handle),
		 "invalid parameters\n");

	if (conn->state != BT_CONN_CONNECTED) {