Skip to content

Commit c4ab06b

Browse files
alexsvenjhedberg
authored andcommitted
tests: bluetooth: tester: Add ASE ID when configuring codec
- We want to add the ASE ID to a stream as early as possible to make sure the events coming from BTTester to Auto-PTS contains the correct information. - Previously the events that came before stream_configured would contain ASE ID 0, regardless of actual value. Signed-off-by: Alexander Svensen <[email protected]>
1 parent 0d18b50 commit c4ab06b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/bluetooth/tester/src/audio/btp_bap_unicast.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ static void stream_configured_cb(struct bt_bap_stream *stream,
511511

512512
u_stream->conn_id = bt_conn_index(stream->conn);
513513
u_conn = &connections[u_stream->conn_id];
514-
u_stream->ase_id = info.id;
515514

516515
stream_state_changed(stream);
517516
}
@@ -1272,6 +1271,12 @@ static int client_configure_codec(struct btp_bap_unicast_connection *u_conn, str
12721271
memcpy(&stream->codec_cfg, codec_cfg, sizeof(*codec_cfg));
12731272
err = bt_bap_stream_config(conn, stream_unicast_to_bap(stream), ep,
12741273
&stream->codec_cfg);
1274+
1275+
if (err == 0) {
1276+
stream->ase_id = ase_id;
1277+
} else {
1278+
stream->in_use = false;
1279+
}
12751280
} else {
12761281
/* Reconfigure a stream */
12771282
memcpy(&stream->codec_cfg, codec_cfg, sizeof(*codec_cfg));

0 commit comments

Comments
 (0)