From 824e352a772fe1f16ff3cd362588457ef09487ab Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 26 Mar 2024 14:55:55 +0100 Subject: [PATCH] Bluetooth: BAP: Shell: Fix bad err check for PAST sync If pa_sync_past returns 0 then that means we are ready to sync to past, and the BT_BAP_PA_STATE_INFO_REQ state should be set. Signed-off-by: Emil Gydesen --- subsys/bluetooth/audio/shell/bap_scan_delegator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/audio/shell/bap_scan_delegator.c b/subsys/bluetooth/audio/shell/bap_scan_delegator.c index 6b8e703a899..79676875554 100644 --- a/subsys/bluetooth/audio/shell/bap_scan_delegator.c +++ b/subsys/bluetooth/audio/shell/bap_scan_delegator.c @@ -451,7 +451,7 @@ static int cmd_bap_scan_delegator_sync_pa(const struct shell *sh, size_t argc, shell_info(sh, "Syncing with PAST"); err = pa_sync_past(state->conn, state, state->pa_interval); - if (err != 0) { + if (err == 0) { err = bt_bap_scan_delegator_set_pa_state(src_id, BT_BAP_PA_STATE_INFO_REQ); if (err != 0) {