From 0fa9701a260d49f946e46841a607b14065b715c3 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 10 Oct 2024 21:03:33 +0200 Subject: [PATCH] Bluetooth: Tester: Added flag parameter to CAP stop cmd Added a flag parameter so that it is possible to use the bt_cap_initiator_unicast_audio_stop to perform disable+stop without releasing the streams by setting the RELEASE flag. This allows us to use the bt_cap_initiator_unicast_audio_stop function to just disable streams without releasing them, as that is requested by some PTS tests such as CAP/INI/UST/BV-40-C. Signed-off-by: Emil Gydesen --- tests/bluetooth/tester/src/audio/btp/btp_cap.h | 2 ++ tests/bluetooth/tester/src/audio/btp_cap.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/bluetooth/tester/src/audio/btp/btp_cap.h b/tests/bluetooth/tester/src/audio/btp/btp_cap.h index 303f7930033..ca6714bca60 100644 --- a/tests/bluetooth/tester/src/audio/btp/btp_cap.h +++ b/tests/bluetooth/tester/src/audio/btp/btp_cap.h @@ -60,7 +60,9 @@ struct btp_cap_unicast_audio_update_data { #define BTP_CAP_UNICAST_AUDIO_STOP 0x06 struct btp_cap_unicast_audio_stop_cmd { uint8_t cig_id; + uint8_t flags; } __packed; +#define BTP_CAP_UNICAST_AUDIO_STOP_FLAG_RELEASE BIT(0) #define BTP_CAP_BROADCAST_SOURCE_SETUP_STREAM 0x07 struct btp_cap_broadcast_source_setup_stream_cmd { diff --git a/tests/bluetooth/tester/src/audio/btp_cap.c b/tests/bluetooth/tester/src/audio/btp_cap.c index 9316db7c62b..f8da879ae10 100644 --- a/tests/bluetooth/tester/src/audio/btp_cap.c +++ b/tests/bluetooth/tester/src/audio/btp_cap.c @@ -438,7 +438,7 @@ static uint8_t btp_cap_unicast_audio_stop(const void *cmd, uint16_t cmd_len, param.streams = streams; param.count = stream_cnt; param.type = BT_CAP_SET_TYPE_AD_HOC; - param.release = true; + param.release = (cp->flags & BTP_CAP_UNICAST_AUDIO_STOP_FLAG_RELEASE) != 0; err = bt_cap_initiator_unicast_audio_stop(¶m); if (err != 0) {