Skip to content

Commit 64cc5a3

Browse files
Vudentzcarlescufi
authored andcommitted
Bluetooth: GATT: Fix BT_GATT_AUTO_DISCOVER_CCC
When using BT_GATT_AUTO_DISCOVER_CCC if the ccc_handle is not set bt_gatt_subscribe would initiate a discovery to locate the CCC handle but instead of awaiting it to complete the code does proceed to call gatt_write_ccc even with ccc_handle being 0x0000 which is invalid. Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 3026df2 commit 64cc5a3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

subsys/bluetooth/host/gatt.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4129,10 +4129,7 @@ int bt_gatt_subscribe(struct bt_conn *conn,
41294129

41304130
#if defined(CONFIG_BT_GATT_AUTO_DISCOVER_CCC)
41314131
if (!params->ccc_handle) {
4132-
err = gatt_ccc_discover(conn, params);
4133-
if (err) {
4134-
return err;
4135-
}
4132+
return gatt_ccc_discover(conn, params);
41364133
}
41374134
#endif
41384135
err = gatt_write_ccc(conn, params->ccc_handle, params->value,

0 commit comments

Comments
 (0)