Re: [PATCH BlueZ 1/4] shared/bap: add bt_bap_stream_config_update for updating QoS choice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Pauli,

On Sun, Nov 12, 2023 at 11:00 AM Pauli Virtanen <pav@xxxxxx> wrote:
>
> Add bt_bap_stream_config_update for updating the QoS while in Codec
> Configured state.
> ---
>  src/shared/bap.c | 18 ++++++++++++++++++
>  src/shared/bap.h |  3 +++
>  2 files changed, 21 insertions(+)
>
> diff --git a/src/shared/bap.c b/src/shared/bap.c
> index 13bbcf793..d90e39f7c 100644
> --- a/src/shared/bap.c
> +++ b/src/shared/bap.c
> @@ -4600,6 +4600,24 @@ unsigned int bt_bap_stream_config(struct bt_bap_stream *stream,
>         return 0;
>  }
>
> +int bt_bap_stream_config_update(struct bt_bap_stream *stream,
> +                                       struct bt_bap_qos *qos)
> +{
> +       if (!bap_stream_valid(stream))
> +               return -EINVAL;
> +
> +       if (stream->ep->state != BT_BAP_STREAM_STATE_CONFIG)
> +               return -EINVAL;
> +
> +       switch (bt_bap_stream_get_type(stream)) {
> +       case BT_BAP_STREAM_TYPE_UCAST:
> +               stream->qos = *qos;
> +               return 0;
> +       }
> +
> +       return -EINVAL;
> +}
> +
>  static bool match_pac(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
>                                                         void *user_data)
>  {
> diff --git a/src/shared/bap.h b/src/shared/bap.h
> index 23edbf4c6..099c2edd0 100644
> --- a/src/shared/bap.h
> +++ b/src/shared/bap.h
> @@ -255,6 +255,9 @@ unsigned int bt_bap_stream_config(struct bt_bap_stream *stream,
>                                         bt_bap_stream_func_t func,
>                                         void *user_data);
>
> +int bt_bap_stream_config_update(struct bt_bap_stream *stream,
> +                                       struct bt_bap_qos *pqos);
> +

Can't we just make bt_bap_stream_config do update the config in case
it is for a broadcast? At least to me it seems a much cleaner approach
then starting introducing new functions where the user needs to know
when they should be called, etc.

>  unsigned int bt_bap_stream_qos(struct bt_bap_stream *stream,
>                                         struct bt_bap_qos *qos,
>                                         bt_bap_stream_func_t func,
> --
> 2.41.0
>
>


-- 
Luiz Augusto von Dentz





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux