zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.62k stars 6.5k forks source link

Bluetooth: BAP: Add broadcast sink/source callback structs #75252

Open Thalley opened 3 months ago

Thalley commented 3 months ago

Is your enhancement proposal related to a problem? Please describe. Operations on the broadcast sink and sources affect an entire BIG. For example, if you create a broadcast source with 4 BIS, they will all be created and started at the same time (and with a single HCI event), but in Zephyr they are treated as 4 individual streams.

In some cases such as stopping a broadcast sink or source followed by a delete, you will today need to wait for each stream to be stopped, before you can delete the underlying structure. Having set of callbacks that affect entire broadcast sink or sources, rather than the individual streams, will be useful here, as you only need to wait for a single callback (and can even do the delete operation in that callback).

Describe the solution you'd like Create a struct for callbacks for broadcast sources and a struct for broadcast sinks. The callbacks in these struct should reflect state changes in the source and sink, such as deleted, configured, stopped and started.

Describe alternatives you've considered N/A

Additional context It may make sense to first implement this at the ISO layer, and then simply use the BIG callbacks from ISO to trigger the BAP callbacks.

Thalley commented 3 months ago

Somewhat related to https://github.com/zephyrproject-rtos/zephyr/issues/75252