Skip to content

Commit a5ce3da

Browse files
hermabecarlescufi
authored andcommitted
Bluetooth: Tests: Fix uninitialized value in eatt_notif test
The chan_opt field was not set, and on some platforms it ended up with an invalid value. Explicitly set the field on all GATT parameter structs and make the discovery params static. Fixes #50520 Signed-off-by: Herman Berget <[email protected]>
1 parent 9ac6779 commit a5ce3da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/bluetooth/bsim_bt/bsim_test_eatt_notif/src/server_test.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ static void gatt_discover(void)
115115
discover_params.start_handle = BT_ATT_FIRST_ATTRIBUTE_HANDLE;
116116
discover_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;
117117
discover_params.type = BT_GATT_DISCOVER_PRIMARY;
118+
discover_params.chan_opt = BT_ATT_CHAN_OPT_NONE;
118119

119120
err = bt_gatt_discover(g_conn, &discover_params);
120121
if (err != 0) {
@@ -162,7 +163,8 @@ static void gatt_subscribe(void)
162163
subscribe_params.ccc_handle = 0;
163164
subscribe_params.disc_params = &disc_params,
164165
subscribe_params.value = BT_GATT_CCC_NOTIFY;
165-
subscribe_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE,
166+
subscribe_params.end_handle = BT_ATT_LAST_ATTRIBUTE_HANDLE;
167+
subscribe_params.chan_opt = BT_ATT_CHAN_OPT_NONE;
166168

167169
printk("Subscribing: val %x\n", chrc_handle);
168170
err = bt_gatt_subscribe(g_conn, &subscribe_params);

0 commit comments

Comments
 (0)