Skip to content

Commit 333d48b

Browse files
larsgklaurenmurphyx64
authored andcommitted
Bluetooth: has: Fix uninitialized bt_has_register_param
Zero initialize has_param in BSIM test. Also, specify all bt_has_register_param members in hap_ha sample. Signed-off-by: Lars Knudsen <larsgk@gmail.com>
1 parent b7a766e commit 333d48b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

samples/bluetooth/hap_ha/src/has_server.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ int has_server_preset_init(void)
7676
}
7777

7878
static struct bt_has_register_param param = {
79-
.type = BT_HAS_HEARING_AID_TYPE_MONAURAL
79+
.type = BT_HAS_HEARING_AID_TYPE_MONAURAL,
80+
.preset_sync_support = false,
81+
.independent_presets = false
8082
};
8183

8284
int has_server_init(void)

tests/bluetooth/bsim_bt/bsim_test_audio/src/has_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static const struct bt_has_preset_ops preset_ops = {
2929

3030
static void test_main(void)
3131
{
32-
struct bt_has_register_param has_param;
32+
struct bt_has_register_param has_param = {0};
3333
struct bt_has_preset_register_param preset_param;
3434

3535
int err;

0 commit comments

Comments
 (0)