Skip to content

Commit 60c50e5

Browse files
alexsvennordicjm
authored andcommitted
tests: nrf_auraconfig: Create tester
- Use generic broadcast_sink sample from Zephyr as base - Add a struct to contain all values to compare - Store adv_name and broadcast_name - Parse BASEs and populate struct - Add shell interface for setting expected values - Create function for comparing dut with expected - Compare all values and print success or fail - Add BSIM related files - OCT-3162 tests: nrf_auraconfig: Integrate with BSIM - Create a tester main for the nrf_auraconfig sample - Parse arguments and send to correct device - Add log level to le_audio_tx to suppress warnings - OCT-3193 Signed-off-by: Alexander Svensen <[email protected]> doc: rework README from txt to rst Reworked both README.txt to README.rst. Minimal edits made. The decision is still pending from stakeholders where to put the test documentation and how to document, so for now I was told to follow the cryptography tests case. Signed-off-by: Grzegorz Ferenc <[email protected]>
1 parent 4a745e3 commit 60c50e5

File tree

34 files changed

+5055
-2804
lines changed

34 files changed

+5055
-2804
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@
714714
/tests/benchmarks/multicore/idle/ @adamkondraciuk @nrfconnect/ncs-low-level-test
715715
/tests/benchmarks/multicore/idle_gpio/ @adamkondraciuk @nrfconnect/ncs-low-level-test
716716
/tests/bluetooth/iso/ @nrfconnect/ncs-audio @Frodevan
717+
/tests/bluetooth/bsim/nrf_auraconfig/ @nrfconnect/ncs-audio
717718
/tests/bluetooth/tester/ @carlescufi @nrfconnect/ncs-paladin
718719
/tests/crypto/ @stephen-nordic @magnev
719720
/tests/drivers/gpio/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus

applications/nrf5340_audio/src/audio/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ config SW_CODEC_LC3
192192
help
193193
LC3 is the mandatory codec for LE Audio.
194194

195+
config SW_CODEC_NONE
196+
bool "None"
197+
help
198+
Choose this if no software (SW) codec is needed.
199+
195200
# Leave room for other codecs
196201
endchoice
197202

applications/nrf5340_audio/src/bluetooth/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ module = BLE
107107
module-str = ble
108108
source "subsys/logging/Kconfig.template.log_config"
109109

110+
module = BT_LE_AUDIO_TX
111+
module-str = bt_le_audio_tx
112+
source "subsys/logging/Kconfig.template.log_config"
113+
110114
endmenu # Log levels
111115

112116
#----------------------------------------------------------------------------#

applications/nrf5340_audio/src/bluetooth/bt_management/bt_mgmt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <zephyr/bluetooth/hci.h>
1313
#include <zephyr/settings/settings.h>
1414
#include <zephyr/sys/byteorder.h>
15+
#include <nrfx.h>
1516

1617
#include "macros_common.h"
1718
#include "zbus_common.h"

applications/nrf5340_audio/src/bluetooth/bt_stream/bt_le_audio_tx/bt_le_audio_tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "audio_sync_timer.h"
1717

1818
#include <zephyr/logging/log.h>
19-
LOG_MODULE_REGISTER(bt_le_audio_tx, CONFIG_BLE_LOG_LEVEL);
19+
LOG_MODULE_REGISTER(bt_le_audio_tx, CONFIG_BT_LE_AUDIO_TX_LOG_LEVEL);
2020

2121
ZBUS_CHAN_DEFINE(sdu_ref_chan, struct sdu_ref_msg, NULL, NULL, ZBUS_OBSERVERS_EMPTY,
2222
ZBUS_MSG_INIT(0));

applications/nrf5340_audio/src/modules/audio_sync_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static int audio_sync_timer_init(void)
158158
return -ENODEV;
159159
}
160160

161-
IRQ_CONNECT(RTC0_IRQn, IRQ_PRIO_LOWEST, nrfx_rtc_0_irq_handler, NULL, 0);
161+
IRQ_CONNECT(RTC0_IRQn, IRQ_PRIO_LOWEST, nrfx_isr, nrfx_rtc_0_irq_handler, 0);
162162
nrfx_rtc_overflow_enable(&audio_sync_lf_timer_instance, true);
163163

