Skip to content

Commit dc97bbd

Browse files
Thalleyfabiobaltieri
authored andcommitted
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 <[email protected]>
1 parent e1cacb3 commit dc97bbd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+531
-537
lines changed

doc/releases/migration-guide-4.0.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ Bluetooth Audio
317317
unregistered with :c:func:`bt_tbs_unregister_bearer`.
318318
(:github:`76108`)
319319

320+
* There has been a rename from ``bt_audio_codec_qos`` to ``bt_bap_qos_cfg``. This effects all
321+
structs, enums and defines that used the ``bt_audio_codec_qos`` name. To use the new naming simply
322+
do a search-and-replace for ``bt_audio_codec_qos`` to ``bt_bap_qos_cfg`` and
323+
``BT_AUDIO_CODEC_QOS`` to ``BT_BAP_QOS_CFG``. (:github:`76633`)
324+
320325
Bluetooth Classic
321326
=================
322327

include/zephyr/bluetooth/audio/audio.h

Lines changed: 0 additions & 255 deletions
Original file line numberDiff line numberDiff line change
@@ -790,261 +790,6 @@ enum bt_audio_dir {
790790
BT_AUDIO_DIR_SOURCE = 0x02,
791791
};
792792

793-
/**
794-
* @brief Helper to declare elements of bt_audio_codec_qos
795-
*
796-
* @param _interval SDU interval (usec)
797-
* @param _framing Framing
798-
* @param _phy Target PHY
799-
* @param _sdu Maximum SDU Size
800-
* @param _rtn Retransmission number
801-
* @param _latency Maximum Transport Latency (msec)
802-
* @param _pd Presentation Delay (usec)
803-
*/
804-
#define BT_AUDIO_CODEC_QOS(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd) \
805-
((struct bt_audio_codec_qos){ \
806-
.interval = _interval, \
807-
.framing = _framing, \
808-
.phy = _phy, \
809-
.sdu = _sdu, \
810-
.rtn = _rtn, \
811-
IF_ENABLED(UTIL_OR(IS_ENABLED(CONFIG_BT_BAP_BROADCAST_SOURCE), \
812-
IS_ENABLED(CONFIG_BT_BAP_UNICAST)), \
813-
(.latency = _latency,)) \
814-
.pd = _pd, \
815-
})
816-
817-
/** @brief Codec QoS Framing */
818-
enum bt_audio_codec_qos_framing {
819-
/** Packets may be framed or unframed */
820-
BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED = 0x00,
821-
/** Packets are always framed */
822-
BT_AUDIO_CODEC_QOS_FRAMING_FRAMED = 0x01,
823-
};
824-
825-
/** @brief Codec QoS Preferred PHY */
826-
enum {
827-
/** LE 1M PHY */
828-
BT_AUDIO_CODEC_QOS_1M = BIT(0),
829-
/** LE 2M PHY */
830-
BT_AUDIO_CODEC_QOS_2M = BIT(1),
831-
/** LE Coded PHY */
832-
BT_AUDIO_CODEC_QOS_CODED = BIT(2),
833-
};
834-
835-
/**
836-
* @brief Helper to declare Input Unframed bt_audio_codec_qos
837-
*
838-
* @param _interval SDU interval (usec)
839-
* @param _sdu Maximum SDU Size
840-
* @param _rtn Retransmission number
841-
* @param _latency Maximum Transport Latency (msec)
842-
* @param _pd Presentation Delay (usec)
843-
*/
844-
#define BT_AUDIO_CODEC_QOS_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd) \
845-
BT_AUDIO_CODEC_QOS(_interval, BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED, BT_AUDIO_CODEC_QOS_2M, \
846-
_sdu, _rtn, _latency, _pd)
847-
848-
/**
849-
* @brief Helper to declare Input Framed bt_audio_codec_qos
850-
*
851-
* @param _interval SDU interval (usec)
852-
* @param _sdu Maximum SDU Size
853-
* @param _rtn Retransmission number
854-
* @param _latency Maximum Transport Latency (msec)
855-
* @param _pd Presentation Delay (usec)
856-
*/
857-
#define BT_AUDIO_CODEC_QOS_FRAMED(_interval, _sdu, _rtn, _latency, _pd) \
858-
BT_AUDIO_CODEC_QOS(_interval, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED, BT_AUDIO_CODEC_QOS_2M, \
859-
_sdu, _rtn, _latency, _pd)
860-
861-
/** @brief Codec QoS structure. */
862-
struct bt_audio_codec_qos {
863-
/**
864-
* @brief Presentation Delay in microseconds
865-
*
866-
* This value can be changed up and until bt_bap_stream_qos() has been called.
867-
* Once a stream has been QoS configured, modifying this field does not modify the value.
868-
* It is however possible to modify this field and call bt_bap_stream_qos() again to update
869-
* the value, assuming that the stream is in the correct state.
870-
*
871-
* Value range 0 to @ref BT_AUDIO_PD_MAX.
872-
*/
873-
uint32_t pd;
874-
875-
/**
876-
* @brief Connected Isochronous Group (CIG) parameters
877-
*
878-
* The fields in this struct affect the value sent to the controller via HCI
879-
* when creating the CIG. Once the group has been created with
880-
* bt_bap_unicast_group_create(), modifying these fields will not affect the group.
881-
*/
882-
struct {
883-
/** QoS Framing */
884-
enum bt_audio_codec_qos_framing framing;
885-
886-
/**
887-
* @brief PHY
888-
*
889-
* Allowed values are @ref BT_AUDIO_CODEC_QOS_1M, @ref BT_AUDIO_CODEC_QOS_2M and
890-
* @ref BT_AUDIO_CODEC_QOS_CODED.
891-
*/
892-
uint8_t phy;
893-
894-
/**
895-
* @brief Retransmission Number
896-
*
897-
* This a recommendation to the controller, and the actual retransmission number
898-
* may be different than this.
899-
*/
900-
uint8_t rtn;
901-
902-
/**
903-
* @brief Maximum SDU size
904-
*
905-
* Value range @ref BT_ISO_MIN_SDU to @ref BT_ISO_MAX_SDU.
906-
*/
907-
uint16_t sdu;
908-
909-
#if defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || defined(CONFIG_BT_BAP_UNICAST) || \
910-
defined(__DOXYGEN__)
911-
/**
912-
* @brief Maximum Transport Latency
913-
*
914-
* Not used for the @kconfig{CONFIG_BT_BAP_BROADCAST_SINK} role.
915-
*/
916-
uint16_t latency;
917-
#endif /* CONFIG_BT_BAP_BROADCAST_SOURCE || CONFIG_BT_BAP_UNICAST */
918-
919-
/**
920-
* @brief SDU Interval
921-
*
922-
* Value range @ref BT_ISO_SDU_INTERVAL_MIN to @ref BT_ISO_SDU_INTERVAL_MAX
923-
*/
924-
uint32_t interval;
925-
926-
#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
927-
/**
928-
* @brief Maximum PDU size
929-
*
930-
* Maximum size, in octets, of the payload from link layer to link layer.
931-
*
932-
* Value range @ref BT_ISO_CONNECTED_PDU_MIN to @ref BT_ISO_PDU_MAX for
933-
* connected ISO.
934-
*
935-
* Value range @ref BT_ISO_BROADCAST_PDU_MIN to @ref BT_ISO_PDU_MAX for
936-
* broadcast ISO.
937-
*/
938-
uint16_t max_pdu;
939-
940-
/**
941-
* @brief Burst number
942-
*
943-
* Value range @ref BT_ISO_BN_MIN to @ref BT_ISO_BN_MAX.
944-
*/
945-
uint8_t burst_number;
946-
947-
/**
948-
* @brief Number of subevents
949-
*
950-
* Maximum number of subevents in each CIS or BIS event.
951-
*
952-
* Value range @ref BT_ISO_NSE_MIN to @ref BT_ISO_NSE_MAX.
953-
*/
954-
uint8_t num_subevents;
955-
#endif /* CONFIG_BT_ISO_TEST_PARAMS */
956-
};
957-
};
958-
959-
/**
960-
* @brief Helper to declare elements of @ref bt_audio_codec_qos_pref
961-
*
962-
* @param _unframed_supported Unframed PDUs supported
963-
* @param _phy Preferred Target PHY
964-
* @param _rtn Preferred Retransmission number
965-
* @param _latency Preferred Maximum Transport Latency (msec)
966-
* @param _pd_min Minimum Presentation Delay (usec)
967-
* @param _pd_max Maximum Presentation Delay (usec)
968-
* @param _pref_pd_min Preferred Minimum Presentation Delay (usec)
969-
* @param _pref_pd_max Preferred Maximum Presentation Delay (usec)
970-
*/
971-
#define BT_AUDIO_CODEC_QOS_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, _pd_max, \
972-
_pref_pd_min, _pref_pd_max) \
973-
{ \
974-
.unframed_supported = _unframed_supported, \
975-
.phy = _phy, \
976-
.rtn = _rtn, \
977-
.latency = _latency, \
978-
.pd_min = _pd_min, \
979-
.pd_max = _pd_max, \
980-
.pref_pd_min = _pref_pd_min, \
981-
.pref_pd_max = _pref_pd_max, \
982-
}
983-
984-
/** @brief Audio Stream Quality of Service Preference structure. */
985-
struct bt_audio_codec_qos_pref {
986-
/**
987-
* @brief Unframed PDUs supported
988-
*
989-
* Unlike the other fields, this is not a preference but whether
990-
* the codec supports unframed ISOAL PDUs.
991-
*/
992-
bool unframed_supported;
993-
994-
/**
995-
* @brief Preferred PHY bitfield
996-
*
997-
* Bitfield consisting of one or more of @ref BT_GAP_LE_PHY_1M, @ref BT_GAP_LE_PHY_2M and
998-
* @ref BT_GAP_LE_PHY_CODED.
999-
*/
1000-
uint8_t phy;
1001-
1002-
/** Preferred Retransmission Number */
1003-
uint8_t rtn;
1004-
1005-
/**
1006-
* Preferred Transport Latency
1007-
*
1008-
* Value range @ref BT_ISO_LATENCY_MIN to @ref BT_ISO_LATENCY_MAX
1009-
*/
1010-
uint16_t latency;
1011-
1012-
/**
1013-
* @brief Minimum Presentation Delay in microseconds
1014-
*
1015-
* Unlike the other fields, this is not a preference but a minimum requirement.
1016-
*
1017-
* Value range 0 to @ref BT_AUDIO_PD_MAX, or @ref BT_AUDIO_PD_PREF_NONE
1018-
* to indicate no preference.
1019-
*/
1020-
uint32_t pd_min;
1021-
1022-
/**
1023-
* @brief Maximum Presentation Delay
1024-
*
1025-
* Unlike the other fields, this is not a preference but a maximum requirement.
1026-
*
1027-
* Value range 0 to @ref BT_AUDIO_PD_MAX, or @ref BT_AUDIO_PD_PREF_NONE
1028-
* to indicate no preference.
1029-
*/
1030-
uint32_t pd_max;
1031-
1032-
/**
1033-
* @brief Preferred minimum Presentation Delay
1034-
*
1035-
* Value range @ref bt_audio_codec_qos_pref.pd_min to @ref bt_audio_codec_qos_pref.pd_max.
1036-
*/
1037-
uint32_t pref_pd_min;
1038-
1039-
/**
1040-
* @brief Preferred maximum Presentation Delay
1041-
*
1042-
* Value range @ref bt_audio_codec_qos_pref.pd_min to @ref bt_audio_codec_qos_pref.pd_max,
1043-
* and higher than @ref bt_audio_codec_qos_pref.pref_pd_min
1044-
*/
1045-
uint32_t pref_pd_max;
1046-
};
1047-
1048793
/**
1049794
* @brief Audio codec Config APIs
1050795
* @defgroup bt_audio_codec_cfg Codec config parsing APIs

0 commit comments

Comments
 (0)