Skip to content

Commit

Permalink
Bluetooth: host: added missing conditional compile
Browse files Browse the repository at this point in the history
There was a conditional compile misssing for the
BT_PER_ADV_SYNC_TRANSFER_SENDER, potentially leading
to build failures

Signed-off-by: Andries Kruithof <[email protected]>
  • Loading branch information
kruithofa committed Nov 2, 2023
1 parent 639d1f8 commit 67675d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions subsys/bluetooth/audio/shell/bap_broadcast_assistant.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static void bap_broadcast_assistant_recv_state_cb(
}
}

if (per_adv_sync) {
if (per_adv_sync && IS_ENABLED(CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER)) {
shell_print(ctx_shell, "Sending PAST");

err = bt_le_per_adv_sync_transfer(per_adv_sync,
Expand Down Expand Up @@ -202,7 +202,8 @@ static void bap_broadcast_assistant_recv_state_cb(
}
}

if (ext_adv != NULL && IS_ENABLED(CONFIG_BT_PER_ADV)) {
if (ext_adv != NULL && IS_ENABLED(CONFIG_BT_PER_ADV) &&
IS_ENABLED(CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER)) {
shell_print(ctx_shell, "Sending local PAST");

err = bt_le_per_adv_set_info_transfer(ext_adv, conn,
Expand Down
12 changes: 8 additions & 4 deletions subsys/bluetooth/audio/shell/bap_scan_delegator.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static void pa_timer_handler(struct k_work *work)
}
}

#if defined(CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER)
static int pa_sync_past(struct bt_conn *conn,
struct sync_state *state,
uint16_t pa_interval)
Expand All @@ -167,6 +168,7 @@ static int pa_sync_past(struct bt_conn *conn,

return err;
}
#endif

static int pa_sync_no_past(struct sync_state *state,
uint16_t pa_interval)
Expand Down Expand Up @@ -441,9 +443,11 @@ static int cmd_bap_scan_delegator_sync_pa(const struct shell *sh, size_t argc,
return -ENOEXEC;
}

if (past_preference &&
state->past_avail &&
state->conn != NULL) {
if (0) {
#if defined(CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER)
} else if (past_preference &&
state->past_avail &&
state->conn != NULL) {
shell_info(sh, "Syncing with PAST");

err = pa_sync_past(state->conn, state, state->pa_interval);
Expand All @@ -458,7 +462,7 @@ static int cmd_bap_scan_delegator_sync_pa(const struct shell *sh, size_t argc,

return -ENOEXEC;
}

#endif
} else {
shell_info(sh, "Syncing without PAST");
err = pa_sync_no_past(state, state->pa_interval);
Expand Down

0 comments on commit 67675d8

Please sign in to comment.