Skip to content

Bluetooth: BAP: Unicast Client: Omit conn from bt_bap_stream_config #96368

@Thalley

Description

@Thalley

Summary

The struct bt_bap_ep *ep already belongs to a specific bt_conn where it was discovered. The conn argument is thus not necessary, as we can always do a lookup on bt_conn from the endpoint (but not vice versa, since a single conn may have multiple endpoints)>

Describe the solution you'd like

Remove the conn argument from bt_bap_stream_config:

int bt_bap_stream_config(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_bap_ep *ep,
			 struct bt_audio_codec_cfg *codec_cfg);

to

int bt_bap_stream_config(struct bt_bap_stream *stream, struct bt_bap_ep *ep,
			 struct bt_audio_codec_cfg *codec_cfg);

This will also affect and simplify some CAP parameters and checks, and, as an added bonus, make the API easier to use as the application does not need to keep manual track of connection objects and endpoints.

Since a bt_bap_stream will always have an ep when configured, it is also possible to remove

	/** Connection reference */
	struct bt_conn *conn;

from struct bt_bap_stream and have users use bt_bap_ep_get_conn from #96365

Alternatives

No response

Additional Context

No response

Metadata

Metadata

Assignees

Projects

Status

To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions