From e8f983e8065641c130e6a3d1d55d857ef5c6d641 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Fri, 2 Aug 2024 11:23:33 +0200 Subject: [PATCH] Bluetooth: Audio: Rename bt_audio_codec_qos -> bt_bap_qos_cfg The QoS structure is not related to a codec, but rather a stream, and should thus not use the "Codec" name. The BAP and ASCS specs refer to the QoS as "QoS configuration" several places, so it is an obvious choice for a name. Since the structure is defined and used by BAP, the prefix was changed from bt_audio to bt_bap. Signed-off-by: Emil Gydesen --- doc/releases/migration-guide-4.0.rst | 5 + include/zephyr/bluetooth/audio/audio.h | 245 ---------------- include/zephyr/bluetooth/audio/bap.h | 262 +++++++++++++++++- .../zephyr/bluetooth/audio/bap_lc3_preset.h | 133 ++++----- include/zephyr/bluetooth/audio/cap.h | 2 +- .../zephyr/bluetooth/audio/gmap_lc3_preset.h | 34 +-- .../bluetooth/bap_unicast_client/src/main.c | 3 +- .../bluetooth/bap_unicast_server/src/main.c | 12 +- .../cap_acceptor/src/cap_acceptor_unicast.c | 14 +- .../cap_initiator/src/cap_initiator_unicast.c | 2 +- samples/bluetooth/hap_ha/src/bap_unicast_sr.c | 12 +- .../tmap_central/src/cap_initiator.c | 2 +- .../tmap_peripheral/src/bap_unicast_sr.c | 12 +- subsys/bluetooth/audio/ascs.c | 14 +- subsys/bluetooth/audio/ascs_internal.h | 2 +- subsys/bluetooth/audio/bap_broadcast_sink.c | 14 +- subsys/bluetooth/audio/bap_broadcast_source.c | 12 +- subsys/bluetooth/audio/bap_endpoint.h | 10 +- subsys/bluetooth/audio/bap_stream.c | 26 +- subsys/bluetooth/audio/bap_stream.h | 7 +- subsys/bluetooth/audio/bap_unicast_client.c | 39 ++- .../audio/bap_unicast_client_internal.h | 2 +- subsys/bluetooth/audio/bap_unicast_server.c | 2 +- subsys/bluetooth/audio/cap_stream.c | 2 +- subsys/bluetooth/audio/shell/audio.h | 6 +- subsys/bluetooth/audio/shell/bap.c | 18 +- .../audio/ascs/include/bap_unicast_server.h | 6 +- tests/bluetooth/audio/ascs/src/main.c | 6 +- .../audio/ascs/src/test_ase_control_params.c | 6 +- .../ascs/src/test_ase_state_transition.c | 4 +- tests/bluetooth/audio/ascs/src/test_common.c | 6 +- .../audio/ascs/uut/bap_unicast_server.c | 6 +- .../audio/bap_broadcast_source/src/main.c | 16 +- .../audio/mocks/include/bap_stream.h | 2 +- tests/bluetooth/audio/mocks/src/bap_stream.c | 2 +- .../tester/src/audio/btp_bap_broadcast.c | 2 +- .../tester/src/audio/btp_bap_broadcast.h | 4 +- .../tester/src/audio/btp_bap_unicast.c | 21 +- .../tester/src/audio/btp_bap_unicast.h | 2 +- tests/bluetooth/tester/src/audio/btp_cap.c | 10 +- tests/bsim/bluetooth/audio/src/bap_common.c | 2 +- tests/bsim/bluetooth/audio/src/bap_common.h | 4 +- .../audio/src/bap_unicast_client_test.c | 3 +- .../audio/src/bap_unicast_server_test.c | 10 +- .../bluetooth/audio/src/cap_acceptor_test.c | 10 +- .../audio/src/cap_initiator_broadcast_test.c | 2 +- .../audio/src/cap_initiator_unicast_test.c | 6 +- .../bsim/bluetooth/audio/src/gmap_ugg_test.c | 4 +- .../bsim/bluetooth/audio/src/gmap_ugt_test.c | 10 +- 49 files changed, 515 insertions(+), 521 deletions(-) diff --git a/doc/releases/migration-guide-4.0.rst b/doc/releases/migration-guide-4.0.rst index 4e5ae29a09d089b..5103f7e141afcfd 100644 --- a/doc/releases/migration-guide-4.0.rst +++ b/doc/releases/migration-guide-4.0.rst @@ -95,6 +95,11 @@ Bluetooth Mesh Bluetooth Audio =============== +* There has been a rename from ``bt_audio_codec_qos`` to ``bt_bap_qos_cfg``. This effects all + structs, enums and defines that used the ``bt_audio_codec_qos`` name. To use the new naming simply + do a search-and-replace for ``bt_audio_codec_qos`` to ``bt_bap_qos_cfg`` and + ``BT_AUDIO_CODEC_QOS`` to ``BT_BAP_QOS_CFG``. (:github:`76633`) + Bluetooth Classic ================= diff --git a/include/zephyr/bluetooth/audio/audio.h b/include/zephyr/bluetooth/audio/audio.h index 3a826179a5fae16..9690fd25cc0b286 100644 --- a/include/zephyr/bluetooth/audio/audio.h +++ b/include/zephyr/bluetooth/audio/audio.h @@ -777,251 +777,6 @@ enum bt_audio_dir { BT_AUDIO_DIR_SOURCE = 0x02, }; -/** - * @brief Helper to declare elements of bt_audio_codec_qos - * - * @param _interval SDU interval (usec) - * @param _framing Framing - * @param _phy Target PHY - * @param _sdu Maximum SDU Size - * @param _rtn Retransmission number - * @param _latency Maximum Transport Latency (msec) - * @param _pd Presentation Delay (usec) - */ -#define BT_AUDIO_CODEC_QOS(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd) \ - ((struct bt_audio_codec_qos){ \ - .interval = _interval, \ - .framing = _framing, \ - .phy = _phy, \ - .sdu = _sdu, \ - .rtn = _rtn, \ - IF_ENABLED(UTIL_OR(IS_ENABLED(CONFIG_BT_BAP_BROADCAST_SOURCE), \ - IS_ENABLED(CONFIG_BT_BAP_UNICAST)), \ - (.latency = _latency,)) \ - .pd = _pd, \ - }) - -/** @brief Codec QoS Framing */ -enum bt_audio_codec_qos_framing { - /** Packets may be framed or unframed */ - BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED = 0x00, - /** Packets are always framed */ - BT_AUDIO_CODEC_QOS_FRAMING_FRAMED = 0x01, -}; - -/** @brief Codec QoS Preferred PHY */ -enum { - /** LE 1M PHY */ - BT_AUDIO_CODEC_QOS_1M = BIT(0), - /** LE 2M PHY */ - BT_AUDIO_CODEC_QOS_2M = BIT(1), - /** LE Coded PHY */ - BT_AUDIO_CODEC_QOS_CODED = BIT(2), -}; - -/** - * @brief Helper to declare Input Unframed bt_audio_codec_qos - * - * @param _interval SDU interval (usec) - * @param _sdu Maximum SDU Size - * @param _rtn Retransmission number - * @param _latency Maximum Transport Latency (msec) - * @param _pd Presentation Delay (usec) - */ -#define BT_AUDIO_CODEC_QOS_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd) \ - BT_AUDIO_CODEC_QOS(_interval, BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED, BT_AUDIO_CODEC_QOS_2M, \ - _sdu, _rtn, _latency, _pd) - -/** - * @brief Helper to declare Input Framed bt_audio_codec_qos - * - * @param _interval SDU interval (usec) - * @param _sdu Maximum SDU Size - * @param _rtn Retransmission number - * @param _latency Maximum Transport Latency (msec) - * @param _pd Presentation Delay (usec) - */ -#define BT_AUDIO_CODEC_QOS_FRAMED(_interval, _sdu, _rtn, _latency, _pd) \ - BT_AUDIO_CODEC_QOS(_interval, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED, BT_AUDIO_CODEC_QOS_2M, \ - _sdu, _rtn, _latency, _pd) - -/** @brief Codec QoS structure. */ -struct bt_audio_codec_qos { - /** - * @brief Presentation Delay in microseconds - * - * This value can be changed up and until bt_bap_stream_qos() has been called. - * Once a stream has been QoS configured, modifying this field does not modify the value. - * It is however possible to modify this field and call bt_bap_stream_qos() again to update - * the value, assuming that the stream is in the correct state. - * - * Value range 0 to @ref BT_AUDIO_PD_MAX. - */ - uint32_t pd; - - /** - * @brief Connected Isochronous Group (CIG) parameters - * - * The fields in this struct affect the value sent to the controller via HCI - * when creating the CIG. Once the group has been created with - * bt_bap_unicast_group_create(), modifying these fields will not affect the group. - */ - struct { - /** QoS Framing */ - enum bt_audio_codec_qos_framing framing; - - /** - * @brief PHY - * - * Allowed values are @ref BT_AUDIO_CODEC_QOS_1M, @ref BT_AUDIO_CODEC_QOS_2M and - * @ref BT_AUDIO_CODEC_QOS_CODED. - */ - uint8_t phy; - - /** - * @brief Retransmission Number - * - * This a recommendation to the controller, and the actual retransmission number - * may be different than this. - */ - uint8_t rtn; - - /** - * @brief Maximum SDU size - * - * Value range @ref BT_ISO_MIN_SDU to @ref BT_ISO_MAX_SDU. - */ - uint16_t sdu; - -#if defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || defined(CONFIG_BT_BAP_UNICAST) || \ - defined(__DOXYGEN__) - /** - * @brief Maximum Transport Latency - * - * Not used for the @kconfig{CONFIG_BT_BAP_BROADCAST_SINK} role. - */ - uint16_t latency; -#endif /* CONFIG_BT_BAP_BROADCAST_SOURCE || CONFIG_BT_BAP_UNICAST */ - - /** - * @brief SDU Interval - * - * Value range @ref BT_ISO_SDU_INTERVAL_MIN to @ref BT_ISO_SDU_INTERVAL_MAX - */ - uint32_t interval; - -#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__) - /** - * @brief Maximum PDU size - * - * Maximum size, in octets, of the payload from link layer to link layer. - * - * Value range @ref BT_ISO_CONNECTED_PDU_MIN to @ref BT_ISO_PDU_MAX for - * connected ISO. - * - * Value range @ref BT_ISO_BROADCAST_PDU_MIN to @ref BT_ISO_PDU_MAX for - * broadcast ISO. - */ - uint16_t max_pdu; - - /** - * @brief Burst number - * - * Value range @ref BT_ISO_BN_MIN to @ref BT_ISO_BN_MAX. - */ - uint8_t burst_number; - - /** - * @brief Number of subevents - * - * Maximum number of subevents in each CIS or BIS event. - * - * Value range @ref BT_ISO_NSE_MIN to @ref BT_ISO_NSE_MAX. - */ - uint8_t num_subevents; -#endif /* CONFIG_BT_ISO_TEST_PARAMS */ - }; -}; - -/** - * @brief Helper to declare elements of @ref bt_audio_codec_qos_pref - * - * @param _unframed_supported Unframed PDUs supported - * @param _phy Preferred Target PHY - * @param _rtn Preferred Retransmission number - * @param _latency Preferred Maximum Transport Latency (msec) - * @param _pd_min Minimum Presentation Delay (usec) - * @param _pd_max Maximum Presentation Delay (usec) - * @param _pref_pd_min Preferred Minimum Presentation Delay (usec) - * @param _pref_pd_max Preferred Maximum Presentation Delay (usec) - */ -#define BT_AUDIO_CODEC_QOS_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, _pd_max, \ - _pref_pd_min, _pref_pd_max) \ - { \ - .unframed_supported = _unframed_supported, \ - .phy = _phy, \ - .rtn = _rtn, \ - .latency = _latency, \ - .pd_min = _pd_min, \ - .pd_max = _pd_max, \ - .pref_pd_min = _pref_pd_min, \ - .pref_pd_max = _pref_pd_max, \ - } - -/** @brief Audio Stream Quality of Service Preference structure. */ -struct bt_audio_codec_qos_pref { - /** - * @brief Unframed PDUs supported - * - * Unlike the other fields, this is not a preference but whether - * the codec supports unframed ISOAL PDUs. - */ - bool unframed_supported; - - /** Preferred PHY */ - uint8_t phy; - - /** Preferred Retransmission Number */ - uint8_t rtn; - - /** Preferred Transport Latency */ - uint16_t latency; - - /** - * @brief Minimum Presentation Delay in microseconds - * - * Unlike the other fields, this is not a preference but a minimum requirement. - * - * Value range 0 to @ref BT_AUDIO_PD_MAX, or @ref BT_AUDIO_PD_PREF_NONE - * to indicate no preference. - */ - uint32_t pd_min; - - /** - * @brief Maximum Presentation Delay - * - * Unlike the other fields, this is not a preference but a maximum requirement. - * - * Value range 0 to @ref BT_AUDIO_PD_MAX, or @ref BT_AUDIO_PD_PREF_NONE - * to indicate no preference. - */ - uint32_t pd_max; - - /** - * @brief Preferred minimum Presentation Delay - * - * Value range 0 to @ref BT_AUDIO_PD_MAX. - */ - uint32_t pref_pd_min; - - /** - * @brief Preferred maximum Presentation Delay - * - * Value range 0 to @ref BT_AUDIO_PD_MAX. - */ - uint32_t pref_pd_max; -}; - /** * @brief Audio codec Config APIs * @defgroup bt_audio_codec_cfg Codec config parsing APIs diff --git a/include/zephyr/bluetooth/audio/bap.h b/include/zephyr/bluetooth/audio/bap.h index 9e8317be0a6add0..ed4a064cee3b750 100644 --- a/include/zephyr/bluetooth/audio/bap.h +++ b/include/zephyr/bluetooth/audio/bap.h @@ -35,11 +35,252 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { #endif +/** + * @brief Helper to declare elements of bt_bap_qos_cfg + * + * @param _interval SDU interval (usec) + * @param _framing Framing + * @param _phy Target PHY + * @param _sdu Maximum SDU Size + * @param _rtn Retransmission number + * @param _latency Maximum Transport Latency (msec) + * @param _pd Presentation Delay (usec) + */ +#define BT_BAP_QOS_CFG(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd) \ + ((struct bt_bap_qos_cfg){ \ + .interval = _interval, \ + .framing = _framing, \ + .phy = _phy, \ + .sdu = _sdu, \ + .rtn = _rtn, \ + IF_ENABLED(UTIL_OR(IS_ENABLED(CONFIG_BT_BAP_BROADCAST_SOURCE), \ + IS_ENABLED(CONFIG_BT_BAP_UNICAST)), \ + (.latency = _latency,)) \ + .pd = _pd, \ + }) + +/** @brief QoS Framing */ +enum bt_bap_qos_cfg_framing { + /** Packets may be framed or unframed */ + BT_BAP_QOS_CFG_FRAMING_UNFRAMED = 0x00, + /** Packets are always framed */ + BT_BAP_QOS_CFG_FRAMING_FRAMED = 0x01, +}; + +/** @brief QoS Preferred PHY */ +enum { + /** LE 1M PHY */ + BT_BAP_QOS_CFG_1M = BIT(0), + /** LE 2M PHY */ + BT_BAP_QOS_CFG_2M = BIT(1), + /** LE Coded PHY */ + BT_BAP_QOS_CFG_CODED = BIT(2), +}; + +/** + * @brief Helper to declare Input Unframed bt_bap_qos_cfg + * + * @param _interval SDU interval (usec) + * @param _sdu Maximum SDU Size + * @param _rtn Retransmission number + * @param _latency Maximum Transport Latency (msec) + * @param _pd Presentation Delay (usec) + */ +#define BT_BAP_QOS_CFG_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd) \ + BT_BAP_QOS_CFG(_interval, BT_BAP_QOS_CFG_FRAMING_UNFRAMED, BT_BAP_QOS_CFG_2M, _sdu, _rtn, \ + _latency, _pd) + +/** + * @brief Helper to declare Input Framed bt_bap_qos_cfg + * + * @param _interval SDU interval (usec) + * @param _sdu Maximum SDU Size + * @param _rtn Retransmission number + * @param _latency Maximum Transport Latency (msec) + * @param _pd Presentation Delay (usec) + */ +#define BT_BAP_QOS_CFG_FRAMED(_interval, _sdu, _rtn, _latency, _pd) \ + BT_BAP_QOS_CFG(_interval, BT_BAP_QOS_CFG_FRAMING_FRAMED, BT_BAP_QOS_CFG_2M, _sdu, _rtn, \ + _latency, _pd) + +/** @brief QoS configuration structure. */ +struct bt_bap_qos_cfg { + /** + * @brief Presentation Delay in microseconds + * + * This value can be changed up and until bt_bap_stream_qos() has been called. + * Once a stream has been QoS configured, modifying this field does not modify the value. + * It is however possible to modify this field and call bt_bap_stream_qos() again to update + * the value, assuming that the stream is in the correct state. + * + * Value range 0 to @ref BT_AUDIO_PD_MAX. + */ + uint32_t pd; + + /** + * @brief Connected Isochronous Group (CIG) parameters + * + * The fields in this struct affect the value sent to the controller via HCI + * when creating the CIG. Once the group has been created with + * bt_bap_unicast_group_create(), modifying these fields will not affect the group. + */ + struct { + /** QoS Framing */ + enum bt_bap_qos_cfg_framing framing; + + /** + * @brief PHY + * + * Allowed values are @ref BT_BAP_QOS_CFG_1M, @ref BT_BAP_QOS_CFG_2M and + * @ref BT_BAP_QOS_CFG_CODED. + */ + uint8_t phy; + + /** + * @brief Retransmission Number + * + * This a recommendation to the controller, and the actual retransmission number + * may be different than this. + */ + uint8_t rtn; + + /** + * @brief Maximum SDU size + * + * Value range @ref BT_ISO_MIN_SDU to @ref BT_ISO_MAX_SDU. + */ + uint16_t sdu; + +#if defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || defined(CONFIG_BT_BAP_UNICAST) || \ + defined(__DOXYGEN__) + /** + * @brief Maximum Transport Latency + * + * Not used for the @kconfig{CONFIG_BT_BAP_BROADCAST_SINK} role. + */ + uint16_t latency; +#endif /* CONFIG_BT_BAP_BROADCAST_SOURCE || CONFIG_BT_BAP_UNICAST */ + + /** + * @brief SDU Interval + * + * Value range @ref BT_ISO_SDU_INTERVAL_MIN to @ref BT_ISO_SDU_INTERVAL_MAX + */ + uint32_t interval; + +#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__) + /** + * @brief Maximum PDU size + * + * Maximum size, in octets, of the payload from link layer to link layer. + * + * Value range @ref BT_ISO_CONNECTED_PDU_MIN to @ref BT_ISO_PDU_MAX for + * connected ISO. + * + * Value range @ref BT_ISO_BROADCAST_PDU_MIN to @ref BT_ISO_PDU_MAX for + * broadcast ISO. + */ + uint16_t max_pdu; + + /** + * @brief Burst number + * + * Value range @ref BT_ISO_BN_MIN to @ref BT_ISO_BN_MAX. + */ + uint8_t burst_number; + + /** + * @brief Number of subevents + * + * Maximum number of subevents in each CIS or BIS event. + * + * Value range @ref BT_ISO_NSE_MIN to @ref BT_ISO_NSE_MAX. + */ + uint8_t num_subevents; +#endif /* CONFIG_BT_ISO_TEST_PARAMS */ + }; +}; + +/** + * @brief Helper to declare elements of @ref bt_bap_qos_cfg_pref + * + * @param _unframed_supported Unframed PDUs supported + * @param _phy Preferred Target PHY + * @param _rtn Preferred Retransmission number + * @param _latency Preferred Maximum Transport Latency (msec) + * @param _pd_min Minimum Presentation Delay (usec) + * @param _pd_max Maximum Presentation Delay (usec) + * @param _pref_pd_min Preferred Minimum Presentation Delay (usec) + * @param _pref_pd_max Preferred Maximum Presentation Delay (usec) + */ +#define BT_BAP_QOS_CFG_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, _pd_max, \ + _pref_pd_min, _pref_pd_max) \ + { \ + .unframed_supported = _unframed_supported, .phy = _phy, .rtn = _rtn, \ + .latency = _latency, .pd_min = _pd_min, .pd_max = _pd_max, \ + .pref_pd_min = _pref_pd_min, .pref_pd_max = _pref_pd_max, \ + } + +/** @brief Audio Stream Quality of Service Preference structure. */ +struct bt_bap_qos_cfg_pref { + /** + * @brief Unframed PDUs supported + * + * Unlike the other fields, this is not a preference but whether + * the codec supports unframed ISOAL PDUs. + */ + bool unframed_supported; + + /** Preferred PHY */ + uint8_t phy; + + /** Preferred Retransmission Number */ + uint8_t rtn; + + /** Preferred Transport Latency */ + uint16_t latency; + + /** + * @brief Minimum Presentation Delay in microseconds + * + * Unlike the other fields, this is not a preference but a minimum requirement. + * + * Value range 0 to @ref BT_AUDIO_PD_MAX, or @ref BT_AUDIO_PD_PREF_NONE + * to indicate no preference. + */ + uint32_t pd_min; + + /** + * @brief Maximum Presentation Delay + * + * Unlike the other fields, this is not a preference but a maximum requirement. + * + * Value range 0 to @ref BT_AUDIO_PD_MAX, or @ref BT_AUDIO_PD_PREF_NONE + * to indicate no preference. + */ + uint32_t pd_max; + + /** + * @brief Preferred minimum Presentation Delay + * + * Value range 0 to @ref BT_AUDIO_PD_MAX. + */ + uint32_t pref_pd_min; + + /** + * @brief Preferred maximum Presentation Delay + * + * Value range 0 to @ref BT_AUDIO_PD_MAX. + */ + uint32_t pref_pd_max; +}; + /** Periodic advertising state reported by the Scan Delegator */ enum bt_bap_pa_state { /** The periodic advertising has not been synchronized */ @@ -429,7 +670,7 @@ struct bt_bap_ep_info { struct bt_bap_ep *paired_ep; /** Pointer to the preferred QoS settings associated with the endpoint */ - const struct bt_audio_codec_qos_pref *qos_pref; + const struct bt_bap_qos_cfg_pref *qos_pref; }; /** @@ -462,7 +703,7 @@ struct bt_bap_stream { struct bt_audio_codec_cfg *codec_cfg; /** QoS Configuration */ - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; /** Audio stream operations */ struct bt_bap_stream_ops *ops; @@ -502,8 +743,7 @@ struct bt_bap_stream_ops { * @param stream Stream object that has been configured. * @param pref Remote QoS preferences. */ - void (*configured)(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref); + void (*configured)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref); /** * @brief Stream QoS set callback @@ -895,7 +1135,7 @@ struct bt_bap_unicast_server_cb { */ int (*config)(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp); + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp); /** * @brief Stream reconfig request callback @@ -915,7 +1155,7 @@ struct bt_bap_unicast_server_cb { */ int (*reconfig)(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp); + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp); /** * @brief Stream QoS request callback @@ -930,7 +1170,7 @@ struct bt_bap_unicast_server_cb { * * @return 0 in case of success or negative value in case of error. */ - int (*qos)(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, + int (*qos)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp); /** @@ -1073,7 +1313,7 @@ void bt_bap_unicast_server_foreach_ep(struct bt_conn *conn, bt_bap_ep_func_t fun */ int bt_bap_unicast_server_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg, - const struct bt_audio_codec_qos_pref *qos_pref); + const struct bt_bap_qos_cfg_pref *qos_pref); /** @} */ /* End of group bt_bap_unicast_server */ @@ -1089,7 +1329,7 @@ struct bt_bap_unicast_group_stream_param { struct bt_bap_stream *stream; /** The QoS settings for the stream object. */ - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; }; /** @@ -1159,7 +1399,7 @@ struct bt_bap_unicast_group_param { * @brief Create audio unicast group. * * Create a new audio unicast group with one or more audio streams as a unicast client. Streams in - * a unicast group shall share the same interval, framing and latency (see @ref bt_audio_codec_qos). + * a unicast group shall share the same interval, framing and latency (see @ref bt_bap_qos_cfg). * * @param[in] param The unicast group create parameters. * @param[out] unicast_group Pointer to the unicast group created. @@ -1663,7 +1903,7 @@ struct bt_bap_broadcast_source_param { struct bt_bap_broadcast_source_subgroup_param *params; /** Quality of Service configuration. */ - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; /** * @brief Broadcast Source packing mode. diff --git a/include/zephyr/bluetooth/audio/bap_lc3_preset.h b/include/zephyr/bluetooth/audio/bap_lc3_preset.h index ac9b95330845adf..2a4005ddf5ceddf 100644 --- a/include/zephyr/bluetooth/audio/bap_lc3_preset.h +++ b/include/zephyr/bluetooth/audio/bap_lc3_preset.h @@ -21,12 +21,13 @@ * @ingroup bluetooth * @{ * - * These APIs provide preset for codec configuration and codec QoS based on values supplied by the + * These APIs provide preset for codec configuration and QoS based on values supplied by the * codec configuration tables in the BAP specification. * */ #include +#include #include #ifdef __cplusplus @@ -38,7 +39,7 @@ struct bt_bap_lc3_preset { /** The LC3 Codec */ struct bt_audio_codec_cfg codec_cfg; /** The BAP spec defined QoS values */ - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; }; /** Helper to declare an LC3 preset structure */ @@ -59,7 +60,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 26u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 26u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 26u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Unicast 8_2_1 codec configuration @@ -71,7 +72,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 30u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 30u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Unicast 16_1_1 codec configuration @@ -83,7 +84,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 30u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 30u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Unicast 16_2_1 codec configuration @@ -97,7 +98,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 40U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 40u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 40u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Unicast 24_1_1 codec configuration @@ -109,7 +110,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 45U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 45u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 45u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Unicast 24_2_1 codec configuration @@ -123,7 +124,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 60u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 60u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Unicast 32_1_1 codec configuration @@ -135,7 +136,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 60u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 60u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Unicast 32_2_1 codec configuration @@ -147,7 +148,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 80U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 80u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 80u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Unicast 441_1_1 codec configuration @@ -159,7 +160,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 97U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(8163u, 97u, 5u, 24u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(8163u, 97u, 5u, 24u, 40000u)) /** * @brief Helper to declare LC3 Unicast 441_2_1 codec configuration @@ -171,7 +172,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 130U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(10884u, 130u, 5u, 31u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(10884u, 130u, 5u, 31u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_1_1 codec configuration @@ -183,7 +184,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 75U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 75u, 5u, 15u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 75u, 5u, 15u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_2_1 codec configuration @@ -195,7 +196,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 100U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 100u, 5u, 20u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 100u, 5u, 20u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_3_1 codec configuration @@ -207,7 +208,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 90U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 90u, 5u, 15u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 90u, 5u, 15u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_4_1 codec configuration @@ -219,7 +220,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 120u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 120u, 5u, 20u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 120u, 5u, 20u, 40000u)) /** * @brief Helper to declare LC3 Unicast 8_5_1 codec configuration @@ -231,7 +232,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 117u, \ 1, _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 117u, 5u, 15u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 117u, 5u, 15u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_6_1 codec configuration @@ -243,7 +244,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 155u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 155u, 5u, 20u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 155u, 5u, 20u, 40000u)) /** * @brief Helper to declare LC3 Unicast 8_1_2 codec configuration @@ -256,7 +257,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 26u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 26u, 13u, 75u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 26u, 13u, 75u, 40000u)) /** * @brief Helper to declare LC3 Unicast 8_2_2 codec configuration @@ -268,7 +269,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 30u, 13u, 95u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 30u, 13u, 95u, 40000u)) /** * @brief Helper to declare LC3 Unicast 16_1_2 codec configuration @@ -280,7 +281,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 30u, 13u, 75u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 30u, 13u, 75u, 40000u)) /** * @brief Helper to declare LC3 Unicast 16_2_2 codec configuration @@ -292,7 +293,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 40U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 40u, 13u, 95u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 40u, 13u, 95u, 40000u)) /** * @brief Helper to declare LC3 Unicast 24_1_2 codec configuration @@ -304,7 +305,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 45U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 45u, 13u, 75u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 45u, 13u, 75u, 40000u)) /** * @brief Helper to declare LC3 Unicast 24_2_2 codec configuration @@ -316,7 +317,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 60u, 13u, 95u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 60u, 13u, 95u, 40000u)) /** * @brief Helper to declare LC3 Unicast 32_1_2 codec configuration @@ -328,7 +329,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 60u, 13u, 75u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 60u, 13u, 75u, 40000u)) /** * @brief Helper to declare LC3 Unicast 32_2_2 codec configuration @@ -340,7 +341,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 80U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 80u, 13u, 95u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 80u, 13u, 95u, 40000u)) /** * @brief Helper to declare LC3 Unicast 441_1_2 codec configuration @@ -352,7 +353,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 97U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(8163u, 97u, 13u, 80u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(8163u, 97u, 13u, 80u, 40000u)) /** * @brief Helper to declare LC3 Unicast 441_2_2 codec configuration @@ -364,7 +365,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 130U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(10884u, 130u, 13u, 85u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(10884u, 130u, 13u, 85u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_1_2 codec configuration @@ -376,7 +377,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 75U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 75u, 13u, 75u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 75u, 13u, 75u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_2_2 codec configuration @@ -388,7 +389,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 100U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 100u, 13u, 95u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 100u, 13u, 95u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_3_2 codec configuration @@ -400,7 +401,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 90U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 90u, 13u, 75u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 90u, 13u, 75u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_4_2 codec configuration @@ -412,7 +413,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 120u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 120u, 13u, 100u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 120u, 13u, 100u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_5_2 codec configuration @@ -424,7 +425,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 117u, \ 1, _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 117u, 13u, 75u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 117u, 13u, 75u, 40000u)) /** * @brief Helper to declare LC3 Unicast 48_6_2 codec configuration @@ -436,7 +437,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 155u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 155u, 13u, 100u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 155u, 13u, 100u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 8_1_1 codec configuration @@ -449,7 +450,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 26u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 26u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 26u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 8_2_1 codec configuration @@ -461,7 +462,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 30u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 30u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 16_1_1 codec configuration @@ -473,7 +474,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 30u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 30u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 16_2_1 codec configuration @@ -487,7 +488,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 40U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 40u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 40u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 24_1_1 codec configuration @@ -499,7 +500,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 45U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 45u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 45u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 24_2_1 codec configuration @@ -513,7 +514,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 60u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 60u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 32_1_1 codec configuration @@ -525,7 +526,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 60u, 2u, 8u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 60u, 2u, 8u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 32_2_1 codec configuration @@ -537,7 +538,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 80U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 80u, 2u, 10u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 80u, 2u, 10u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 441_1_1 codec configuration @@ -549,7 +550,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 97U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(8163u, 97u, 4u, 24u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(8163u, 97u, 4u, 24u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 441_2_1 codec configuration @@ -561,7 +562,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 130U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(10884u, 130u, 4u, 31u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(10884u, 130u, 4u, 31u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_1_1 codec configuration @@ -573,7 +574,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 75U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 75u, 4u, 15u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 75u, 4u, 15u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_2_1 codec configuration @@ -585,7 +586,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 100U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 100u, 4u, 20u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 100u, 4u, 20u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_3_1 codec configuration @@ -597,7 +598,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 90U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 90u, 4u, 15u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 90u, 4u, 15u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_4_1 codec configuration @@ -609,7 +610,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 120u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 120u, 4u, 20u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 120u, 4u, 20u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_5_1 codec configuration @@ -621,7 +622,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 117u, \ 1, _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 117u, 4u, 15u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 117u, 4u, 15u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_6_1 codec configuration @@ -633,7 +634,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 155u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 155u, 4u, 20u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 155u, 4u, 20u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 8_1_2 codec configuration @@ -646,7 +647,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 26u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 26u, 4u, 45u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 26u, 4u, 45u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 8_2_2 codec configuration @@ -658,7 +659,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_8KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 30u, 4u, 60u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 30u, 4u, 60u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 16_1_2 codec configuration @@ -670,7 +671,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 30u, 4u, 45u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 30u, 4u, 45u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 16_2_2 codec configuration @@ -684,7 +685,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 40U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 40u, 4u, 60u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 40u, 4u, 60u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 24_1_2 codec configuration @@ -696,7 +697,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 45U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 45u, 4u, 45u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 45u, 4u, 45u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 24_2_2 codec configuration @@ -710,7 +711,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_24KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 60u, 4u, 60u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 60u, 4u, 60u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 32_1_2 codec configuration @@ -722,7 +723,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 60u, 4u, 45u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 60u, 4u, 45u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 32_2_2 codec configuration @@ -734,7 +735,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 80U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 80u, 4u, 60u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 80u, 4u, 60u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 441_1_2 codec configuration @@ -746,7 +747,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 97U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(8163u, 97u, 4u, 54u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(8163u, 97u, 4u, 54u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 441_2_2 codec configuration @@ -758,7 +759,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_44KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 130U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_FRAMED(10884u, 130u, 4u, 60u, 40000u)) + BT_BAP_QOS_CFG_FRAMED(10884u, 130u, 4u, 60u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_1_2 codec configuration @@ -770,7 +771,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 75U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 75u, 4u, 50u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 75u, 4u, 50u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_2_2 codec configuration @@ -782,7 +783,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 100U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 100u, 4u, 65u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 100u, 4u, 65u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_3_2 codec configuration @@ -794,7 +795,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 90U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 90u, 4u, 50u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 90u, 4u, 50u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_4_2 codec configuration @@ -806,7 +807,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 120u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 120u, 4u, 65u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 120u, 4u, 65u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_5_2 codec configuration @@ -818,7 +819,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 117u, \ 1, _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 117u, 4u, 50u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 117u, 4u, 50u, 40000u)) /** * @brief Helper to declare LC3 Broadcast 48_6_2 codec configuration @@ -830,7 +831,7 @@ struct bt_bap_lc3_preset { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 155u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 155u, 4u, 65u, 40000u)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 155u, 4u, 65u, 40000u)) #ifdef __cplusplus } diff --git a/include/zephyr/bluetooth/audio/cap.h b/include/zephyr/bluetooth/audio/cap.h index f04c5c828144996..77a88bcaea47e3e 100644 --- a/include/zephyr/bluetooth/audio/cap.h +++ b/include/zephyr/bluetooth/audio/cap.h @@ -447,7 +447,7 @@ struct bt_cap_initiator_broadcast_create_param { struct bt_cap_initiator_broadcast_subgroup_param *subgroup_params; /** Quality of Service configuration. */ - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; /** * @brief Broadcast Source packing mode. diff --git a/include/zephyr/bluetooth/audio/gmap_lc3_preset.h b/include/zephyr/bluetooth/audio/gmap_lc3_preset.h index 35bce011a8b633b..73217d9d18db7c9 100644 --- a/include/zephyr/bluetooth/audio/gmap_lc3_preset.h +++ b/include/zephyr/bluetooth/audio/gmap_lc3_preset.h @@ -21,7 +21,7 @@ * @ingroup bluetooth * @{ * - * These APIs provide presets for codec configuration and codec QoS based on values supplied by the + * These APIs provide presets for codec configuration and QoS based on values supplied by the * codec configurations from table 3.16 in the GMAP v1.0 specification */ @@ -43,7 +43,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 60U, 1U, 15U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 60U, 1U, 15U, 10000U)) /** * @brief Helper to declare LC3 32_2_gr codec configuration @@ -55,7 +55,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 80U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 80U, 1U, 20U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 80U, 1U, 20U, 10000U)) /** * @brief Helper to declare LC3 48_1_gr codec configuration @@ -67,7 +67,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 75U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 75U, 1U, 15U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 75U, 1U, 15U, 10000U)) /** * @brief Helper to declare LC3 48_2_gr codec configuration @@ -81,7 +81,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 100U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 100U, 1U, 20U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 100U, 1U, 20U, 10000U)) /** * @brief Helper to declare LC3 48_3_gr codec configuration @@ -93,7 +93,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 90U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 90U, 1U, 15U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 90U, 1U, 15U, 10000U)) /** * @brief Helper to declare LC3 48_4_gr codec configuration @@ -107,7 +107,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 120u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 120U, 1U, 20U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 120U, 1U, 20U, 10000U)) /** * @brief Helper to declare LC3 16_1_gs codec configuration @@ -119,7 +119,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 30U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 30U, 1U, 15U, 60000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 30U, 1U, 15U, 60000U)) /** * @brief Helper to declare LC3 16_2_gs codec configuration @@ -131,7 +131,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 40U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 40U, 1U, 20U, 60000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 40U, 1U, 20U, 60000U)) /** * @brief Helper to declare LC3 32_1_gs codec configuration @@ -143,7 +143,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 60U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 60U, 1U, 15U, 60000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 60U, 1U, 15U, 60000U)) /** * @brief Helper to declare LC3 32_2_gs codec configuration @@ -155,7 +155,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_32KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 80U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 80U, 1U, 20U, 60000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 80U, 1U, 20U, 60000U)) /** * @brief Helper to declare LC3 48_1_gs codec configuration @@ -167,7 +167,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 75U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 75U, 1U, 15U, 60000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 75U, 1U, 15U, 60000U)) /** * @brief Helper to declare LC3 48_2_gs codec configuration @@ -179,7 +179,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 100U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 100U, 1U, 20U, 60000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 100U, 1U, 20U, 60000U)) /* GMAP LC3 broadcast presets defined by table 3.22 in the GMAP v1.0 specification */ @@ -193,7 +193,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 75U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 75U, 1U, 8U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 75U, 1U, 8U, 10000U)) /** * @brief Helper to declare LC3 48_2_g codec configuration @@ -205,7 +205,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 100U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 100U, 1U, 10U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 100U, 1U, 10U, 10000U)) /** * @brief Helper to declare LC3 48_3_g codec configuration @@ -217,7 +217,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_7_5, _loc, 90U, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(7500u, 90U, 1U, 8U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(7500u, 90U, 1U, 8U, 10000U)) /** * @brief Helper to declare LC3 48_4_g codec configuration @@ -229,7 +229,7 @@ extern "C" { BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_48KHZ, \ BT_AUDIO_CODEC_CFG_DURATION_10, _loc, 120u, 1, \ _stream_context), \ - BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, 120U, 1U, 10U, 10000U)) + BT_BAP_QOS_CFG_UNFRAMED(10000u, 120U, 1U, 10U, 10000U)) #ifdef __cplusplus } diff --git a/samples/bluetooth/bap_unicast_client/src/main.c b/samples/bluetooth/bap_unicast_client/src/main.c index 1fccebe6738647b..7dc98780a8563a7 100644 --- a/samples/bluetooth/bap_unicast_client/src/main.c +++ b/samples/bluetooth/bap_unicast_client/src/main.c @@ -200,8 +200,7 @@ static void start_scan(void) printk("Scanning successfully started\n"); } -static void stream_configured(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) +static void stream_configured(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref) { printk("Audio Stream %p configured\n", stream); diff --git a/samples/bluetooth/bap_unicast_server/src/main.c b/samples/bluetooth/bap_unicast_server/src/main.c index 90bff48719f67f4..b7270943aabaebd 100644 --- a/samples/bluetooth/bap_unicast_server/src/main.c +++ b/samples/bluetooth/bap_unicast_server/src/main.c @@ -49,8 +49,8 @@ static struct audio_source { } source_streams[CONFIG_BT_ASCS_ASE_SRC_COUNT]; static size_t configured_source_stream_count; -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); static K_SEM_DEFINE(sem_disconnected, 0, 1); @@ -170,7 +170,7 @@ static void print_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg) bt_audio_data_parse(codec_cfg->meta, codec_cfg->meta_len, print_cb, "meta"); } -static void print_qos(const struct bt_audio_codec_qos *qos) +static void print_qos(const struct bt_bap_qos_cfg *qos) { printk("QoS: interval %u framing 0x%02x phy 0x%02x sdu %u " "rtn %u latency %u pd %u\n", @@ -285,7 +285,7 @@ static struct bt_bap_stream *stream_alloc(enum bt_audio_dir dir) static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir); @@ -317,7 +317,7 @@ static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Reconfig: stream %p\n", stream); @@ -334,7 +334,7 @@ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, return -ENOEXEC; } -static int lc3_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int lc3_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { printk("QoS: stream %p qos %p\n", stream, qos); diff --git a/samples/bluetooth/cap_acceptor/src/cap_acceptor_unicast.c b/samples/bluetooth/cap_acceptor/src/cap_acceptor_unicast.c index 9015eb409955a8d..8de37124e1686f6 100644 --- a/samples/bluetooth/cap_acceptor/src/cap_acceptor_unicast.c +++ b/samples/bluetooth/cap_acceptor/src/cap_acceptor_unicast.c @@ -41,7 +41,7 @@ LOG_MODULE_REGISTER(cap_acceptor_unicast, LOG_LEVEL_INF); #define LATENCY 20U #define RTN 2U -static const struct bt_audio_codec_qos_pref qos_pref = BT_AUDIO_CODEC_QOS_PREF( +static const struct bt_bap_qos_cfg_pref qos_pref = BT_BAP_QOS_CFG_PREF( UNFRAMED_SUPPORTED, PREF_PHY, RTN, LATENCY, MIN_PD, MAX_PD, MIN_PD, MAX_PD); uint64_t total_rx_iso_packet_count; /* This value is exposed to test code */ @@ -98,7 +98,7 @@ static void log_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg) bt_audio_data_parse(codec_cfg->meta, codec_cfg->meta_len, log_codec_cfg_cb, "meta"); } -static void log_qos(const struct bt_audio_codec_qos *qos) +static void log_qos(const struct bt_bap_qos_cfg *qos) { LOG_INF("QoS: interval %u framing 0x%02x phy 0x%02x sdu %u rtn %u latency %u pd %u", qos->interval, qos->framing, qos->phy, qos->sdu, qos->rtn, qos->latency, qos->pd); @@ -108,7 +108,7 @@ static int unicast_server_config_cb(struct bt_conn *conn, const struct bt_bap_ep enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **bap_stream, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { struct bt_cap_stream *cap_stream; @@ -136,7 +136,7 @@ static int unicast_server_config_cb(struct bt_conn *conn, const struct bt_bap_ep static int unicast_server_reconfig_cb(struct bt_bap_stream *bap_stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { LOG_INF("ASE Codec Reconfig: bap_stream %p", bap_stream); @@ -146,8 +146,8 @@ static int unicast_server_reconfig_cb(struct bt_bap_stream *bap_stream, enum bt_ return 0; } -static int unicast_server_qos_cb(struct bt_bap_stream *bap_stream, - const struct bt_audio_codec_qos *qos, struct bt_bap_ascs_rsp *rsp) +static int unicast_server_qos_cb(struct bt_bap_stream *bap_stream, const struct bt_bap_qos_cfg *qos, + struct bt_bap_ascs_rsp *rsp) { LOG_INF("QoS: bap_stream %p qos %p", bap_stream, qos); @@ -248,7 +248,7 @@ static const struct bt_bap_unicast_server_cb unicast_server_cb = { }; static void unicast_stream_configured_cb(struct bt_bap_stream *bap_stream, - const struct bt_audio_codec_qos_pref *pref) + const struct bt_bap_qos_cfg_pref *pref) { LOG_INF("Configured bap_stream %p", bap_stream); diff --git a/samples/bluetooth/cap_initiator/src/cap_initiator_unicast.c b/samples/bluetooth/cap_initiator/src/cap_initiator_unicast.c index 5cb9b035f0f5066..c7b861638acbe2c 100644 --- a/samples/bluetooth/cap_initiator/src/cap_initiator_unicast.c +++ b/samples/bluetooth/cap_initiator/src/cap_initiator_unicast.c @@ -91,7 +91,7 @@ static bool is_tx_stream(struct bt_bap_stream *stream) } static void unicast_stream_configured_cb(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) + const struct bt_bap_qos_cfg_pref *pref) { LOG_INF("Configured stream %p", stream); diff --git a/samples/bluetooth/hap_ha/src/bap_unicast_sr.c b/samples/bluetooth/hap_ha/src/bap_unicast_sr.c index 6244bb76bf11019..590902e67875806 100644 --- a/samples/bluetooth/hap_ha/src/bap_unicast_sr.c +++ b/samples/bluetooth/hap_ha/src/bap_unicast_sr.c @@ -36,8 +36,8 @@ static struct audio_source { } source_streams[CONFIG_BT_ASCS_ASE_SRC_COUNT]; static size_t configured_source_stream_count; -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 20000, 40000, 20000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 20000, 40000, 20000, 40000); static uint16_t get_and_incr_seq_num(const struct bt_bap_stream *stream) { @@ -110,7 +110,7 @@ static void print_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg) bt_audio_data_parse(codec_cfg->meta, codec_cfg->meta_len, print_cb, "meta"); } -static void print_qos(const struct bt_audio_codec_qos *qos) +static void print_qos(const struct bt_bap_qos_cfg *qos) { printk("QoS: interval %u framing 0x%02x phy 0x%02x sdu %u " "rtn %u latency %u pd %u\n", @@ -195,7 +195,7 @@ static struct bt_bap_stream *stream_alloc(void) static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir); @@ -221,7 +221,7 @@ static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Reconfig: stream %p\n", stream); @@ -233,7 +233,7 @@ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, return -ENOEXEC; } -static int lc3_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int lc3_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { printk("QoS: stream %p qos %p\n", stream, qos); diff --git a/samples/bluetooth/tmap_central/src/cap_initiator.c b/samples/bluetooth/tmap_central/src/cap_initiator.c index fd20fadaa710564..1b341b01d20ef52 100644 --- a/samples/bluetooth/tmap_central/src/cap_initiator.c +++ b/samples/bluetooth/tmap_central/src/cap_initiator.c @@ -33,7 +33,7 @@ static K_SEM_DEFINE(sem_discover_source, 0, 1); static K_SEM_DEFINE(sem_audio_start, 0, 1); static void unicast_stream_configured(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) + const struct bt_bap_qos_cfg_pref *pref) { printk("Configured stream %p\n", stream); diff --git a/samples/bluetooth/tmap_peripheral/src/bap_unicast_sr.c b/samples/bluetooth/tmap_peripheral/src/bap_unicast_sr.c index 8e325855e655a1d..8442e5246d9b253 100644 --- a/samples/bluetooth/tmap_peripheral/src/bap_unicast_sr.c +++ b/samples/bluetooth/tmap_peripheral/src/bap_unicast_sr.c @@ -37,8 +37,8 @@ static struct audio_source { } source_streams[CONFIG_BT_ASCS_ASE_SRC_COUNT]; static size_t configured_source_stream_count; -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 20000, 40000, 20000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 20000, 40000, 20000, 40000); static void print_hex(const uint8_t *ptr, size_t len) { @@ -98,7 +98,7 @@ static void print_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg) bt_audio_data_parse(codec_cfg->meta, codec_cfg->meta_len, print_cb, "meta"); } -static void print_qos(const struct bt_audio_codec_qos *qos) +static void print_qos(const struct bt_bap_qos_cfg *qos) { printk("QoS: interval %u framing 0x%02x phy 0x%02x sdu %u " "rtn %u latency %u pd %u\n", @@ -121,7 +121,7 @@ static struct bt_bap_stream *stream_alloc(void) static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir); @@ -149,7 +149,7 @@ static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Reconfig: stream %p\n", stream); print_codec_cfg(codec_cfg); @@ -158,7 +158,7 @@ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, return 0; } -static int lc3_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int lc3_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { printk("QoS: stream %p qos %p\n", stream, qos); diff --git a/subsys/bluetooth/audio/ascs.c b/subsys/bluetooth/audio/ascs.c index 17aeda10edb3119..62fbdf66a26c7d5 100644 --- a/subsys/bluetooth/audio/ascs.c +++ b/subsys/bluetooth/audio/ascs.c @@ -705,7 +705,7 @@ int ascs_ep_set_state(struct bt_bap_ep *ep, uint8_t state) static void ascs_ep_get_status_config(struct bt_bap_ep *ep, struct net_buf_simple *buf) { struct bt_ascs_ase_status_config *cfg; - struct bt_audio_codec_qos_pref *pref = &ep->qos_pref; + struct bt_bap_qos_cfg_pref *pref = &ep->qos_pref; cfg = net_buf_simple_add(buf, sizeof(*cfg)); cfg->framing = pref->unframed_supported ? BT_ASCS_QOS_FRAMING_UNFRAMED @@ -952,7 +952,7 @@ static void ascs_iso_sent(struct bt_iso_chan *chan) static void ascs_update_sdu_size(struct bt_bap_ep *ep) { struct bt_iso_chan_io_qos *io_qos; - struct bt_audio_codec_qos *codec_qos = &ep->qos; + struct bt_bap_qos_cfg *qos_cfg = &ep->qos; if (ep->dir == BT_AUDIO_DIR_SINK) { io_qos = ep->iso->chan.qos->rx; @@ -962,8 +962,8 @@ static void ascs_update_sdu_size(struct bt_bap_ep *ep) return; } - io_qos->sdu = codec_qos->sdu; - io_qos->rtn = codec_qos->rtn; + io_qos->sdu = qos_cfg->sdu; + io_qos->rtn = qos_cfg->rtn; } static void ascs_ep_iso_connected(struct bt_bap_ep *ep) @@ -1698,7 +1698,7 @@ static struct bt_bap_ep *ep_lookup_stream(struct bt_conn *conn, struct bt_bap_st int bt_ascs_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg, - const struct bt_audio_codec_qos_pref *qos_pref) + const struct bt_bap_qos_cfg_pref *qos_pref) { int err; struct bt_ascs_ase *ase = NULL; @@ -1906,7 +1906,7 @@ void bt_ascs_foreach_ep(struct bt_conn *conn, bt_bap_ep_func_t func, void *user_ } static void ase_qos(struct bt_ascs_ase *ase, uint8_t cig_id, uint8_t cis_id, - struct bt_audio_codec_qos *qos, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { struct bt_bap_ep *ep = &ase->ep; struct bt_bap_stream *stream; @@ -2066,7 +2066,7 @@ static ssize_t ascs_qos(struct bt_conn *conn, struct net_buf_simple *buf) for (uint8_t i = 0; i < req->num_ases; i++) { struct bt_bap_ascs_rsp rsp = BT_BAP_ASCS_RSP(BT_BAP_ASCS_RSP_CODE_UNSPECIFIED, BT_BAP_ASCS_REASON_NONE); - struct bt_audio_codec_qos cqos; + struct bt_bap_qos_cfg cqos; const struct bt_ascs_qos *qos; struct bt_ascs_ase *ase; diff --git a/subsys/bluetooth/audio/ascs_internal.h b/subsys/bluetooth/audio/ascs_internal.h index f96a1905ec52525..b6efd5b3572ceb5 100644 --- a/subsys/bluetooth/audio/ascs_internal.h +++ b/subsys/bluetooth/audio/ascs_internal.h @@ -351,7 +351,7 @@ int ascs_ep_set_state(struct bt_bap_ep *ep, uint8_t state); int bt_ascs_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg, - const struct bt_audio_codec_qos_pref *qos_pref); + const struct bt_bap_qos_cfg_pref *qos_pref); int bt_ascs_disable_ase(struct bt_bap_ep *ep); int bt_ascs_release_ase(struct bt_bap_ep *ep); diff --git a/subsys/bluetooth/audio/bap_broadcast_sink.c b/subsys/bluetooth/audio/bap_broadcast_sink.c index 746f24cdbed5c9f..6faa10accf3a326 100644 --- a/subsys/bluetooth/audio/bap_broadcast_sink.c +++ b/subsys/bluetooth/audio/bap_broadcast_sink.c @@ -732,7 +732,7 @@ static int store_base_info(struct bt_bap_broadcast_sink *sink, const struct bt_b /* Ensure that we have not synced while parsing the BASE */ if (sink->big == NULL) { - sink->codec_qos.pd = pres_delay; + sink->qos_cfg.pd = pres_delay; memcpy(sink->bis, data.bis, sizeof(sink->bis)); memcpy(sink->subgroups, data.subgroups, sizeof(sink->subgroups)); sink->subgroup_count = data.subgroup_count; @@ -943,10 +943,10 @@ static void biginfo_recv(struct bt_le_per_adv_sync *sync, } } - sink->codec_qos.framing = biginfo->framing; - sink->codec_qos.phy = biginfo->phy; - sink->codec_qos.sdu = biginfo->max_sdu; - sink->codec_qos.interval = biginfo->sdu_interval; + sink->qos_cfg.framing = biginfo->framing; + sink->qos_cfg.phy = biginfo->phy; + sink->qos_cfg.sdu = biginfo->max_sdu; + sink->qos_cfg.interval = biginfo->sdu_interval; SYS_SLIST_FOR_EACH_CONTAINER(&sink_cbs, listener, _node) { if (listener->syncable != NULL) { @@ -1044,13 +1044,13 @@ static int bt_bap_broadcast_sink_setup_stream(struct bt_bap_broadcast_sink *sink bt_bap_iso_init(iso, &broadcast_sink_iso_ops); bt_bap_iso_bind_ep(iso, ep); - bt_audio_codec_qos_to_iso_qos(iso->chan.qos->rx, &sink->codec_qos); + bt_bap_qos_cfg_to_iso_qos(iso->chan.qos->rx, &sink->qos_cfg); bt_bap_iso_configure_data_path(ep, codec_cfg); bt_bap_iso_unref(iso); bt_bap_stream_attach(NULL, stream, ep, codec_cfg); - stream->qos = &sink->codec_qos; + stream->qos = &sink->qos_cfg; return 0; } diff --git a/subsys/bluetooth/audio/bap_broadcast_source.c b/subsys/bluetooth/audio/bap_broadcast_source.c index 4f11e247ceb9007..c870296a7456be6 100644 --- a/subsys/bluetooth/audio/bap_broadcast_source.c +++ b/subsys/bluetooth/audio/bap_broadcast_source.c @@ -292,7 +292,7 @@ static struct bt_bap_broadcast_subgroup *broadcast_source_new_subgroup(uint8_t i static int broadcast_source_setup_stream(uint8_t index, struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos *qos, + struct bt_bap_qos_cfg *qos, struct bt_bap_broadcast_source *source) { struct bt_bap_iso *iso; @@ -313,7 +313,7 @@ static int broadcast_source_setup_stream(uint8_t index, struct bt_bap_stream *st bt_bap_iso_init(iso, &broadcast_source_iso_ops); bt_bap_iso_bind_ep(iso, ep); - bt_audio_codec_qos_to_iso_qos(iso->chan.qos->tx, qos); + bt_bap_qos_cfg_to_iso_qos(iso->chan.qos->tx, qos); bt_bap_iso_configure_data_path(ep, codec_cfg); #if defined(CONFIG_BT_ISO_TEST_PARAMS) iso->chan.qos->num_subevents = qos->num_subevents; @@ -508,7 +508,7 @@ static void broadcast_source_cleanup(struct bt_bap_broadcast_source *source) static bool valid_broadcast_source_param(const struct bt_bap_broadcast_source_param *param, const struct bt_bap_broadcast_source *source) { - const struct bt_audio_codec_qos *qos; + const struct bt_bap_qos_cfg *qos; CHECKIF(param == NULL) { LOG_DBG("param is NULL"); @@ -715,7 +715,7 @@ int bt_bap_broadcast_source_create(struct bt_bap_broadcast_source_param *param, struct bt_bap_broadcast_source **out_source) { struct bt_bap_broadcast_source *source; - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; size_t stream_count; uint8_t index; uint8_t bis_count; @@ -863,7 +863,7 @@ int bt_bap_broadcast_source_reconfig(struct bt_bap_broadcast_source *source, { struct bt_bap_broadcast_subgroup *subgroup; enum bt_bap_ep_state broadcast_state; - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; size_t subgroup_cnt; uint8_t bis_count; @@ -1019,7 +1019,7 @@ int bt_bap_broadcast_source_reconfig(struct bt_bap_broadcast_source *source, struct bt_iso_chan_io_qos *iso_qos; iso_qos = stream->ep->iso->chan.qos->tx; - bt_audio_codec_qos_to_iso_qos(iso_qos, qos); + bt_bap_qos_cfg_to_iso_qos(iso_qos, qos); stream->qos = qos; } } diff --git a/subsys/bluetooth/audio/bap_endpoint.h b/subsys/bluetooth/audio/bap_endpoint.h index 4f52351e5fec537..1906006a0b65c33 100644 --- a/subsys/bluetooth/audio/bap_endpoint.h +++ b/subsys/bluetooth/audio/bap_endpoint.h @@ -48,8 +48,8 @@ struct bt_bap_ep { struct bt_ascs_ase_status status; struct bt_bap_stream *stream; struct bt_audio_codec_cfg codec_cfg; - struct bt_audio_codec_qos qos; - struct bt_audio_codec_qos_pref qos_pref; + struct bt_bap_qos_cfg qos; + struct bt_bap_qos_cfg_pref qos_pref; struct bt_bap_iso *iso; /* unicast stopped reason */ @@ -68,7 +68,7 @@ struct bt_bap_unicast_group { uint8_t index; bool allocated; /* QoS used to create the CIG */ - const struct bt_audio_codec_qos *qos; + const struct bt_bap_qos_cfg *qos; struct bt_iso_cig *cig; /* The ISO API for CIG creation requires an array of pointers to ISO channels */ struct bt_iso_chan *cis[UNICAST_GROUP_STREAM_CNT]; @@ -91,7 +91,7 @@ struct bt_bap_broadcast_source { uint32_t broadcast_id; /* 24 bit */ struct bt_iso_big *big; - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; #if defined(CONFIG_BT_ISO_TEST_PARAMS) /* Stored advanced parameters */ uint8_t irc; @@ -158,7 +158,7 @@ struct bt_bap_broadcast_sink { uint32_t broadcast_id; /* 24 bit */ uint32_t indexes_bitfield; uint32_t valid_indexes_bitfield; /* based on codec support */ - struct bt_audio_codec_qos codec_qos; + struct bt_bap_qos_cfg qos_cfg; struct bt_le_per_adv_sync *pa_sync; struct bt_iso_big *big; struct bt_bap_broadcast_sink_bis bis[CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT]; diff --git a/subsys/bluetooth/audio/bap_stream.c b/subsys/bluetooth/audio/bap_stream.c index fa17e2d138e6f49..e0f9fdb533e3da1 100644 --- a/subsys/bluetooth/audio/bap_stream.c +++ b/subsys/bluetooth/audio/bap_stream.c @@ -44,15 +44,14 @@ LOG_MODULE_REGISTER(bt_bap_stream, CONFIG_BT_BAP_STREAM_LOG_LEVEL); #if defined(CONFIG_BT_BAP_UNICAST_CLIENT) || defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || \ defined(CONFIG_BT_BAP_BROADCAST_SINK) -void bt_audio_codec_qos_to_iso_qos(struct bt_iso_chan_io_qos *io, - const struct bt_audio_codec_qos *codec_qos) +void bt_bap_qos_cfg_to_iso_qos(struct bt_iso_chan_io_qos *io, const struct bt_bap_qos_cfg *qos_cfg) { - io->sdu = codec_qos->sdu; - io->phy = codec_qos->phy; - io->rtn = codec_qos->rtn; + io->sdu = qos_cfg->sdu; + io->phy = qos_cfg->phy; + io->rtn = qos_cfg->rtn; #if defined(CONFIG_BT_ISO_TEST_PARAMS) - io->burst_number = codec_qos->burst_number; - io->max_pdu = codec_qos->max_pdu; + io->burst_number = qos_cfg->burst_number; + io->max_pdu = qos_cfg->max_pdu; #endif /* CONFIG_BT_ISO_TEST_PARAMS */ } #endif /* CONFIG_BT_BAP_UNICAST_CLIENT || \ @@ -166,7 +165,7 @@ int bt_bap_ep_get_info(const struct bt_bap_ep *ep, struct bt_bap_ep_info *info) return 0; } -enum bt_bap_ascs_reason bt_audio_verify_qos(const struct bt_audio_codec_qos *qos) +enum bt_bap_ascs_reason bt_audio_verify_qos(const struct bt_bap_qos_cfg *qos) { if (qos->interval < BT_ISO_SDU_INTERVAL_MIN || qos->interval > BT_ISO_SDU_INTERVAL_MAX) { @@ -175,14 +174,13 @@ enum bt_bap_ascs_reason bt_audio_verify_qos(const struct bt_audio_codec_qos *qos return BT_BAP_ASCS_REASON_INTERVAL; } - if (qos->framing > BT_AUDIO_CODEC_QOS_FRAMING_FRAMED) { + if (qos->framing > BT_BAP_QOS_CFG_FRAMING_FRAMED) { LOG_DBG("Invalid Framing 0x%02x", qos->framing); return BT_BAP_ASCS_REASON_FRAMING; } - if (qos->phy != BT_AUDIO_CODEC_QOS_1M && - qos->phy != BT_AUDIO_CODEC_QOS_2M && - qos->phy != BT_AUDIO_CODEC_QOS_CODED) { + if (qos->phy != BT_BAP_QOS_CFG_1M && qos->phy != BT_BAP_QOS_CFG_2M && + qos->phy != BT_BAP_QOS_CFG_CODED) { LOG_DBG("Invalid PHY 0x%02x", qos->phy); return BT_BAP_ASCS_REASON_PHY; } @@ -434,9 +432,9 @@ static bool bt_bap_stream_is_broadcast(const struct bt_bap_stream *stream) } enum bt_bap_ascs_reason bt_bap_stream_verify_qos(const struct bt_bap_stream *stream, - const struct bt_audio_codec_qos *qos) + const struct bt_bap_qos_cfg *qos) { - const struct bt_audio_codec_qos_pref *qos_pref = &stream->ep->qos_pref; + const struct bt_bap_qos_cfg_pref *qos_pref = &stream->ep->qos_pref; if (qos_pref->latency < qos->latency) { /* Latency is a preferred value. Print debug info but do not fail. */ diff --git a/subsys/bluetooth/audio/bap_stream.h b/subsys/bluetooth/audio/bap_stream.h index 597bf80d94cd612..14334163bbb57a0 100644 --- a/subsys/bluetooth/audio/bap_stream.h +++ b/subsys/bluetooth/audio/bap_stream.h @@ -25,17 +25,16 @@ void bt_bap_stream_reset(struct bt_bap_stream *stream); void bt_bap_stream_attach(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_bap_ep *ep, struct bt_audio_codec_cfg *codec_cfg); -void bt_audio_codec_qos_to_iso_qos(struct bt_iso_chan_io_qos *io, - const struct bt_audio_codec_qos *codec_qos); +void bt_bap_qos_cfg_to_iso_qos(struct bt_iso_chan_io_qos *io, const struct bt_bap_qos_cfg *qos_cfg); void bt_bap_stream_detach(struct bt_bap_stream *stream); -enum bt_bap_ascs_reason bt_audio_verify_qos(const struct bt_audio_codec_qos *qos); +enum bt_bap_ascs_reason bt_audio_verify_qos(const struct bt_bap_qos_cfg *qos); bool bt_audio_valid_ltv(const uint8_t *data, uint8_t data_len); bool bt_audio_valid_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg); bool bt_bap_stream_can_disconnect(const struct bt_bap_stream *stream); enum bt_bap_ascs_reason bt_bap_stream_verify_qos(const struct bt_bap_stream *stream, - const struct bt_audio_codec_qos *qos); + const struct bt_bap_qos_cfg *qos); struct bt_iso_chan *bt_bap_stream_iso_chan_get(struct bt_bap_stream *stream); diff --git a/subsys/bluetooth/audio/bap_unicast_client.c b/subsys/bluetooth/audio/bap_unicast_client.c index 862a8a1952f8498..8bb07b0e1d176e9 100644 --- a/subsys/bluetooth/audio/bap_unicast_client.c +++ b/subsys/bluetooth/audio/bap_unicast_client.c @@ -667,7 +667,7 @@ static void unicast_client_ep_config_state(struct bt_bap_ep *ep, struct net_buf_ struct bt_bap_unicast_client_ep *client_ep = CONTAINER_OF(ep, struct bt_bap_unicast_client_ep, ep); struct bt_ascs_ase_status_config *cfg; - struct bt_audio_codec_qos_pref *pref; + struct bt_bap_qos_cfg_pref *pref; struct bt_bap_stream *stream; void *cc; @@ -1808,7 +1808,7 @@ static int unicast_client_ep_config(struct bt_bap_ep *ep, struct net_buf_simple } int bt_bap_unicast_client_ep_qos(struct bt_bap_ep *ep, struct net_buf_simple *buf, - struct bt_audio_codec_qos *qos) + struct bt_bap_qos_cfg *qos) { struct bt_ascs_qos *req; struct bt_conn_iso *conn_iso; @@ -2135,9 +2135,9 @@ static void unicast_client_ep_reset(struct bt_conn *conn, uint8_t reason) reset_att_buf(client); } -static void bt_audio_codec_qos_to_cig_param(struct bt_iso_cig_param *cig_param, - const struct bt_audio_codec_qos *qos, - const struct bt_bap_unicast_group_param *group_param) +static void bt_bap_qos_cfg_to_cig_param(struct bt_iso_cig_param *cig_param, + const struct bt_bap_qos_cfg *qos, + const struct bt_bap_unicast_group_param *group_param) { cig_param->framing = qos->framing; cig_param->packing = BT_ISO_PACKING_SEQUENTIAL; /* TODO: Add to QoS struct */ @@ -2161,8 +2161,7 @@ static void bt_audio_codec_qos_to_cig_param(struct bt_iso_cig_param *cig_param, * between CIS'es. The implementation shall take the CIG parameters from * unicast_group instead. */ -static int bt_audio_cig_create(struct bt_bap_unicast_group *group, - const struct bt_audio_codec_qos *qos, +static int bt_audio_cig_create(struct bt_bap_unicast_group *group, const struct bt_bap_qos_cfg *qos, const struct bt_bap_unicast_group_param *group_param) { struct bt_iso_cig_param param; @@ -2183,7 +2182,7 @@ static int bt_audio_cig_create(struct bt_bap_unicast_group *group, param.num_cis = cis_count; param.cis_channels = group->cis; - bt_audio_codec_qos_to_cig_param(¶m, qos, group_param); + bt_bap_qos_cfg_to_cig_param(¶m, qos, group_param); err = bt_iso_cig_create(¶m, &group->cig); if (err != 0) { @@ -2197,7 +2196,7 @@ static int bt_audio_cig_create(struct bt_bap_unicast_group *group, } static int bt_audio_cig_reconfigure(struct bt_bap_unicast_group *group, - const struct bt_audio_codec_qos *qos) + const struct bt_bap_qos_cfg *qos) { struct bt_iso_cig_param param; uint8_t cis_count; @@ -2217,7 +2216,7 @@ static int bt_audio_cig_reconfigure(struct bt_bap_unicast_group *group, param.num_cis = cis_count; param.cis_channels = group->cis; - bt_audio_codec_qos_to_cig_param(¶m, qos, NULL); + bt_bap_qos_cfg_to_cig_param(¶m, qos, NULL); err = bt_iso_cig_reconfigure(group->cig, ¶m); if (err != 0) { @@ -2307,9 +2306,9 @@ static void unicast_group_del_iso(struct bt_bap_unicast_group *group, struct bt_ } } -static void unicast_client_codec_qos_to_iso_qos(struct bt_bap_iso *iso, - const struct bt_audio_codec_qos *qos, - enum bt_audio_dir dir) +static void unicast_client_qos_cfg_to_iso_qos(struct bt_bap_iso *iso, + const struct bt_bap_qos_cfg *qos, + enum bt_audio_dir dir) { struct bt_iso_chan_io_qos *io_qos; struct bt_iso_chan_io_qos *other_io_qos; @@ -2336,7 +2335,7 @@ static void unicast_client_codec_qos_to_iso_qos(struct bt_bap_iso *iso, } } - bt_audio_codec_qos_to_iso_qos(io_qos, qos); + bt_bap_qos_cfg_to_iso_qos(io_qos, qos); #if defined(CONFIG_BT_ISO_TEST_PARAMS) iso->chan.qos->num_subevents = qos->num_subevents; #endif /* CONFIG_BT_ISO_TEST_PARAMS */ @@ -2354,7 +2353,7 @@ static void unicast_group_add_stream(struct bt_bap_unicast_group *group, struct bt_bap_iso *iso, enum bt_audio_dir dir) { struct bt_bap_stream *stream = param->stream; - struct bt_audio_codec_qos *qos = param->qos; + struct bt_bap_qos_cfg *qos = param->qos; LOG_DBG("group %p stream %p qos %p iso %p dir %u", group, stream, qos, iso, dir); @@ -2369,8 +2368,8 @@ static void unicast_group_add_stream(struct bt_bap_unicast_group *group, bt_bap_iso_bind_ep(iso, stream->ep); } - /* Store the Codec QoS in the bap_iso */ - unicast_client_codec_qos_to_iso_qos(iso, qos, dir); + /* Store the QoS in the bap_iso */ + unicast_client_qos_cfg_to_iso_qos(iso, qos, dir); sys_slist_append(&group->streams, &stream->_node); } @@ -2558,7 +2557,7 @@ static int stream_pair_param_check(const struct bt_bap_unicast_group_stream_pair return 0; } -static int group_qos_common_set(const struct bt_audio_codec_qos **group_qos, +static int group_qos_common_set(const struct bt_bap_qos_cfg **group_qos, const struct bt_bap_unicast_group_stream_pair_param *param) { if (param->rx_param != NULL && *group_qos == NULL) { @@ -2576,7 +2575,7 @@ int bt_bap_unicast_group_create(struct bt_bap_unicast_group_param *param, struct bt_bap_unicast_group **out_unicast_group) { struct bt_bap_unicast_group *unicast_group; - const struct bt_audio_codec_qos *group_qos = NULL; + const struct bt_bap_qos_cfg *group_qos = NULL; int err; CHECKIF(out_unicast_group == NULL) @@ -2647,7 +2646,7 @@ int bt_bap_unicast_group_add_streams(struct bt_bap_unicast_group *unicast_group, struct bt_bap_unicast_group_stream_pair_param params[], size_t num_param) { - const struct bt_audio_codec_qos *group_qos = unicast_group->qos; + const struct bt_bap_qos_cfg *group_qos = unicast_group->qos; struct bt_bap_stream *tmp_stream; size_t total_stream_cnt; struct bt_iso_cig *cig; diff --git a/subsys/bluetooth/audio/bap_unicast_client_internal.h b/subsys/bluetooth/audio/bap_unicast_client_internal.h index 8e279ad652d011d..744bc2d86c600e0 100644 --- a/subsys/bluetooth/audio/bap_unicast_client_internal.h +++ b/subsys/bluetooth/audio/bap_unicast_client_internal.h @@ -37,7 +37,7 @@ int bt_bap_unicast_client_release(struct bt_bap_stream *stream); struct net_buf_simple *bt_bap_unicast_client_ep_create_pdu(struct bt_conn *conn, uint8_t op); int bt_bap_unicast_client_ep_qos(struct bt_bap_ep *ep, struct net_buf_simple *buf, - struct bt_audio_codec_qos *qos); + struct bt_bap_qos_cfg *qos); int bt_bap_unicast_client_ep_send(struct bt_conn *conn, struct bt_bap_ep *ep, struct net_buf_simple *buf); diff --git a/subsys/bluetooth/audio/bap_unicast_server.c b/subsys/bluetooth/audio/bap_unicast_server.c index 0c631186c03a490..4417099e39611aa 100644 --- a/subsys/bluetooth/audio/bap_unicast_server.c +++ b/subsys/bluetooth/audio/bap_unicast_server.c @@ -162,7 +162,7 @@ int bt_bap_unicast_server_release(struct bt_bap_stream *stream) int bt_bap_unicast_server_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg, - const struct bt_audio_codec_qos_pref *qos_pref) + const struct bt_bap_qos_cfg_pref *qos_pref) { return bt_ascs_config_ase(conn, stream, codec_cfg, qos_pref); } diff --git a/subsys/bluetooth/audio/cap_stream.c b/subsys/bluetooth/audio/cap_stream.c index bd5390b9fef1251..4ff1845c21a0d99 100644 --- a/subsys/bluetooth/audio/cap_stream.c +++ b/subsys/bluetooth/audio/cap_stream.c @@ -47,7 +47,7 @@ static bool stream_is_central(struct bt_bap_stream *bap_stream) #if defined(CONFIG_BT_BAP_UNICAST) static void cap_stream_configured_cb(struct bt_bap_stream *bap_stream, - const struct bt_audio_codec_qos_pref *pref) + const struct bt_bap_qos_cfg_pref *pref) { struct bt_cap_stream *cap_stream = CONTAINER_OF(bap_stream, struct bt_cap_stream, diff --git a/subsys/bluetooth/audio/shell/audio.h b/subsys/bluetooth/audio/shell/audio.h index a13879c4c9f4a78..7dfe4b766ec3bf6 100644 --- a/subsys/bluetooth/audio/shell/audio.h +++ b/subsys/bluetooth/audio/shell/audio.h @@ -93,7 +93,7 @@ struct named_lc3_preset { struct shell_stream { struct bt_cap_stream stream; struct bt_audio_codec_cfg codec_cfg; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; bool is_tx; bool is_rx; @@ -177,7 +177,7 @@ struct broadcast_source { struct bt_cap_broadcast_source *cap_source; }; struct bt_audio_codec_cfg codec_cfg; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; }; struct broadcast_sink { @@ -235,7 +235,7 @@ int cap_ac_unicast(const struct shell *sh, const struct bap_unicast_ac_param *pa #endif /* CONFIG_BT_BAP_UNICAST_CLIENT */ #endif /* CONFIG_BT_BAP_UNICAST */ -static inline void print_qos(const struct shell *sh, const struct bt_audio_codec_qos *qos) +static inline void print_qos(const struct shell *sh, const struct bt_bap_qos_cfg *qos) { #if defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || defined(CONFIG_BT_BAP_UNICAST) shell_print(sh, diff --git a/subsys/bluetooth/audio/shell/bap.c b/subsys/bluetooth/audio/shell/bap.c index 9dcffab16354081..060e068a1f4790c 100644 --- a/subsys/bluetooth/audio/shell/bap.c +++ b/subsys/bluetooth/audio/shell/bap.c @@ -619,8 +619,8 @@ static int cmd_select_unicast(const struct shell *sh, size_t argc, char *argv[]) } #if defined(CONFIG_BT_BAP_UNICAST_SERVER) -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0u, 60u, 10000u, 60000u, 10000u, 60000u); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0u, 60u, 10000u, 60000u, 10000u, 60000u); static struct bt_bap_stream *stream_alloc(void) { @@ -637,7 +637,7 @@ static struct bt_bap_stream *stream_alloc(void) static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { shell_print(ctx_shell, "ASE Codec Config: conn %p ep %p dir %u", conn, ep, dir); @@ -663,7 +663,7 @@ static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { shell_print(ctx_shell, "ASE Codec Reconfig: stream %p", stream); @@ -678,7 +678,7 @@ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, return 0; } -static int lc3_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int lc3_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { shell_print(ctx_shell, "QoS: stream %p %p", stream, qos); @@ -822,8 +822,8 @@ int bap_ac_create_unicast_group(const struct bap_unicast_ac_param *param, 0}; struct bt_bap_unicast_group_stream_pair_param pair_params[BAP_UNICAST_AC_MAX_PAIR] = {0}; struct bt_bap_unicast_group_param group_param = {0}; - struct bt_audio_codec_qos *snk_qos[BAP_UNICAST_AC_MAX_SNK]; - struct bt_audio_codec_qos *src_qos[BAP_UNICAST_AC_MAX_SRC]; + struct bt_bap_qos_cfg *snk_qos[BAP_UNICAST_AC_MAX_SNK]; + struct bt_bap_qos_cfg *src_qos[BAP_UNICAST_AC_MAX_SRC]; size_t snk_stream_cnt = 0U; size_t src_stream_cnt = 0U; size_t pair_cnt = 0U; @@ -1316,7 +1316,7 @@ static int cmd_config(const struct shell *sh, size_t argc, char *argv[]) static int cmd_stream_qos(const struct shell *sh, size_t argc, char *argv[]) { - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; unsigned long interval; int err = 0; @@ -3100,7 +3100,7 @@ static void stream_stopped_cb(struct bt_bap_stream *stream, uint8_t reason) #if defined(CONFIG_BT_BAP_UNICAST) static void stream_configured_cb(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) + const struct bt_bap_qos_cfg_pref *pref) { shell_print(ctx_shell, "Stream %p configured\n", stream); } diff --git a/tests/bluetooth/audio/ascs/include/bap_unicast_server.h b/tests/bluetooth/audio/ascs/include/bap_unicast_server.h index 08e3b9fd0eaefe2..09cd37d42937662 100644 --- a/tests/bluetooth/audio/ascs/include/bap_unicast_server.h +++ b/tests/bluetooth/audio/ascs/include/bap_unicast_server.h @@ -18,12 +18,12 @@ void mock_bap_unicast_server_cleanup(void); DECLARE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_config, struct bt_conn *, const struct bt_bap_ep *, enum bt_audio_dir, const struct bt_audio_codec_cfg *, struct bt_bap_stream **, - struct bt_audio_codec_qos_pref *const, struct bt_bap_ascs_rsp *); + struct bt_bap_qos_cfg_pref *const, struct bt_bap_ascs_rsp *); DECLARE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_reconfig, struct bt_bap_stream *, enum bt_audio_dir, const struct bt_audio_codec_cfg *, - struct bt_audio_codec_qos_pref *const, struct bt_bap_ascs_rsp *); + struct bt_bap_qos_cfg_pref *const, struct bt_bap_ascs_rsp *); DECLARE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_qos, struct bt_bap_stream *, - const struct bt_audio_codec_qos *, struct bt_bap_ascs_rsp *); + const struct bt_bap_qos_cfg *, struct bt_bap_ascs_rsp *); DECLARE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_enable, struct bt_bap_stream *, const uint8_t *, size_t, struct bt_bap_ascs_rsp *); DECLARE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_start, struct bt_bap_stream *, diff --git a/tests/bluetooth/audio/ascs/src/main.c b/tests/bluetooth/audio/ascs/src/main.c index 69e738dceb8251b..5795e13b38e0184 100644 --- a/tests/bluetooth/audio/ascs/src/main.c +++ b/tests/bluetooth/audio/ascs/src/main.c @@ -564,14 +564,14 @@ ZTEST_F(ascs_test_suite, test_cis_link_loss_in_enabling_state_client_retries) } static struct bt_bap_stream *stream_allocated; -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); static int unicast_server_cb_config_custom_fake(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { *stream = stream_allocated; diff --git a/tests/bluetooth/audio/ascs/src/test_ase_control_params.c b/tests/bluetooth/audio/ascs/src/test_ase_control_params.c index a89af5bf170d97a..028b843a119280f 100644 --- a/tests/bluetooth/audio/ascs/src/test_ase_control_params.c +++ b/tests/bluetooth/audio/ascs/src/test_ase_control_params.c @@ -345,14 +345,14 @@ ZTEST_F(test_ase_control_params, test_codec_configure_invalid_ase_id_0x00) } static struct bt_bap_stream test_stream; -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); static int unicast_server_cb_config_custom_fake(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { *stream = &test_stream; diff --git a/tests/bluetooth/audio/ascs/src/test_ase_state_transition.c b/tests/bluetooth/audio/ascs/src/test_ase_state_transition.c index 0d4e6928d5f8d26..c36ccc9b1a18c2a 100644 --- a/tests/bluetooth/audio/ascs/src/test_ase_state_transition.c +++ b/tests/bluetooth/audio/ascs/src/test_ase_state_transition.c @@ -28,8 +28,8 @@ #define test_sink_ase_state_transition_fixture test_ase_state_transition_fixture #define test_source_ase_state_transition_fixture test_ase_state_transition_fixture -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); struct test_ase_state_transition_fixture { struct bt_conn conn; diff --git a/tests/bluetooth/audio/ascs/src/test_common.c b/tests/bluetooth/audio/ascs/src/test_common.c index 429c7edd81d71fc..5136c154d28e1da 100644 --- a/tests/bluetooth/audio/ascs/src/test_common.c +++ b/tests/bluetooth/audio/ascs/src/test_common.c @@ -127,14 +127,14 @@ uint8_t test_ase_id_get(const struct bt_gatt_attr *ase) } static struct bt_bap_stream *stream_allocated; -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); static int unicast_server_cb_config_custom_fake(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { *stream = stream_allocated; diff --git a/tests/bluetooth/audio/ascs/uut/bap_unicast_server.c b/tests/bluetooth/audio/ascs/uut/bap_unicast_server.c index b099008e3c76249..6d256d19822022f 100644 --- a/tests/bluetooth/audio/ascs/uut/bap_unicast_server.c +++ b/tests/bluetooth/audio/ascs/uut/bap_unicast_server.c @@ -33,12 +33,12 @@ void mock_bap_unicast_server_cleanup(void) DEFINE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_config, struct bt_conn *, const struct bt_bap_ep *, enum bt_audio_dir, const struct bt_audio_codec_cfg *, struct bt_bap_stream **, - struct bt_audio_codec_qos_pref *const, struct bt_bap_ascs_rsp *); + struct bt_bap_qos_cfg_pref *const, struct bt_bap_ascs_rsp *); DEFINE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_reconfig, struct bt_bap_stream *, enum bt_audio_dir, const struct bt_audio_codec_cfg *, - struct bt_audio_codec_qos_pref *const, struct bt_bap_ascs_rsp *); + struct bt_bap_qos_cfg_pref *const, struct bt_bap_ascs_rsp *); DEFINE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_qos, struct bt_bap_stream *, - const struct bt_audio_codec_qos *, struct bt_bap_ascs_rsp *); + const struct bt_bap_qos_cfg *, struct bt_bap_ascs_rsp *); DEFINE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_enable, struct bt_bap_stream *, const uint8_t *, size_t, struct bt_bap_ascs_rsp *); DEFINE_FAKE_VALUE_FUNC(int, mock_bap_unicast_server_cb_start, struct bt_bap_stream *, diff --git a/tests/bluetooth/audio/bap_broadcast_source/src/main.c b/tests/bluetooth/audio/bap_broadcast_source/src/main.c index b3e1c59db240fe8..d1e1194986325e9 100644 --- a/tests/bluetooth/audio/bap_broadcast_source/src/main.c +++ b/tests/bluetooth/audio/bap_broadcast_source/src/main.c @@ -54,7 +54,7 @@ static void bap_broadcast_source_test_suite_fixture_init( struct bt_bap_broadcast_source_subgroup_param *subgroup_param; struct bt_bap_broadcast_source_stream_param *stream_params; struct bt_audio_codec_cfg *codec_cfg; - struct bt_audio_codec_qos *codec_qos; + struct bt_bap_qos_cfg *qos_cfg; struct bt_bap_stream *streams; const uint16_t latency = 10U; /* ms*/ const uint32_t pd = 40000U; /* us */ @@ -75,8 +75,8 @@ static void bap_broadcast_source_test_suite_fixture_init( zassert_not_null(stream_params); codec_cfg = malloc(sizeof(struct bt_audio_codec_cfg)); zassert_not_null(codec_cfg); - codec_qos = malloc(sizeof(struct bt_audio_codec_qos)); - zassert_not_null(codec_qos); + qos_cfg = malloc(sizeof(struct bt_bap_qos_cfg)); + zassert_not_null(qos_cfg); streams = malloc(sizeof(struct bt_bap_stream) * CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT); zassert_not_null(streams); bis_data = malloc(CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE); @@ -91,14 +91,14 @@ static void bap_broadcast_source_test_suite_fixture_init( sizeof(struct bt_bap_broadcast_source_stream_param) * CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT); memset(codec_cfg, 0, sizeof(struct bt_audio_codec_cfg)); - memset(codec_qos, 0, sizeof(struct bt_audio_codec_qos)); + memset(qos_cfg, 0, sizeof(struct bt_bap_qos_cfg)); memset(streams, 0, sizeof(struct bt_bap_stream) * CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT); memset(bis_data, 0, CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE); /* Initialize default values*/ *codec_cfg = BT_AUDIO_CODEC_LC3_CONFIG(BT_AUDIO_CODEC_CFG_FREQ_16KHZ, BT_AUDIO_CODEC_CFG_DURATION_10, loc, 40U, 1, ctx); - *codec_qos = BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, sdu, rtn, latency, pd); + *qos_cfg = BT_BAP_QOS_CFG_UNFRAMED(10000u, sdu, rtn, latency, pd); memcpy(bis_data, bis_cfg_data, sizeof(bis_cfg_data)); for (size_t i = 0U; i < CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT; i++) { @@ -116,7 +116,7 @@ static void bap_broadcast_source_test_suite_fixture_init( fixture->param->params_count = CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT; fixture->param->params = subgroup_param; - fixture->param->qos = codec_qos; + fixture->param->qos = qos_cfg; fixture->param->encryption = false; memset(fixture->param->broadcast_code, 0, sizeof(fixture->param->broadcast_code)); fixture->param->packing = BT_ISO_PACKING_SEQUENTIAL; @@ -320,7 +320,7 @@ ZTEST_F(bap_broadcast_source_test_suite, test_broadcast_source_create_inval_subg ZTEST_F(bap_broadcast_source_test_suite, test_broadcast_source_create_inval_qos_null) { struct bt_bap_broadcast_source_param *create_param = fixture->param; - struct bt_audio_codec_qos *qos = create_param->qos; + struct bt_bap_qos_cfg *qos = create_param->qos; int err; create_param->qos = NULL; @@ -759,7 +759,7 @@ ZTEST_F(bap_broadcast_source_test_suite, ZTEST_F(bap_broadcast_source_test_suite, test_broadcast_source_reconfigure_inval_qos_null) { struct bt_bap_broadcast_source_param *param = fixture->param; - struct bt_audio_codec_qos *qos = param->qos; + struct bt_bap_qos_cfg *qos = param->qos; int err; printk("Creating broadcast source with %zu subgroups with %zu streams\n", diff --git a/tests/bluetooth/audio/mocks/include/bap_stream.h b/tests/bluetooth/audio/mocks/include/bap_stream.h index 8bc1d3217e44424..c823d7089fb8d0f 100644 --- a/tests/bluetooth/audio/mocks/include/bap_stream.h +++ b/tests/bluetooth/audio/mocks/include/bap_stream.h @@ -16,7 +16,7 @@ void mock_bap_stream_init(void); void mock_bap_stream_cleanup(void); DECLARE_FAKE_VOID_FUNC(mock_bap_stream_configured_cb, struct bt_bap_stream *, - const struct bt_audio_codec_qos_pref *); + const struct bt_bap_qos_cfg_pref *); DECLARE_FAKE_VOID_FUNC(mock_bap_stream_qos_set_cb, struct bt_bap_stream *); DECLARE_FAKE_VOID_FUNC(mock_bap_stream_enabled_cb, struct bt_bap_stream *); DECLARE_FAKE_VOID_FUNC(mock_bap_stream_metadata_updated_cb, struct bt_bap_stream *); diff --git a/tests/bluetooth/audio/mocks/src/bap_stream.c b/tests/bluetooth/audio/mocks/src/bap_stream.c index 940dbeb76dcf39f..31b060d0111da09 100644 --- a/tests/bluetooth/audio/mocks/src/bap_stream.c +++ b/tests/bluetooth/audio/mocks/src/bap_stream.c @@ -26,7 +26,7 @@ struct bt_bap_stream_ops mock_bap_stream_ops; DEFINE_FAKE_VOID_FUNC(mock_bap_stream_configured_cb, struct bt_bap_stream *, - const struct bt_audio_codec_qos_pref *); + const struct bt_bap_qos_cfg_pref *); DEFINE_FAKE_VOID_FUNC(mock_bap_stream_qos_set_cb, struct bt_bap_stream *); DEFINE_FAKE_VOID_FUNC(mock_bap_stream_enabled_cb, struct bt_bap_stream *); DEFINE_FAKE_VOID_FUNC(mock_bap_stream_metadata_updated_cb, struct bt_bap_stream *); diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c index 836d748b8d8ab74..4c30abfb6e43847 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.c @@ -319,7 +319,7 @@ uint8_t btp_bap_broadcast_source_setup(const void *cmd, uint16_t cmd_len, codec_cfg.data_len = cp->cc_ltvs_len; memcpy(codec_cfg.data, cp->cc_ltvs, cp->cc_ltvs_len); - source->qos.phy = BT_AUDIO_CODEC_QOS_2M; + source->qos.phy = BT_BAP_QOS_CFG_2M; source->qos.framing = cp->framing; source->qos.rtn = cp->retransmission_num; source->qos.latency = sys_le16_to_cpu(cp->max_transport_latency); diff --git a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h index cbecb446b3a8ac1..4471928f84cc408 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h +++ b/tests/bluetooth/tester/src/audio/btp_bap_broadcast.h @@ -30,7 +30,7 @@ struct btp_bap_broadcast_remote_source { struct btp_bap_broadcast_stream streams[CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT]; struct bt_bap_stream *sink_streams[CONFIG_BT_BAP_BROADCAST_SNK_STREAM_COUNT]; struct bt_bap_broadcast_sink *sink; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; /* BIS Index bitfield read from Base */ uint32_t bis_index_bitfield; /* BIS Index bitfield read from sync request */ @@ -42,7 +42,7 @@ struct btp_bap_broadcast_remote_source { struct btp_bap_broadcast_local_source { uint32_t broadcast_id; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; struct btp_bap_broadcast_stream streams[CONFIG_BT_BAP_BROADCAST_SRC_STREAM_COUNT]; struct bt_audio_codec_cfg subgroup_codec_cfg[CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT]; /* Only for BTP BAP commands */ diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c index 531605689fcf9b0..940649a2b935b76 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.c +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.c @@ -25,8 +25,8 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL); #include "btp_bap_audio_stream.h" #include "btp_bap_unicast.h" -static struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 10000, 40000, 10000, 40000); +static struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 10000, 40000, 10000, 40000); static struct btp_bap_unicast_connection connections[CONFIG_BT_MAX_CONN]; static struct btp_bap_unicast_group cigs[CONFIG_BT_ISO_MAX_CIG]; @@ -268,7 +268,7 @@ static void btp_send_ase_found_ev(struct bt_conn *conn, struct bt_bap_ep *ep) tester_event(BTP_SERVICE_ID_BAP, BTP_BAP_EV_ASE_FOUND, &ev, sizeof(ev)); } -static inline void print_qos(const struct bt_audio_codec_qos *qos) +static inline void print_qos(const struct bt_bap_qos_cfg *qos) { LOG_DBG("QoS: interval %u framing 0x%02x phy 0x%02x sdu %u rtn %u latency %u pd %u", qos->interval, qos->framing, qos->phy, qos->sdu, qos->rtn, qos->latency, qos->pd); @@ -323,7 +323,7 @@ static int validate_codec_parameters(const struct bt_audio_codec_cfg *codec_cfg) static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { struct bt_bap_ep_info info; struct btp_bap_unicast_connection *u_conn; @@ -372,7 +372,7 @@ static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { LOG_DBG("ASE Codec Reconfig: stream %p", stream); @@ -381,7 +381,7 @@ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, return 0; } -static int lc3_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int lc3_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { LOG_DBG("QoS: stream %p qos %p", stream, qos); @@ -500,8 +500,7 @@ static const struct bt_bap_unicast_server_cb unicast_server_cb = { .release = lc3_release, }; -static void stream_configured(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) +static void stream_configured(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref) { struct bt_bap_ep_info info; struct btp_bap_unicast_connection *u_conn; @@ -952,7 +951,7 @@ uint8_t btp_bap_discover(const void *cmd, uint16_t cmd_len, static int server_stream_config(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *qos) + struct bt_bap_qos_cfg_pref *qos) { int err; struct bt_bap_ep_info info; @@ -1271,14 +1270,14 @@ uint8_t btp_ascs_preconfigure_qos(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len) { const struct btp_ascs_preconfigure_qos_cmd *cp = cmd; - struct bt_audio_codec_qos *qos; + struct bt_bap_qos_cfg *qos; LOG_DBG(""); qos = &cigs[cp->cig_id].qos[cp->cis_id]; memset(qos, 0, sizeof(*qos)); - qos->phy = BT_AUDIO_CODEC_QOS_2M; + qos->phy = BT_BAP_QOS_CFG_2M; qos->framing = cp->framing; qos->rtn = cp->retransmission_num; qos->sdu = sys_le16_to_cpu(cp->max_sdu); diff --git a/tests/bluetooth/tester/src/audio/btp_bap_unicast.h b/tests/bluetooth/tester/src/audio/btp_bap_unicast.h index e4111289da8c6cd..740bd531b897566 100644 --- a/tests/bluetooth/tester/src/audio/btp_bap_unicast.h +++ b/tests/bluetooth/tester/src/audio/btp_bap_unicast.h @@ -18,7 +18,7 @@ CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT struct btp_bap_unicast_group { - struct bt_audio_codec_qos qos[CONFIG_BT_BAP_UNICAST_CLIENT_GROUP_STREAM_COUNT]; + struct bt_bap_qos_cfg qos[CONFIG_BT_BAP_UNICAST_CLIENT_GROUP_STREAM_COUNT]; struct bt_bap_unicast_group *cig; bool in_use; }; diff --git a/tests/bluetooth/tester/src/audio/btp_cap.c b/tests/bluetooth/tester/src/audio/btp_cap.c index 19986060b948be5..8b030ab64ee13ab 100644 --- a/tests/bluetooth/tester/src/audio/btp_cap.c +++ b/tests/bluetooth/tester/src/audio/btp_cap.c @@ -190,7 +190,7 @@ static uint8_t btp_cap_discover(const void *cmd, uint16_t cmd_len, static int cap_unicast_setup_ase(struct bt_conn *conn, uint8_t ase_id, uint8_t cis_id, uint8_t cig_id, struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos *qos) + struct bt_bap_qos_cfg *qos) { struct btp_bap_unicast_group *group; struct btp_bap_unicast_stream *u_stream; @@ -232,7 +232,7 @@ static uint8_t btp_cap_unicast_setup_ase(const void *cmd, uint16_t cmd_len, { const struct btp_cap_unicast_setup_ase_cmd *cp = cmd; struct bt_audio_codec_cfg codec_cfg; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; struct bt_conn *conn; const uint8_t *ltv_ptr; int err; @@ -247,7 +247,7 @@ static uint8_t btp_cap_unicast_setup_ase(const void *cmd, uint16_t cmd_len, } memset(&qos, 0, sizeof(qos)); - qos.phy = BT_AUDIO_CODEC_QOS_2M; + qos.phy = BT_BAP_QOS_CFG_2M; qos.framing = cp->framing; qos.rtn = cp->retransmission_num; qos.sdu = sys_le16_to_cpu(cp->max_sdu); @@ -604,7 +604,7 @@ static uint8_t btp_cap_broadcast_source_setup(const void *cmd, uint16_t cmd_len, struct btp_cap_broadcast_source_setup_rp *rp = rsp; struct btp_bap_broadcast_local_source *source = btp_bap_broadcast_local_source_get(cp->source_id); - struct bt_audio_codec_qos *qos = &source->qos; + struct bt_bap_qos_cfg *qos = &source->qos; LOG_DBG(""); @@ -650,7 +650,7 @@ static uint8_t btp_cap_broadcast_source_setup(const void *cmd, uint16_t cmd_len, } memset(qos, 0, sizeof(*qos)); - qos->phy = BT_AUDIO_CODEC_QOS_2M; + qos->phy = BT_BAP_QOS_CFG_2M; qos->framing = cp->framing; qos->rtn = cp->retransmission_num; qos->sdu = sys_le16_to_cpu(cp->max_sdu); diff --git a/tests/bsim/bluetooth/audio/src/bap_common.c b/tests/bsim/bluetooth/audio/src/bap_common.c index 3e19b66e992cb23..6af281264698081 100644 --- a/tests/bsim/bluetooth/audio/src/bap_common.c +++ b/tests/bsim/bluetooth/audio/src/bap_common.c @@ -86,7 +86,7 @@ void print_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg) print_ltv_array("meta", codec_cfg->meta, codec_cfg->meta_len); } -void print_qos(const struct bt_audio_codec_qos *qos) +void print_qos(const struct bt_bap_qos_cfg *qos) { printk("QoS: interval %u framing 0x%02x phy 0x%02x sdu %u " "rtn %u latency %u pd %u\n", diff --git a/tests/bsim/bluetooth/audio/src/bap_common.h b/tests/bsim/bluetooth/audio/src/bap_common.h index b87525b652a76c4..9a221dd750335ab 100644 --- a/tests/bsim/bluetooth/audio/src/bap_common.h +++ b/tests/bsim/bluetooth/audio/src/bap_common.h @@ -44,7 +44,7 @@ struct unicast_stream { struct bt_cap_stream stream; struct bt_audio_codec_cfg codec_cfg; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; }; struct named_lc3_preset { @@ -55,7 +55,7 @@ struct named_lc3_preset { void print_hex(const uint8_t *ptr, size_t len); void print_codec_cap(const struct bt_audio_codec_cap *codec_cap); void print_codec_cfg(const struct bt_audio_codec_cfg *codec_cfg); -void print_qos(const struct bt_audio_codec_qos *qos); +void print_qos(const struct bt_bap_qos_cfg *qos); void copy_unicast_stream_preset(struct unicast_stream *stream, const struct named_lc3_preset *named_preset); diff --git a/tests/bsim/bluetooth/audio/src/bap_unicast_client_test.c b/tests/bsim/bluetooth/audio/src/bap_unicast_client_test.c index d7b4b7a04ef1ead..f5cb29b6ceb8dba 100644 --- a/tests/bsim/bluetooth/audio/src/bap_unicast_client_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_unicast_client_test.c @@ -73,8 +73,7 @@ CREATE_FLAG(flag_stream_stopped); CREATE_FLAG(flag_stream_released); CREATE_FLAG(flag_operation_success); -static void stream_configured(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) +static void stream_configured(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref) { printk("Configured stream %p\n", stream); diff --git a/tests/bsim/bluetooth/audio/src/bap_unicast_server_test.c b/tests/bsim/bluetooth/audio/src/bap_unicast_server_test.c index c2f2fd2c3c51c74..8022011049dd104 100644 --- a/tests/bsim/bluetooth/audio/src/bap_unicast_server_test.c +++ b/tests/bsim/bluetooth/audio/src/bap_unicast_server_test.c @@ -70,8 +70,8 @@ static const struct bt_audio_codec_cap lc3_codec_cap = { static struct audio_test_stream test_streams[CONFIG_BT_ASCS_ASE_SNK_COUNT + CONFIG_BT_ASCS_ASE_SRC_COUNT]; -static const struct bt_audio_codec_qos_pref qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); +static const struct bt_bap_qos_cfg_pref qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0x02, 10, 40000, 40000, 40000, 40000); static uint8_t unicast_server_addata[] = { BT_UUID_16_ENCODE(BT_UUID_ASCS_VAL), /* ASCS UUID */ @@ -113,7 +113,7 @@ static struct bt_bap_stream *stream_alloc(void) static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir); @@ -139,7 +139,7 @@ static int lc3_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, struct bt_bap_ascs_rsp *rsp) + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Reconfig: stream %p\n", stream); @@ -150,7 +150,7 @@ static int lc3_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, return -ENOEXEC; } -static int lc3_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int lc3_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { struct audio_test_stream *test_stream = audio_test_stream_from_bap_stream(stream); diff --git a/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c b/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c index 4e7485b97d0da8a..30bb09f2aaf2af5 100644 --- a/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c +++ b/tests/bsim/bluetooth/audio/src/cap_acceptor_test.c @@ -71,8 +71,8 @@ static const struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP_LC3( BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(1, 2), 30, 240, 2, (BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | BT_AUDIO_CONTEXT_TYPE_MEDIA)); -static const struct bt_audio_codec_qos_pref unicast_qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0u, 60u, 20000u, 40000u, 20000u, 40000u); +static const struct bt_bap_qos_cfg_pref unicast_qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0u, 60u, 20000u, 40000u, 20000u, 40000u); static bool auto_start_sink_streams; @@ -467,7 +467,7 @@ static struct bt_bap_stream *unicast_stream_alloc(void) static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir); @@ -493,7 +493,7 @@ static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *e static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Reconfig: stream %p\n", stream); @@ -508,7 +508,7 @@ static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_d return -ENOEXEC; } -static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { printk("QoS: stream %p qos %p\n", stream, qos); diff --git a/tests/bsim/bluetooth/audio/src/cap_initiator_broadcast_test.c b/tests/bsim/bluetooth/audio/src/cap_initiator_broadcast_test.c index d13a8a637068aae..491c64b9e3c3f4c 100644 --- a/tests/bsim/bluetooth/audio/src/cap_initiator_broadcast_test.c +++ b/tests/bsim/bluetooth/audio/src/cap_initiator_broadcast_test.c @@ -703,7 +703,7 @@ static int test_cap_initiator_ac(const struct cap_initiator_ac_param *param) struct bt_cap_initiator_broadcast_create_param create_param = {0}; struct bt_cap_broadcast_source *broadcast_source; struct bt_audio_codec_cfg codec_cfg; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; struct bt_le_ext_adv *adv; int err; diff --git a/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c b/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c index 7dfbc379e699e1a..cb883f18426662e 100644 --- a/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c +++ b/tests/bsim/bluetooth/audio/src/cap_initiator_unicast_test.c @@ -129,7 +129,7 @@ static const struct named_lc3_preset lc3_unicast_presets[] = { }; static void unicast_stream_configured(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) + const struct bt_bap_qos_cfg_pref *pref) { struct bt_cap_stream *cap_stream = cap_stream_from_bap_stream(stream); printk("Configured stream %p\n", stream); @@ -1004,8 +1004,8 @@ static int cap_initiator_ac_create_unicast_group(const struct cap_initiator_ac_p struct bt_bap_unicast_group_stream_param src_group_stream_params[CAP_AC_MAX_SRC] = {0}; struct bt_bap_unicast_group_stream_pair_param pair_params[CAP_AC_MAX_PAIR] = {0}; struct bt_bap_unicast_group_param group_param = {0}; - struct bt_audio_codec_qos *snk_qos[CAP_AC_MAX_SNK]; - struct bt_audio_codec_qos *src_qos[CAP_AC_MAX_SRC]; + struct bt_bap_qos_cfg *snk_qos[CAP_AC_MAX_SNK]; + struct bt_bap_qos_cfg *src_qos[CAP_AC_MAX_SRC]; size_t snk_stream_cnt = 0U; size_t src_stream_cnt = 0U; size_t pair_cnt = 0U; diff --git a/tests/bsim/bluetooth/audio/src/gmap_ugg_test.c b/tests/bsim/bluetooth/audio/src/gmap_ugg_test.c index 2bb93d630f28b50..0896e5ce27b82df 100644 --- a/tests/bsim/bluetooth/audio/src/gmap_ugg_test.c +++ b/tests/bsim/bluetooth/audio/src/gmap_ugg_test.c @@ -225,7 +225,7 @@ static void stream_sent_cb(struct bt_bap_stream *bap_stream) } static void stream_configured_cb(struct bt_bap_stream *stream, - const struct bt_audio_codec_qos_pref *pref) + const struct bt_bap_qos_cfg_pref *pref) { printk("Configured stream %p\n", stream); @@ -1201,7 +1201,7 @@ static int test_gmap_ugg_broadcast_ac(const struct gmap_broadcast_ac_param *para stream_params[GMAP_BROADCAST_AC_MAX_STREAM] = {0}; struct bt_cap_broadcast_source *broadcast_source; struct bt_audio_codec_cfg codec_cfg; - struct bt_audio_codec_qos qos; + struct bt_bap_qos_cfg qos; struct bt_le_ext_adv *adv; int err; diff --git a/tests/bsim/bluetooth/audio/src/gmap_ugt_test.c b/tests/bsim/bluetooth/audio/src/gmap_ugt_test.c index 4ac3c1cfe0e869e..a67321dd0856843 100644 --- a/tests/bsim/bluetooth/audio/src/gmap_ugt_test.c +++ b/tests/bsim/bluetooth/audio/src/gmap_ugt_test.c @@ -42,8 +42,8 @@ static struct bt_audio_codec_cap codec_cap = BT_AUDIO_CODEC_CAP_LC3(BT_AUDIO_CODEC_CAP_FREQ_ANY, BT_AUDIO_CODEC_CAP_DURATION_ANY, BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(1, 2), 30, 240, 2, CONTEXT); -static const struct bt_audio_codec_qos_pref unicast_qos_pref = - BT_AUDIO_CODEC_QOS_PREF(true, BT_GAP_LE_PHY_2M, 0U, 60U, 10000U, 60000U, 10000U, 60000U); +static const struct bt_bap_qos_cfg_pref unicast_qos_pref = + BT_BAP_QOS_CFG_PREF(true, BT_GAP_LE_PHY_2M, 0U, 60U, 10000U, 60000U, 10000U, 60000U); #define UNICAST_CHANNEL_COUNT_1 BIT(0) @@ -112,7 +112,7 @@ static struct bt_bap_stream *unicast_stream_alloc(void) static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Config: conn %p ep %p dir %u\n", conn, ep, dir); @@ -136,7 +136,7 @@ static int unicast_server_config(struct bt_conn *conn, const struct bt_bap_ep *e static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, - struct bt_audio_codec_qos_pref *const pref, + struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp) { printk("ASE Codec Reconfig: stream %p\n", stream); @@ -151,7 +151,7 @@ static int unicast_server_reconfig(struct bt_bap_stream *stream, enum bt_audio_d return -ENOEXEC; } -static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_audio_codec_qos *qos, +static int unicast_server_qos(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp) { printk("QoS: stream %p qos %p\n", stream, qos);