164164
/* Initialize capturing of I2S frame start event timestamps */

doc/nrf/samples/bl.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ This section lists the available |NCS| samples for the :ref:`ug_bt` protocol.
1717
:glob:
1818

1919
../../../samples/bluetooth/*/README
20+
../../tests/bluetooth/bsim/nrf_auraconfig/README
21+
../../tests/bluetooth/bsim/nrf_auraconfig/tester/README

samples/bluetooth/nrf_auraconfig/include/nrf_auraconfig.h

Lines changed: 10 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -7,170 +7,18 @@
77
#ifndef _NRF_AURACONFIG_H_
88
#define _NRF_AURACONFIG_H_
99

10-
#include <zephyr/bluetooth/audio/audio.h>
11-
#include <zephyr/bluetooth/audio/bap_lc3_preset.h>
12-
13-
#define PRESET_NAME_MAX 8
14-
#define LANGUAGE_LEN 3
15-
16-
/* The location and context type will be set by further down */
17-
/* Low latency settings */
18-
static struct bt_bap_lc3_preset lc3_preset_8_1_1 =
19-
BT_BAP_LC3_BROADCAST_PRESET_8_1_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
20-
static struct bt_bap_lc3_preset lc3_preset_8_2_1 =
21-
BT_BAP_LC3_BROADCAST_PRESET_8_2_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
22-
static struct bt_bap_lc3_preset lc3_preset_16_1_1 =
23-
BT_BAP_LC3_BROADCAST_PRESET_16_1_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
24-
static struct bt_bap_lc3_preset lc3_preset_16_2_1 =
25-
BT_BAP_LC3_BROADCAST_PRESET_16_2_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
26-
static struct bt_bap_lc3_preset lc3_preset_24_1_1 =
27-
BT_BAP_LC3_BROADCAST_PRESET_24_1_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
28-
static struct bt_bap_lc3_preset lc3_preset_24_2_1 =
29-
BT_BAP_LC3_BROADCAST_PRESET_24_2_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
30-
static struct bt_bap_lc3_preset lc3_preset_32_1_1 =
31-
BT_BAP_LC3_BROADCAST_PRESET_32_1_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
32-
static struct bt_bap_lc3_preset lc3_preset_32_2_1 =
33-
BT_BAP_LC3_BROADCAST_PRESET_32_2_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
34-
static struct bt_bap_lc3_preset lc3_preset_48_1_1 =
35-
BT_BAP_LC3_BROADCAST_PRESET_48_1_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
36-
static struct bt_bap_lc3_preset lc3_preset_48_2_1 =
37-
BT_BAP_LC3_BROADCAST_PRESET_48_2_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
38-
static struct bt_bap_lc3_preset lc3_preset_48_3_1 =
39-
BT_BAP_LC3_BROADCAST_PRESET_48_3_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
40-
static struct bt_bap_lc3_preset lc3_preset_48_4_1 =
41-
BT_BAP_LC3_BROADCAST_PRESET_48_4_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
42-
static struct bt_bap_lc3_preset lc3_preset_48_5_1 =
43-
BT_BAP_LC3_BROADCAST_PRESET_48_5_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
44-
static struct bt_bap_lc3_preset lc3_preset_48_6_1 =
45-
BT_BAP_LC3_BROADCAST_PRESET_48_6_1(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
46-
/* High reliability settings */
47-
static struct bt_bap_lc3_preset lc3_preset_8_1_2 =
48-
BT_BAP_LC3_BROADCAST_PRESET_8_1_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
49-
static struct bt_bap_lc3_preset lc3_preset_8_2_2 =
50-
BT_BAP_LC3_BROADCAST_PRESET_8_2_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
51-
static struct bt_bap_lc3_preset lc3_preset_16_1_2 =
52-
BT_BAP_LC3_BROADCAST_PRESET_16_1_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
53-
static struct bt_bap_lc3_preset lc3_preset_16_2_2 =
54-
BT_BAP_LC3_BROADCAST_PRESET_16_2_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
55-
static struct bt_bap_lc3_preset lc3_preset_24_1_2 =
56-
BT_BAP_LC3_BROADCAST_PRESET_24_1_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
57-
static struct bt_bap_lc3_preset lc3_preset_24_2_2 =
58-
BT_BAP_LC3_BROADCAST_PRESET_24_2_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
59-
static struct bt_bap_lc3_preset lc3_preset_32_1_2 =
60-
BT_BAP_LC3_BROADCAST_PRESET_32_1_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
61-
static struct bt_bap_lc3_preset lc3_preset_32_2_2 =
62-
BT_BAP_LC3_BROADCAST_PRESET_32_2_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
63-
static struct bt_bap_lc3_preset lc3_preset_48_1_2 =
64-
BT_BAP_LC3_BROADCAST_PRESET_48_1_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
65-
static struct bt_bap_lc3_preset lc3_preset_48_2_2 =
66-
BT_BAP_LC3_BROADCAST_PRESET_48_2_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
67-
static struct bt_bap_lc3_preset lc3_preset_48_3_2 =
68-
BT_BAP_LC3_BROADCAST_PRESET_48_3_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
69-
static struct bt_bap_lc3_preset lc3_preset_48_4_2 =
70-
BT_BAP_LC3_BROADCAST_PRESET_48_4_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
71-
static struct bt_bap_lc3_preset lc3_preset_48_5_2 =
72-
BT_BAP_LC3_BROADCAST_PRESET_48_5_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
73-
static struct bt_bap_lc3_preset lc3_preset_48_6_2 =
74-
BT_BAP_LC3_BROADCAST_PRESET_48_6_2(BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_ANY);
75-
76-
struct bap_preset {
77-
struct bt_bap_lc3_preset *preset;
78-
char name[PRESET_NAME_MAX];
79-
};
80-
81-
static struct bap_preset bap_presets[] = {
82-
{.preset = &lc3_preset_8_1_1, .name = "8_1_1"},
83-
{.preset = &lc3_preset_8_2_1, .name = "8_2_1"},
84-
{.preset = &lc3_preset_16_1_1, .name = "16_1_1"},
85-
{.preset = &lc3_preset_16_2_1, .name = "16_2_1"},
86-
{.preset = &lc3_preset_24_1_1, .name = "24_1_1"},
87-
{.preset = &lc3_preset_24_2_1, .name = "24_2_1"},
88-
{.preset = &lc3_preset_32_1_1, .name = "32_1_1"},
89-
{.preset = &lc3_preset_32_2_1, .name = "32_2_1"},
90-
{.preset = &lc3_preset_48_1_1, .name = "48_1_1"},
91-
{.preset = &lc3_preset_48_2_1, .name = "48_2_1"},
92-
{.preset = &lc3_preset_48_3_1, .name = "48_3_1"},
93-
{.preset = &lc3_preset_48_4_1, .name = "48_4_1"},
94-
{.preset = &lc3_preset_48_5_1, .name = "48_5_1"},
95-
{.preset = &lc3_preset_48_6_1, .name = "48_6_1"},
96-
{.preset = &lc3_preset_8_1_2, .name = "8_1_2"},
97-
{.preset = &lc3_preset_8_2_2, .name = "8_2_2"},
98-
{.preset = &lc3_preset_16_1_2, .name = "16_1_2"},
99-
{.preset = &lc3_preset_16_2_2, .name = "16_2_2"},
100-
{.preset = &lc3_preset_24_1_2, .name = "24_1_2"},
101-
{.preset = &lc3_preset_24_2_2, .name = "24_2_2"},
102-
{.preset = &lc3_preset_32_1_2, .name = "32_1_2"},
103-
{.preset = &lc3_preset_32_2_2, .name = "32_2_2"},
104-
{.preset = &lc3_preset_48_1_2, .name = "48_1_2"},
105-
{.preset = &lc3_preset_48_2_2, .name = "48_2_2"},
106-
{.preset = &lc3_preset_48_3_2, .name = "48_3_2"},
107-
{.preset = &lc3_preset_48_4_2, .name = "48_4_2"},
108-
{.preset = &lc3_preset_48_5_2, .name = "48_5_2"},
109-
{.preset = &lc3_preset_48_6_2, .name = "48_6_2"},
110-
};
111-
112-
#define LOCATION_NAME_LEN_MAX 4
113-
struct audio_location {
114-
enum bt_audio_location location;
115-
char name[LOCATION_NAME_LEN_MAX + 1];
116-
};
117-
118-
/* Note: If there is any change to the specification of audio
119-
* locations then this structure must be checked for conformance.
10+
/**
11+
* @defgroup auraconfig nRF Auraconfig
12+
* @brief nRF Auraconfig
13+
*
14+
* @{
12015
*/
121-
static struct audio_location locations[] = {
122-
{.location = BT_AUDIO_LOCATION_MONO_AUDIO, .name = "MA"},
123-
{.location = BT_AUDIO_LOCATION_FRONT_LEFT, .name = "FL"},
124-
{.location = BT_AUDIO_LOCATION_FRONT_RIGHT, .name = "FR"},
125-
{.location = BT_AUDIO_LOCATION_FRONT_CENTER, .name = "FC"},
126-
{.location = BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1, .name = "LFE1"},
127-
{.location = BT_AUDIO_LOCATION_BACK_LEFT, .name = "BL"},
128-
{.location = BT_AUDIO_LOCATION_BACK_RIGHT, .name = "BR"},
129-
{.location = BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER, .name = "FLC"},
130-
{.location = BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER, .name = "FRC"},
131-
{.location = BT_AUDIO_LOCATION_BACK_CENTER, .name = "BC"},
132-
{.location = BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2, .name = "LFE2"},
133-
{.location = BT_AUDIO_LOCATION_SIDE_LEFT, .name = "SL"},
134-
{.location = BT_AUDIO_LOCATION_SIDE_RIGHT, .name = "SR"},
135-
{.location = BT_AUDIO_LOCATION_TOP_FRONT_LEFT, .name = "TFL"},
136-
{.location = BT_AUDIO_LOCATION_TOP_FRONT_RIGHT, .name = "TFR"},
137-
{.location = BT_AUDIO_LOCATION_TOP_FRONT_CENTER, .name = "TFC"},
138-
{.location = BT_AUDIO_LOCATION_TOP_CENTER, .name = "TC"},
139-
{.location = BT_AUDIO_LOCATION_TOP_BACK_LEFT, .name = "TBL"},
140-
{.location = BT_AUDIO_LOCATION_TOP_BACK_RIGHT, .name = "TBR"},
141-
{.location = BT_AUDIO_LOCATION_TOP_SIDE_LEFT, .name = "TSL"},
142-
{.location = BT_AUDIO_LOCATION_TOP_SIDE_RIGHT, .name = "TSR"},
143-
{.location = BT_AUDIO_LOCATION_TOP_BACK_CENTER, .name = "TBC"},
144-
{.location = BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER, .name = "BFC"},
145-
{.location = BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT, .name = "BFL"},
146-
{.location = BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT, .name = "BFR"},
147-
{.location = BT_AUDIO_LOCATION_FRONT_LEFT_WIDE, .name = "FLW"},
148-
{.location = BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE, .name = "FRW"},
149-
{.location = BT_AUDIO_LOCATION_LEFT_SURROUND, .name = "LS"},
150-
{.location = BT_AUDIO_LOCATION_RIGHT_SURROUND, .name = "RS"},
151-
};
15216

153-
enum usecase_type {
154-
LECTURE,
155-
SILENT_TV_1,
156-
SILENT_TV_2,
157-
MULTI_LANGUAGE,
158-
PERSONAL_SHARING,
159-
PERSONAL_MULTI_LANGUAGE,
160-
};
161-
162-
struct usecase_info {
163-
enum usecase_type use_case;
164-
char name[40];
165-
};
17+
/**
18+
* @brief Main function for the Auraconfig sample.
19+
*/
20+
void nrf_auraconfig_main(void);
16621

167-
static struct usecase_info pre_defined_use_cases[] = {
168-
{.use_case = LECTURE, .name = "Lecture"},
169-
{.use_case = SILENT_TV_1, .name = "Silent TV 1"},
170-
{.use_case = SILENT_TV_2, .name = "Silent TV 2"},
171-
{.use_case = MULTI_LANGUAGE, .name = "Multi-language"},
172-
{.use_case = PERSONAL_SHARING, .name = "Personal sharing"},
173-
{.use_case = PERSONAL_MULTI_LANGUAGE, .name = "Personal multi-language"},
174-
};
22+
/** @} */
17523

17624
#endif /* _NRF_AURACONFIG_H_ */

0 commit comments

Comments
 (0)