Skip to content

Commit

Permalink
Bluetooth: audio: fix bug in scan delegator sync
Browse files Browse the repository at this point in the history
In the scan delegator when modifying the source we only want to
send a sync request to the upper layers if we are not yet synced,
and not also on a state change

Note that without this change the babblesim test for long writes
will fail

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>

Scan del bugfix

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
  • Loading branch information
Andries Kruithof authored and carlescufi committed Feb 1, 2024
1 parent c5dcc1a commit 3ef1b04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subsys/bluetooth/audio/bap_scan_delegator.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ static void bass_notify_receive_state(struct bt_conn *conn,

LOG_DBG("Sending bytes %d", ntf_size);
err = bt_gatt_notify_uuid(NULL, BT_UUID_BASS_RECV_STATE,
internal_state->attr, read_buf.data,
ntf_size);
internal_state->attr, read_buf.data,
ntf_size);

if (err != 0 && err != -ENOTCONN) {
LOG_DBG("Could not notify receive state: %d", err);
Expand Down Expand Up @@ -807,7 +807,7 @@ static int scan_delegator_mod_src(struct bt_conn *conn,
* we are not already synced to the device
*/
if (pa_sync != BT_BAP_BASS_PA_REQ_NO_SYNC &&
(state_changed || state->pa_sync_state != BT_BAP_PA_STATE_SYNCED)) {
state->pa_sync_state != BT_BAP_PA_STATE_SYNCED) {
const int err = pa_sync_request(conn, state, pa_sync,
pa_interval);

Expand Down

0 comments on commit 3ef1b04

Please sign in to comment.