diff --git a/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.c b/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.c index 6cd9bad48a5..90c9b22be5c 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.c @@ -152,6 +152,11 @@ void btp_bap_audio_stream_stopped(struct btp_bap_audio_stream *a_stream) k_work_cancel_delayable(&a_stream->audio_send_work); } +uint8_t btp_bap_audio_stream_send_data(const uint8_t *data, uint8_t data_len) +{ + return ring_buf_put(&audio_ring_buf, data, data_len); +} + uint8_t btp_bap_audio_stream_send(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) { @@ -159,7 +164,7 @@ uint8_t btp_bap_audio_stream_send(const void *cmd, uint16_t cmd_len, const struct btp_bap_send_cmd *cp = cmd; uint32_t ret; - ret = ring_buf_put(&audio_ring_buf, cp->data, cp->data_len); + ret = btp_bap_audio_stream_send_data(cp->data, cp->data_len); rp->data_len = ret; *rsp_len = sizeof(*rp) + 1; diff --git a/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.h b/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.h index 902a8f909be..65bd58bf524 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.h +++ b/tests/bluetooth/tester/src/audio/btp_bap_audio_stream.h @@ -21,3 +21,4 @@ int btp_bap_audio_stream_init_send_worker(void); void btp_bap_audio_stream_started(struct btp_bap_audio_stream *stream); void btp_bap_audio_stream_stopped(struct btp_bap_audio_stream *a_stream); uint8_t btp_bap_audio_stream_send(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len); +uint8_t btp_bap_audio_stream_send_data(const uint8_t *data, uint8_t data_len); diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index cf502b5861d..349cc471c47 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -626,6 +626,8 @@ static void stream_started(struct bt_bap_stream *stream) { struct btp_bap_unicast_stream *u_stream = stream_bap_to_unicast(stream); struct bt_bap_ep_info info; + static uint8_t test_data[CONFIG_BT_ISO_TX_MTU]; + uint16_t sdu; /* Callback called on transition to Streaming state */ @@ -635,6 +637,14 @@ static void stream_started(struct bt_bap_stream *stream) (void)bt_bap_ep_get_info(stream->ep, &info); btp_send_ascs_ase_state_changed_ev(stream->conn, u_stream->ase_id, info.state); + + /* Send test data after entering streaming state. For now this seems to + * be required by PTS as there is not Upper Tester action for this in + * Test Specification + */ + memset(test_data, 42, sizeof(test_data)); + sdu = MIN(stream->qos->sdu, sizeof(test_data)); + btp_bap_audio_stream_send_data(test_data, sdu); } static void stream_connected(struct bt_bap_stream *stream)