Skip to content

Commit 2ec1a50

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: Audio: Fix enum mismatch for codec get chan alloc
The function bt_codec_cfg_get_chan_allocation_val takes a pointer to an enum, rather than an uint32_t, but was wrongly defined in the header files and incorrectly used a few places. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 8d24d50 commit 2ec1a50

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

include/zephyr/bluetooth/audio/audio.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ int bt_codec_cfg_get_frame_duration_us(const struct bt_codec *codec);
555555
* @return BT_AUDIO_CODEC_PARSE_SUCCESS if value is found and stored in the pointer provided
556556
* else a negative value of type @ref bt_audio_codec_parse_err.
557557
*/
558-
int bt_codec_cfg_get_chan_allocation_val(const struct bt_codec *codec, uint32_t *chan_allocation);
558+
int bt_codec_cfg_get_chan_allocation_val(const struct bt_codec *codec,
559+
enum bt_audio_location *chan_allocation);
559560

560561
/** @brief Extract frame size in octets from BT codec config
561562
*

samples/bluetooth/hap_ha/src/bap_unicast_sr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static void print_codec(const struct bt_codec *codec)
7777
if (codec->id == BT_CODEC_LC3_ID) {
7878
/* LC3 uses the generic LTV format - other codecs might do as well */
7979

80-
uint32_t chan_allocation;
80+
enum bt_audio_location chan_allocation;
8181

8282
printk(" Frequency: %d Hz\n", bt_codec_cfg_get_freq(codec));
8383
printk(" Frame Duration: %d us\n", bt_codec_cfg_get_frame_duration_us(codec));

samples/bluetooth/unicast_audio_server/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static void print_codec(const struct bt_codec *codec)
123123
if (codec->id == BT_CODEC_LC3_ID) {
124124
/* LC3 uses the generic LTV format - other codecs might do as well */
125125

126-
uint32_t chan_allocation;
126+
enum bt_audio_location chan_allocation;
127127

128128
printk(" Frequency: %d Hz\n", bt_codec_cfg_get_freq(codec));
129129
printk(" Frame Duration: %d us\n", bt_codec_cfg_get_frame_duration_us(codec));

tests/bluetooth/tester/src/btp_bap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void print_codec(const struct bt_codec *codec)
9191
if (codec->id == BT_CODEC_LC3_ID) {
9292
/* LC3 uses the generic LTV format - other codecs might do as well */
9393

94-
uint32_t chan_allocation;
94+
enum bt_audio_location chan_allocation;
9595

9696
LOG_DBG(" Frequency: %d Hz", bt_codec_cfg_get_freq(codec));
9797
LOG_DBG(" Frame Duration: %d us", bt_codec_cfg_get_frame_duration_us(codec));

0 commit comments

Comments
 (0)