Bluetooth: Audio: Remove hardcoded location and context for LC3 macros

The BT_CODEC_LC3_CONFIG_* macros had a hardcoded location
and context, which makes them a lot less usable.

Updates the macro, and the macros that used them.
This also removes the BT_CODEC_LC3_CONFIG and instead
just uses the BT_CODEC_LC3_CONFIG_N macro, which has
then been renamed to BT_CODEC_LC3_CONFIG.

As an addition, the macros and their input has
also been better documented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-04-11 15:04:34 +02:00 committed by Carles Cufí
parent 573f34317c
commit c5fc32756a
8 changed files with 717 additions and 263 deletions

View file

@ -409,404 +409,795 @@ struct bt_audio_lc3_preset {
}
/* LC3 Unicast presets defined by table 5.2 in the BAP v1.0 specification */
#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_8_1_1
* @brief Helper to declare LC3 Unicast 8_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_1, \
BT_CODEC_LC3_CONFIG_8_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 2u, 8u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_8_2_1
* @brief Helper to declare LC3 Unicast 8_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_2, \
BT_CODEC_LC3_CONFIG_8_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_16_1_1
* @brief Helper to declare LC3 Unicast 16_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_1, \
BT_CODEC_LC3_CONFIG_16_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 2u, 8u, 40000u) \
)
/** Mandatory to support as both unicast client and server */
#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_16_2_1
* @brief Helper to declare LC3 Unicast 16_2_1 codec configuration
*
* Mandatory to support as both unicast client and server
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_2, \
BT_CODEC_LC3_CONFIG_16_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_24_1_1
* @brief Helper to declare LC3 Unicast 24_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_1, \
BT_CODEC_LC3_CONFIG_24_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 2u, 8u, 40000u) \
)
/** Mandatory to support as unicast server */
#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_24_2_1
* @brief Helper to declare LC3 Unicast 24_2_1 codec configuration
*
* Mandatory to support as unicast server
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_2, \
BT_CODEC_LC3_CONFIG_24_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_32_1_1
* @brief Helper to declare LC3 Unicast 32_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_1, \
BT_CODEC_LC3_CONFIG_32_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 2u, 8u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_32_2_1
* @brief Helper to declare LC3 Unicast 32_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_2, \
BT_CODEC_LC3_CONFIG_32_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_441_1_1
* @brief Helper to declare LC3 Unicast 441_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_1, \
BT_CODEC_LC3_CONFIG_441_1(_loc, _stream_context), \
BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 97u, 5u, 24u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_441_2_1
* @brief Helper to declare LC3 Unicast 441_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_2, \
BT_CODEC_LC3_CONFIG_441_2(_loc, _stream_context), \
BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 130u, 5u, 31u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_1_1
* @brief Helper to declare LC3 Unicast 48_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_1, \
BT_CODEC_LC3_CONFIG_48_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 5u, 15u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_2_1
* @brief Helper to declare LC3 Unicast 48_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_2, \
BT_CODEC_LC3_CONFIG_48_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 5u, 20u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_3_1
* @brief Helper to declare LC3 Unicast 48_3_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_3, \
BT_CODEC_LC3_CONFIG_48_3(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 5u, 15u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_4_1
* @brief Helper to declare LC3 Unicast 48_4_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_4, \
BT_CODEC_LC3_CONFIG_48_4(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 5u, 20u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_5_1
* @brief Helper to declare LC3 Unicast 8_5_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_5, \
BT_CODEC_LC3_CONFIG_48_5(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 5u, 15u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_1 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_6_1
* @brief Helper to declare LC3 Unicast 48_6_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_6, \
BT_CODEC_LC3_CONFIG_48_6(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 5u, 20u, 40000u) \
)
/** @def BT_AUDIO_LC3_UNICAST_PRESET_8_1_2
* @brief Helper to declare LC3 Unicast 8_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
/* Following presets are for unicast high reliability audio data */
#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_2 \
#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_1, \
BT_CODEC_LC3_CONFIG_8_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 13u, 75u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_8_2_2
* @brief Helper to declare LC3 Unicast 8_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_2, \
BT_CODEC_LC3_CONFIG_8_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 13u, 95u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_16_1_2
* @brief Helper to declare LC3 Unicast 16_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_1, \
BT_CODEC_LC3_CONFIG_16_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 13u, 75u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_16_2_2
* @brief Helper to declare LC3 Unicast 16_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_2, \
BT_CODEC_LC3_CONFIG_16_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 13u, 95u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_24_1_2
* @brief Helper to declare LC3 Unicast 24_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_1, \
BT_CODEC_LC3_CONFIG_24_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 13u, 75u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_24_2_2
* @brief Helper to declare LC3 Unicast 24_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_2, \
BT_CODEC_LC3_CONFIG_24_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 13u, 95u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_32_1_2
* @brief Helper to declare LC3 Unicast 32_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_1, \
BT_CODEC_LC3_CONFIG_32_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 13u, 75u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_32_2_2
* @brief Helper to declare LC3 Unicast 32_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_2, \
BT_CODEC_LC3_CONFIG_32_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 13u, 95u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_441_1_2
* @brief Helper to declare LC3 Unicast 441_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_1, \
BT_CODEC_LC3_CONFIG_441_1(_loc, _stream_context), \
BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 97u, 13u, 80u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_441_2_2
* @brief Helper to declare LC3 Unicast 441_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_2, \
BT_CODEC_LC3_CONFIG_441_2(_loc, _stream_context), \
BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 130u, 13u, 85u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_1_2
* @brief Helper to declare LC3 Unicast 48_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_1, \
BT_CODEC_LC3_CONFIG_48_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 13u, 75u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_2_2
* @brief Helper to declare LC3 Unicast 48_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_2, \
BT_CODEC_LC3_CONFIG_48_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 13u, 95u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_3_2
* @brief Helper to declare LC3 Unicast 48_3_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_3, \
BT_CODEC_LC3_CONFIG_48_3(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 13u, 75u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_4_2
* @brief Helper to declare LC3 Unicast 48_4_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_4, \
BT_CODEC_LC3_CONFIG_48_4(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 13u, 100u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_5_2
* @brief Helper to declare LC3 Unicast 48_5_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_5, \
BT_CODEC_LC3_CONFIG_48_5(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 13u, 75u, 40000u) \
)
#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_2 \
/** @def BT_AUDIO_LC3_UNICAST_PRESET_48_6_2
* @brief Helper to declare LC3 Unicast 48_6_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_6, \
BT_CODEC_LC3_CONFIG_48_6(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 13u, 100u, 40000u) \
)
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1
* @brief Helper to declare LC3 Broadcast 8_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
/* LC3 Broadcast presets defined by table 6.4 in the BAP v1.0 specification */
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1 \
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_1, \
BT_CODEC_LC3_CONFIG_8_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 2u, 8u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1
* @brief Helper to declare LC3 Broadcast 8_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_2, \
BT_CODEC_LC3_CONFIG_8_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1
* @brief Helper to declare LC3 Broadcast 16_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_1, \
BT_CODEC_LC3_CONFIG_16_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 2u, 8u, 40000u) \
)
/** Mandatory to support as both broadcast source and sink */
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1
* @brief Helper to declare LC3 Broadcast 16_2_1 codec configuration
*
* Mandatory to support as both broadcast source and sink
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_2, \
BT_CODEC_LC3_CONFIG_16_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1
* @brief Helper to declare LC3 Broadcast 24_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_1, \
BT_CODEC_LC3_CONFIG_24_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 2u, 8u, 40000u) \
)
/** Mandatory to support as broadcast sink */
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1
* @brief Helper to declare LC3 Broadcast 24_2_1 codec configuration
*
* Mandatory to support as broadcast sink
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_2, \
BT_CODEC_LC3_CONFIG_24_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1
* @brief Helper to declare LC3 Broadcast 32_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_1, \
BT_CODEC_LC3_CONFIG_32_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 2u, 8u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1
* @brief Helper to declare LC3 Broadcast 32_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_2, \
BT_CODEC_LC3_CONFIG_32_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 2u, 10u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1
* @brief Helper to declare LC3 Broadcast 441_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_1, \
BT_CODEC_LC3_CONFIG_441_1(_loc, _stream_context), \
BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 97u, 4u, 24u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1
* @brief Helper to declare LC3 Broadcast 441_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_2, \
BT_CODEC_LC3_CONFIG_441_2(_loc, _stream_context), \
BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 130u, 4u, 31u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1
* @brief Helper to declare LC3 Broadcast 48_1_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_1, \
BT_CODEC_LC3_CONFIG_48_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 4u, 15u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1
* @brief Helper to declare LC3 Broadcast 48_2_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_2, \
BT_CODEC_LC3_CONFIG_48_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 4u, 20u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1
* @brief Helper to declare LC3 Broadcast 48_3_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_3, \
BT_CODEC_LC3_CONFIG_48_3(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 4u, 15u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1
* @brief Helper to declare LC3 Broadcast 48_4_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_4, \
BT_CODEC_LC3_CONFIG_48_4(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 4u, 20u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1
* @brief Helper to declare LC3 Broadcast 48_5_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_5, \
BT_CODEC_LC3_CONFIG_48_5(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 4u, 15u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1
* @brief Helper to declare LC3 Broadcast 48_6_1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_6, \
BT_CODEC_LC3_CONFIG_48_6(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 4u, 20u, 40000u) \
)
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2
* @brief Helper to declare LC3 Broadcast 8_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
/* Following presets are for broadcast high reliability audio data */
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2 \
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_1, \
BT_CODEC_LC3_CONFIG_8_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 4u, 45u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2
* @brief Helper to declare LC3 Broadcast 8_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_8_2, \
BT_CODEC_LC3_CONFIG_8_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(30u, 4u, 60u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2
* @brief Helper to declare LC3 Broadcast 16_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_1, \
BT_CODEC_LC3_CONFIG_16_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 4u, 45u, 40000u) \
)
/** Mandatory to support as both broadcast source and sink */
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2
* @brief Helper to declare LC3 Broadcast 16_2_2 codec configuration
*
* Mandatory to support as both broadcast source and sink
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_16_2, \
BT_CODEC_LC3_CONFIG_16_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 4u, 60u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2
* @brief Helper to declare LC3 Broadcast 24_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_1, \
BT_CODEC_LC3_CONFIG_24_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 4u, 45u, 40000u) \
)
/** Mandatory to support as broadcast sink */
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2
* @brief Helper to declare LC3 Broadcast 24_2_2 codec configuration
*
* Mandatory to support as broadcast sink
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_24_2, \
BT_CODEC_LC3_CONFIG_24_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(60u, 4u, 60u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2
* @brief Helper to declare LC3 Broadcast 32_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_1, \
BT_CODEC_LC3_CONFIG_32_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 4u, 45u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2
* @brief Helper to declare LC3 Broadcast 32_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_32_2, \
BT_CODEC_LC3_CONFIG_32_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(80u, 4u, 60u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2
* @brief Helper to declare LC3 Broadcast 441_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_1, \
BT_CODEC_LC3_CONFIG_441_1(_loc, _stream_context), \
BT_CODEC_QOS(8163u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 97u, 4u, 54u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2
* @brief Helper to declare LC3 Broadcast 441_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_441_2, \
BT_CODEC_LC3_CONFIG_441_2(_loc, _stream_context), \
BT_CODEC_QOS(10884u, BT_CODEC_QOS_FRAMED, \
BT_CODEC_QOS_2M, 130u, 4u, 60u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2
* @brief Helper to declare LC3 Broadcast 48_1_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_1, \
BT_CODEC_LC3_CONFIG_48_1(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 4u, 50u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2
* @brief Helper to declare LC3 Broadcast 48_2_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_2, \
BT_CODEC_LC3_CONFIG_48_2(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 4u, 65u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2
* @brief Helper to declare LC3 Broadcast 48_3_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_3, \
BT_CODEC_LC3_CONFIG_48_3(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 4u, 50u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2
* @brief Helper to declare LC3 Broadcast 48_4_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_4, \
BT_CODEC_LC3_CONFIG_48_4(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(120u, 4u, 65u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2
* @brief Helper to declare LC3 Broadcast 48_5_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_5, \
BT_CODEC_LC3_CONFIG_48_5(_loc, _stream_context), \
BT_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 4u, 50u, 40000u) \
)
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2 \
/** @def BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2
* @brief Helper to declare LC3 Broadcast 48_6_2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2(_loc, _stream_context) \
BT_AUDIO_LC3_PRESET( \
BT_CODEC_LC3_CONFIG_48_6, \
BT_CODEC_LC3_CONFIG_48_6(_loc, _stream_context), \
BT_CODEC_LC3_QOS_10_UNFRAMED(155u, 4u, 65u, 40000u) \
)

View file

@ -318,135 +318,183 @@ enum bt_codec_config_type {
BT_CODEC_DATA(BT_CODEC_META_CONTEXT, _stream_context, _stream_context >> 8), \
}
/** @def BT_CODEC_LC3_CONFIG_N
* @brief Helper to declare LC3 codec configuration for multiple channels.
/** @def BT_CODEC_LC3_CONFIG
* @brief Helper to declare LC3 codec configuration.
*
* @param _freq Sampling frequency (BT_CODEC_CONFIG_LC3_FREQ_*)
* @param _duration Frame duration (BT_CODEC_CONFIG_LC3_DURATION_*)
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _len Octets per frame (16-bit integer)
* @param _frames_per_sdu Frames per SDU (8-bit integer)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_N(_freq, _duration, _loc, _len, _frames_per_sdu, \
_stream_context) \
#define BT_CODEC_LC3_CONFIG(_freq, _duration, _loc, _len, _frames_per_sdu, \
_stream_context) \
BT_CODEC(BT_CODEC_LC3_ID, 0x0000, 0x0000, \
BT_CODEC_LC3_CONFIG_DATA(_freq, _duration, _loc, _len, _frames_per_sdu), \
BT_CODEC_LC3_CONFIG_META(_stream_context))
/** @def BT_CODEC_LC3_CONFIG
* @brief Helper to declare LC3 codec configuration for left location and one frame per sdu
*/
#define BT_CODEC_LC3_CONFIG(_freq, _duration, _len, _stream_context) \
BT_CODEC_LC3_CONFIG_N(_freq, _duration, BT_AUDIO_LOCATION_FRONT_LEFT, \
_len, 1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_8_1
* @brief Helper to declare LC3 8.1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_8_1 \
#define BT_CODEC_LC3_CONFIG_8_1(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_8KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 26u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 26u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_8_2
* @brief Helper to declare LC3 8.2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_8_2 \
#define BT_CODEC_LC3_CONFIG_8_2(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_8KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 30u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 30u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_16_1
* @brief Helper to declare LC3 16.1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_16_1 \
#define BT_CODEC_LC3_CONFIG_16_1(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_16KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 30u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 30u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_16_2
* @brief Helper to declare LC3 16.2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_16_2 \
#define BT_CODEC_LC3_CONFIG_16_2(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_16KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 40u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 40u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_24_1
* @brief Helper to declare LC3 24.1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_24_1 \
#define BT_CODEC_LC3_CONFIG_24_1(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_24KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 45u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 45u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_24_2
* @brief Helper to declare LC3 24.2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_24_2 \
#define BT_CODEC_LC3_CONFIG_24_2(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_24KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 60u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 60u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_32_1
* @brief Helper to declare LC3 32.1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_32_1 \
#define BT_CODEC_LC3_CONFIG_32_1(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_32KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 60u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 60u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_32_2
* @brief Helper to declare LC3 32.2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_32_2 \
#define BT_CODEC_LC3_CONFIG_32_2(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_32KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 80u, \
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 80u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_441_1
* @brief Helper to declare LC3 441.1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_441_1 \
#define BT_CODEC_LC3_CONFIG_441_1(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_44KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 98u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 98u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_441_2
* @brief Helper to declare LC3 441.2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_441_2 \
#define BT_CODEC_LC3_CONFIG_441_2(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_44KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 130u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 130u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_48_1
* @brief Helper to declare LC3 48.1 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_48_1 \
#define BT_CODEC_LC3_CONFIG_48_1(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 75u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 75u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_48_2
* @brief Helper to declare LC3 48.2 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_48_2 \
#define BT_CODEC_LC3_CONFIG_48_2(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 100u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 100u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_48_3
* @brief Helper to declare LC3 48.3 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_48_3 \
#define BT_CODEC_LC3_CONFIG_48_3(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 90u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 90u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_48_4
* @brief Helper to declare LC3 48.4 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_48_4 \
#define BT_CODEC_LC3_CONFIG_48_4(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 120u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 120u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_48_5
* @brief Helper to declare LC3 48.5 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_48_5 \
#define BT_CODEC_LC3_CONFIG_48_5(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_7_5, 117u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_7_5, _loc, 117u, \
1, _stream_context)
/** @def BT_CODEC_LC3_CONFIG_48_6
* @brief Helper to declare LC3 48.6 codec configuration
*
* @param _loc Audio channel location bitfield (@ref bt_audio_location)
* @param _stream_context Stream context (BT_AUDIO_CONTEXT_*)
*/
#define BT_CODEC_LC3_CONFIG_48_6 \
#define BT_CODEC_LC3_CONFIG_48_6(_loc, _stream_context) \
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
BT_CODEC_CONFIG_LC3_DURATION_10, 155u, \
BT_AUDIO_CONTEXT_TYPE_MEDIA)
BT_CODEC_CONFIG_LC3_DURATION_10, _loc, 155u, \
1, _stream_context)
/** @def BT_CODEC_LC3_QOS_7_5
* @brief Helper to declare LC3 codec QoS for 7.5ms interval
*/

View file

@ -18,7 +18,9 @@ static struct bt_audio_broadcast_sink *broadcast_sink;
static struct bt_audio_stream streams[CONFIG_BT_AUDIO_BROADCAST_SNK_STREAM_COUNT];
/* Mandatory support preset by both source and sink */
static struct bt_audio_lc3_preset preset_16_2_1 = BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1;
static struct bt_audio_lc3_preset preset_16_2_1 =
BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT,
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
/* Create a mask for the maximum BIS we can sync to using the number of streams
* we have. We add an additional 1 since the bis indexes start from 1 and not

View file

@ -17,7 +17,9 @@ BUILD_ASSERT(CONFIG_BT_ISO_TX_BUF_COUNT >= TOTAL_BUF_NEEDED,
"CONFIG_BT_ISO_TX_BUF_COUNT should be at least "
"BROADCAST_ENQUEUE_COUNT * CONFIG_BT_AUDIO_BROADCAST_SRC_STREAM_COUNT");
static struct bt_audio_lc3_preset preset_16_2_1 = BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1;
static struct bt_audio_lc3_preset preset_16_2_1 =
BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT,
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
static struct bt_audio_stream streams[CONFIG_BT_AUDIO_BROADCAST_SRC_STREAM_COUNT];
static struct bt_audio_broadcast_source *broadcast_source;

View file

@ -37,7 +37,9 @@ static size_t configured_stream_count;
* Allows this sample application to work without logic to parse the codec capabilities of the
* server and selection of an appropriate codec configuration.
*/
static struct bt_audio_lc3_preset codec_configuration = BT_AUDIO_LC3_UNICAST_PRESET_16_2_1;
static struct bt_audio_lc3_preset codec_configuration =
BT_AUDIO_LC3_UNICAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT,
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
static K_SEM_DEFINE(sem_connected, 0, 1);
static K_SEM_DEFINE(sem_mtu_exchanged, 0, 1);

View file

@ -25,6 +25,9 @@
#include "bt.h"
#define LOCATION BT_AUDIO_LOCATION_FRONT_LEFT
#define CONTEXT BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | BT_AUDIO_CONTEXT_TYPE_MEDIA
#if defined(CONFIG_BT_AUDIO_UNICAST)
#define MAX_PAC 2
static struct bt_audio_stream streams[MAX_PAC];
@ -54,75 +57,75 @@ struct named_lc3_preset {
};
static struct named_lc3_preset lc3_unicast_presets[] = {
{"8_1_1", BT_AUDIO_LC3_UNICAST_PRESET_8_1_1},
{"8_2_1", BT_AUDIO_LC3_UNICAST_PRESET_8_2_1},
{"16_1_1", BT_AUDIO_LC3_UNICAST_PRESET_16_1_1},
{"16_2_1", BT_AUDIO_LC3_UNICAST_PRESET_16_2_1},
{"24_1_1", BT_AUDIO_LC3_UNICAST_PRESET_24_1_1},
{"24_2_1", BT_AUDIO_LC3_UNICAST_PRESET_24_2_1},
{"32_1_1", BT_AUDIO_LC3_UNICAST_PRESET_32_1_1},
{"32_2_1", BT_AUDIO_LC3_UNICAST_PRESET_32_2_1},
{"441_1_1", BT_AUDIO_LC3_UNICAST_PRESET_441_1_1},
{"441_2_1", BT_AUDIO_LC3_UNICAST_PRESET_441_2_1},
{"48_1_1", BT_AUDIO_LC3_UNICAST_PRESET_48_1_1},
{"48_2_1", BT_AUDIO_LC3_UNICAST_PRESET_48_2_1},
{"48_3_1", BT_AUDIO_LC3_UNICAST_PRESET_48_3_1},
{"48_4_1", BT_AUDIO_LC3_UNICAST_PRESET_48_4_1},
{"48_5_1", BT_AUDIO_LC3_UNICAST_PRESET_48_5_1},
{"48_6_1", BT_AUDIO_LC3_UNICAST_PRESET_48_6_1},
{"8_1_1", BT_AUDIO_LC3_UNICAST_PRESET_8_1_1(LOCATION, CONTEXT)},
{"8_2_1", BT_AUDIO_LC3_UNICAST_PRESET_8_2_1(LOCATION, CONTEXT)},
{"16_1_1", BT_AUDIO_LC3_UNICAST_PRESET_16_1_1(LOCATION, CONTEXT)},
{"16_2_1", BT_AUDIO_LC3_UNICAST_PRESET_16_2_1(LOCATION, CONTEXT)},
{"24_1_1", BT_AUDIO_LC3_UNICAST_PRESET_24_1_1(LOCATION, CONTEXT)},
{"24_2_1", BT_AUDIO_LC3_UNICAST_PRESET_24_2_1(LOCATION, CONTEXT)},
{"32_1_1", BT_AUDIO_LC3_UNICAST_PRESET_32_1_1(LOCATION, CONTEXT)},
{"32_2_1", BT_AUDIO_LC3_UNICAST_PRESET_32_2_1(LOCATION, CONTEXT)},
{"441_1_1", BT_AUDIO_LC3_UNICAST_PRESET_441_1_1(LOCATION, CONTEXT)},
{"441_2_1", BT_AUDIO_LC3_UNICAST_PRESET_441_2_1(LOCATION, CONTEXT)},
{"48_1_1", BT_AUDIO_LC3_UNICAST_PRESET_48_1_1(LOCATION, CONTEXT)},
{"48_2_1", BT_AUDIO_LC3_UNICAST_PRESET_48_2_1(LOCATION, CONTEXT)},
{"48_3_1", BT_AUDIO_LC3_UNICAST_PRESET_48_3_1(LOCATION, CONTEXT)},
{"48_4_1", BT_AUDIO_LC3_UNICAST_PRESET_48_4_1(LOCATION, CONTEXT)},
{"48_5_1", BT_AUDIO_LC3_UNICAST_PRESET_48_5_1(LOCATION, CONTEXT)},
{"48_6_1", BT_AUDIO_LC3_UNICAST_PRESET_48_6_1(LOCATION, CONTEXT)},
/* High-reliability presets */
{"8_1_2", BT_AUDIO_LC3_UNICAST_PRESET_8_1_2},
{"8_2_2", BT_AUDIO_LC3_UNICAST_PRESET_8_2_2},
{"16_1_2", BT_AUDIO_LC3_UNICAST_PRESET_16_1_2},
{"16_2_2", BT_AUDIO_LC3_UNICAST_PRESET_16_2_2},
{"24_1_2", BT_AUDIO_LC3_UNICAST_PRESET_24_1_2},
{"24_2_2", BT_AUDIO_LC3_UNICAST_PRESET_24_2_2},
{"32_1_2", BT_AUDIO_LC3_UNICAST_PRESET_32_1_2},
{"32_2_2", BT_AUDIO_LC3_UNICAST_PRESET_32_2_2},
{"441_1_2", BT_AUDIO_LC3_UNICAST_PRESET_441_1_2},
{"441_2_2", BT_AUDIO_LC3_UNICAST_PRESET_441_2_2},
{"48_1_2", BT_AUDIO_LC3_UNICAST_PRESET_48_1_2},
{"48_2_2", BT_AUDIO_LC3_UNICAST_PRESET_48_2_2},
{"48_3_2", BT_AUDIO_LC3_UNICAST_PRESET_48_3_2},
{"48_4_2", BT_AUDIO_LC3_UNICAST_PRESET_48_4_2},
{"48_5_2", BT_AUDIO_LC3_UNICAST_PRESET_48_5_2},
{"48_6_2", BT_AUDIO_LC3_UNICAST_PRESET_48_6_2},
{"8_1_2", BT_AUDIO_LC3_UNICAST_PRESET_8_1_2(LOCATION, CONTEXT)},
{"8_2_2", BT_AUDIO_LC3_UNICAST_PRESET_8_2_2(LOCATION, CONTEXT)},
{"16_1_2", BT_AUDIO_LC3_UNICAST_PRESET_16_1_2(LOCATION, CONTEXT)},
{"16_2_2", BT_AUDIO_LC3_UNICAST_PRESET_16_2_2(LOCATION, CONTEXT)},
{"24_1_2", BT_AUDIO_LC3_UNICAST_PRESET_24_1_2(LOCATION, CONTEXT)},
{"24_2_2", BT_AUDIO_LC3_UNICAST_PRESET_24_2_2(LOCATION, CONTEXT)},
{"32_1_2", BT_AUDIO_LC3_UNICAST_PRESET_32_1_2(LOCATION, CONTEXT)},
{"32_2_2", BT_AUDIO_LC3_UNICAST_PRESET_32_2_2(LOCATION, CONTEXT)},
{"441_1_2", BT_AUDIO_LC3_UNICAST_PRESET_441_1_2(LOCATION, CONTEXT)},
{"441_2_2", BT_AUDIO_LC3_UNICAST_PRESET_441_2_2(LOCATION, CONTEXT)},
{"48_1_2", BT_AUDIO_LC3_UNICAST_PRESET_48_1_2(LOCATION, CONTEXT)},
{"48_2_2", BT_AUDIO_LC3_UNICAST_PRESET_48_2_2(LOCATION, CONTEXT)},
{"48_3_2", BT_AUDIO_LC3_UNICAST_PRESET_48_3_2(LOCATION, CONTEXT)},
{"48_4_2", BT_AUDIO_LC3_UNICAST_PRESET_48_4_2(LOCATION, CONTEXT)},
{"48_5_2", BT_AUDIO_LC3_UNICAST_PRESET_48_5_2(LOCATION, CONTEXT)},
{"48_6_2", BT_AUDIO_LC3_UNICAST_PRESET_48_6_2(LOCATION, CONTEXT)},
};
static struct named_lc3_preset lc3_broadcast_presets[] = {
{"8_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1},
{"8_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1},
{"16_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1},
{"16_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1},
{"24_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1},
{"24_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1},
{"32_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1},
{"32_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1},
{"441_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1},
{"441_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1},
{"48_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1},
{"48_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1},
{"48_3_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1},
{"48_4_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1},
{"48_5_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1},
{"48_6_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1},
{"8_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1(LOCATION, CONTEXT)},
{"8_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1(LOCATION, CONTEXT)},
{"16_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1(LOCATION, CONTEXT)},
{"16_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1(LOCATION, CONTEXT)},
{"24_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1(LOCATION, CONTEXT)},
{"24_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1(LOCATION, CONTEXT)},
{"32_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1(LOCATION, CONTEXT)},
{"32_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1(LOCATION, CONTEXT)},
{"441_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1(LOCATION, CONTEXT)},
{"441_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1(LOCATION, CONTEXT)},
{"48_1_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1(LOCATION, CONTEXT)},
{"48_2_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1(LOCATION, CONTEXT)},
{"48_3_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1(LOCATION, CONTEXT)},
{"48_4_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1(LOCATION, CONTEXT)},
{"48_5_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1(LOCATION, CONTEXT)},
{"48_6_1", BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1(LOCATION, CONTEXT)},
/* High-reliability presets */
{"8_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2},
{"8_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2},
{"16_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2},
{"16_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2},
{"24_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2},
{"24_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2},
{"32_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2},
{"32_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2},
{"441_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2},
{"441_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2},
{"48_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2},
{"48_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2},
{"48_3_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2},
{"48_4_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2},
{"48_5_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2},
{"48_6_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2},
{"8_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2(LOCATION, CONTEXT)},
{"8_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2(LOCATION, CONTEXT)},
{"16_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2(LOCATION, CONTEXT)},
{"16_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2(LOCATION, CONTEXT)},
{"24_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2(LOCATION, CONTEXT)},
{"24_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2(LOCATION, CONTEXT)},
{"32_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2(LOCATION, CONTEXT)},
{"32_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2(LOCATION, CONTEXT)},
{"441_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2(LOCATION, CONTEXT)},
{"441_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2(LOCATION, CONTEXT)},
{"48_1_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2(LOCATION, CONTEXT)},
{"48_2_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2(LOCATION, CONTEXT)},
{"48_3_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2(LOCATION, CONTEXT)},
{"48_4_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2(LOCATION, CONTEXT)},
{"48_5_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2(LOCATION, CONTEXT)},
{"48_6_2", BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2(LOCATION, CONTEXT)},
};
/* Default to 16_2_1 */

View file

@ -15,8 +15,12 @@ extern enum bst_result_t bst_result;
static void test_main(void)
{
int err;
struct bt_audio_lc3_preset preset_16_2_1 = BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1;
struct bt_audio_lc3_preset preset_16_2_2 = BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2;
struct bt_audio_lc3_preset preset_16_2_1 =
BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT,
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
struct bt_audio_lc3_preset preset_16_2_2 =
BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2(BT_AUDIO_LOCATION_FRONT_LEFT,
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
struct bt_audio_stream broadcast_source_streams[CONFIG_BT_AUDIO_BROADCAST_SRC_STREAM_COUNT];
struct bt_audio_stream *streams[ARRAY_SIZE(broadcast_source_streams)];
struct bt_audio_broadcast_source *source;

View file

@ -19,7 +19,9 @@ static struct bt_codec *g_remote_codecs[CONFIG_BT_AUDIO_UNICAST_CLIENT_PAC_COUNT
static struct bt_audio_ep *g_sinks[CONFIG_BT_AUDIO_UNICAST_CLIENT_ASE_SNK_COUNT];
/* Mandatory support preset by both client and server */
static struct bt_audio_lc3_preset preset_16_2_1 = BT_AUDIO_LC3_UNICAST_PRESET_16_2_1;
static struct bt_audio_lc3_preset preset_16_2_1 =
BT_AUDIO_LC3_UNICAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT,
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED);
CREATE_FLAG(flag_connected);
CREATE_FLAG(flag_mtu_exchanged);