Skip to content

Commit ac21234

Browse files
committed
tests: Bluetooth: Audio: Add common TEST_SAMPLE_SIRK
Add a common definition of the TEST_SAMPLE_SIRK used by the BSIM tests. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent 3f3a8fb commit ac21234

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

tests/bsim/bluetooth/audio/src/cap_acceptor_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,7 @@ static void init(void)
680680
.rank = 1,
681681
.lockable = true,
682682
/* Using the CSIP_SET_MEMBER test sample SIRK */
683-
.sirk = { 0xcd, 0xcc, 0x72, 0xdd, 0x86, 0x8c, 0xcd, 0xce,
684-
0x22, 0xfd, 0xa1, 0x21, 0x09, 0x7d, 0x7d, 0x45 },
683+
.sirk = TEST_SAMPLE_SIRK,
685684
};
686685
static const struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP_LC3(
687686
BT_AUDIO_CODEC_CAP_FREQ_ANY, BT_AUDIO_CODEC_CAP_DURATION_ANY,

tests/bsim/bluetooth/audio/src/common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ static const uint8_t mock_iso_data[] = {
7272
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
7373
};
7474

75+
/* The sample SIRK as defined by the CSIS spec Appendix A.1.
76+
* Sample data is Big Endian, so we reverse it for little-endian
77+
*/
78+
#define TEST_SAMPLE_SIRK \
79+
{REVERSE_ARGS(0x45, 0x7d, 0x7d, 0x09, 0x21, 0xa1, 0xfd, 0x22, 0xce, 0xcd, 0x8c, 0x86, \
80+
0xdd, 0x72, 0xcc, 0xcd)}
81+
7582
#define MIN_SEND_COUNT 100
7683
#define WAIT_SECONDS 100 /* seconds */
7784
#define WAIT_TIME (WAIT_SECONDS * USEC_PER_SEC) /* microseconds*/

tests/bsim/bluetooth/audio/src/csip_set_member_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ static uint8_t sirk_read_req_rsp = BT_CSIP_READ_SIRK_REQ_RSP_ACCEPT;
2626
struct bt_csip_set_member_register_param param = {
2727
.lockable = true,
2828
/* Using the CSIS test sample SIRK */
29-
.sirk = {0xcd, 0xcc, 0x72, 0xdd, 0x86, 0x8c, 0xcd, 0xce, 0x22, 0xfd, 0xa1, 0x21, 0x09, 0x7d,
30-
0x7d, 0x45},
29+
.sirk = TEST_SAMPLE_SIRK,
3130
};
3231

3332
static void csip_lock_changed_cb(struct bt_conn *conn,

tests/bsim/bluetooth/audio/src/gmap_ugt_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,7 @@ static void test_main(void)
455455
.rank = csis_rank,
456456
.lockable = true,
457457
/* Using the CSIP_SET_MEMBER test sample SIRK */
458-
.sirk = { 0xcd, 0xcc, 0x72, 0xdd, 0x86, 0x8c, 0xcd, 0xce,
459-
0x22, 0xfd, 0xa1, 0x21, 0x09, 0x7d, 0x7d, 0x45 },
458+
.sirk = TEST_SAMPLE_SIRK,
460459
};
461460

462461
err = bt_cap_acceptor_register(&csip_set_member_param, &csip_set_member);

0 commit comments

Comments
 (0)