Skip to content

Commit 75919c8

Browse files
committed
samples: Bluetooth: CAP: Initiator: Fix test count name
Renamed total_rx_iso_packet_count to total_unicast_rx_iso_packet_count to make it consistent with total_unicast_tx_iso_packet_count. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 2643902 commit 75919c8

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

samples/bluetooth/cap_initiator/src/cap_initiator_unicast.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ LOG_MODULE_REGISTER(cap_initiator_unicast, LOG_LEVEL_INF);
4545
static struct bt_bap_lc3_preset unicast_preset_16_2_1 = BT_BAP_LC3_UNICAST_PRESET_16_2_1(
4646
BT_AUDIO_LOCATION_MONO_AUDIO, BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
4747
static struct bt_cap_unicast_group *unicast_group;
48-
uint64_t total_rx_iso_packet_count; /* This value is exposed to test code */
48+
uint64_t total_unicast_rx_iso_packet_count; /* This value is exposed to test code */
4949
uint64_t total_unicast_tx_iso_packet_count; /* This value is exposed to test code */
5050

5151
/** Struct to contain information for a specific peer (CAP) device */
@@ -119,8 +119,6 @@ static void unicast_stream_enabled_cb(struct bt_bap_stream *stream)
119119
static void unicast_stream_started_cb(struct bt_bap_stream *stream)
120120
{
121121
LOG_INF("Started stream %p", stream);
122-
total_rx_iso_packet_count = 0U;
123-
total_unicast_tx_iso_packet_count = 0U;
124122

125123
if (is_tx_stream(stream)) {
126124
struct bt_cap_stream *cap_stream =
@@ -179,11 +177,11 @@ static void unicast_stream_recv_cb(struct bt_bap_stream *stream,
179177
* (see the `info->flags` for which flags to check),
180178
*/
181179

182-
if ((total_rx_iso_packet_count % 100U) == 0U) {
183-
LOG_INF("Received %llu HCI ISO data packets", total_rx_iso_packet_count);
180+
if ((total_unicast_rx_iso_packet_count % 100U) == 0U) {
181+
LOG_INF("Received %llu HCI ISO data packets", total_unicast_rx_iso_packet_count);
184182
}
185183

186-
total_rx_iso_packet_count++;
184+
total_unicast_rx_iso_packet_count++;
187185
}
188186

189187
static void unicast_stream_sent_cb(struct bt_bap_stream *stream)
@@ -801,6 +799,9 @@ static int reset_cap_initiator(void)
801799
k_sem_reset(&sem_state_change);
802800
k_sem_reset(&sem_mtu_exchanged);
803801

802+
total_unicast_rx_iso_packet_count = 0U;
803+
total_unicast_tx_iso_packet_count = 0U;
804+
804805
return 0;
805806
}
806807

tests/bsim/bluetooth/audio_samples/cap/initiator/src/cap_initiator_sample_test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ static void test_cap_initiator_sample_tick(bs_time_t HW_device_time)
4646
*/
4747

4848
if (IS_ENABLED(CONFIG_SAMPLE_UNICAST)) {
49-
extern uint64_t total_rx_iso_packet_count;
49+
extern uint64_t total_unicast_rx_iso_packet_count;
5050
extern uint64_t total_unicast_tx_iso_packet_count;
5151

5252
bs_trace_info_time(2, "%" PRIu64 " unicast packets received, expected >= %i\n",
53-
total_rx_iso_packet_count, PASS_THRESHOLD);
53+
total_unicast_rx_iso_packet_count, PASS_THRESHOLD);
5454
bs_trace_info_time(2, "%" PRIu64 " unicast packets sent, expected >= %i\n",
5555
total_unicast_tx_iso_packet_count, PASS_THRESHOLD);
5656

57-
if (total_rx_iso_packet_count < PASS_THRESHOLD ||
57+
if (total_unicast_rx_iso_packet_count < PASS_THRESHOLD ||
5858
total_unicast_tx_iso_packet_count < PASS_THRESHOLD) {
59-
FAIL("cap_initiator FAILED with(Did not pass after %d seconds)\n ",
59+
FAIL("cap_initiator unicast FAILED (Did not pass after %d seconds)\n ",
6060
WAIT_TIME);
6161
return;
6262
}
@@ -69,7 +69,7 @@ static void test_cap_initiator_sample_tick(bs_time_t HW_device_time)
6969
total_broadcast_tx_iso_packet_count, PASS_THRESHOLD);
7070

7171
if (total_broadcast_tx_iso_packet_count < PASS_THRESHOLD) {
72-
FAIL("cap_initiator FAILED with (Did not pass after %d seconds)\n ",
72+
FAIL("cap_initiator broadcast FAILED (Did not pass after %d seconds)\n ",
7373
WAIT_TIME);
7474
return;
7575
}

0 commit comments

Comments
 (0)