From 930aae0eb39545a605f84a4f22638073842cb789 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 10 Oct 2023 12:45:53 +0200 Subject: [PATCH 1/2] Bluetooth: BAP: Scan delegator missing state change for bis_sync If the bis_sync value changes, that should trigger a state change notification. Signed-off-by: Emil Gydesen --- subsys/bluetooth/audio/bap_scan_delegator.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 251bd722ec4647..7d5cd700e5f2ac 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1340,7 +1340,10 @@ int bt_bap_scan_delegator_mod_src(const struct bt_bap_scan_delegator_mod_src_par const struct bt_bap_scan_delegator_subgroup *param_subgroup = ¶m->subgroups[i]; struct bt_bap_scan_delegator_subgroup *subgroup = &state->subgroups[i]; - subgroup->bis_sync = param_subgroup->bis_sync; + if (subgroup->bis_sync != param_subgroup->bis_sync) { + subgroup->bis_sync = param_subgroup->bis_sync; + state_changed = true; + } /* If the metadata len is 0, we shall not overwrite the existing metadata */ if (param_subgroup->metadata_len == 0U) { From bcdfe9e51b1ffe2698673e33488d3615f79d641b Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 10 Oct 2023 14:09:53 +0200 Subject: [PATCH 2/2] Bluetooth: BAP: Remove static from state_changed in mod_src For some reason the state_change variable was static, which does not make any sense. Changed it to a regular local bool in bt_bap_scan_delegator_mod_src. Signed-off-by: Emil Gydesen --- subsys/bluetooth/audio/bap_scan_delegator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/audio/bap_scan_delegator.c b/subsys/bluetooth/audio/bap_scan_delegator.c index 7d5cd700e5f2ac..19d339974539a5 100644 --- a/subsys/bluetooth/audio/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/bap_scan_delegator.c @@ -1298,7 +1298,7 @@ int bt_bap_scan_delegator_mod_src(const struct bt_bap_scan_delegator_mod_src_par { struct bass_recv_state_internal *internal_state = NULL; struct bt_bap_scan_delegator_recv_state *state; - static bool state_changed; + bool state_changed = false; CHECKIF(!valid_bt_bap_scan_delegator_mod_src_param(param)) { return -EINVAL;