Bluetooth: Audio: Refactor ISO allocation endpoints

Modify how the ISO channels are allocated for the audio streams,
as well as how the CIG is allocated for the unicast group.

This fixes an issue where the unicast group could not be
fully allocated before _after_ the bt_audio_streams had been
configured by bt_audio_stream_config, thus making it impossible
to create a unicast group before the connections have been established.

This leaves us with 3 basic data types:
1) Streams allocated by the application
2) Endpoints that represent ASEs
3) Audio_iso which is used to couple streams and ISO channels.

The Unicast Group for the unicast client will now have the same
lifetime as the ISO CIG for the central.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-05-24 13:59:45 +02:00 committed by Carles Cufí
commit 9b15426455
12 changed files with 601 additions and 521 deletions

View file

@ -75,7 +75,7 @@ config BT_AUDIO_UNICAST_CLIENT_GROUP_COUNT
int "Basic Audio Unicast Group count"
depends on BT_AUDIO_UNICAST
default BT_ISO_MAX_CIG
range 0 BT_ISO_MAX_CIG
range 1 BT_ISO_MAX_CIG
help
This option sets the number of connected audio groups to support as
the unicast client.
@ -84,8 +84,8 @@ config BT_AUDIO_UNICAST_CLIENT_GROUP_STREAM_COUNT
int "Basic Audio Unicast Group Stream count"
depends on BT_AUDIO_UNICAST_CLIENT_GROUP_COUNT > 0
default 1
range 0 BT_ISO_MAX_CHAN if BT_ISO_MAX_CHAN < 31
range 0 31
range 1 BT_ISO_MAX_CHAN if BT_ISO_MAX_CHAN < 31
range 1 31
help
This option sets the maximum number of streams per unicast group
to support.