Skip to content

Commit ff7de52

Browse files
Thalleykartben
authored andcommitted
Bluetooth: BAP: Fix missing endian conversions for codec_cfgs
Adds a few missing endian conversions when handling codec_cfgs. Signed-off-by: Emil Gydesen <[email protected]>
1 parent dc31254 commit ff7de52

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

subsys/bluetooth/audio/ascs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,8 +1548,8 @@ static int ase_config(struct bt_ascs_ase *ase, const struct bt_ascs_config *cfg)
15481548

15491549
LOG_DBG("ase %p latency 0x%02x phy 0x%02x codec 0x%02x "
15501550
"cid 0x%04x vid 0x%04x codec config len 0x%02x",
1551-
ase, cfg->latency, cfg->phy, cfg->codec.id, cfg->codec.cid, cfg->codec.vid,
1552-
cfg->cc_len);
1551+
ase, cfg->latency, cfg->phy, cfg->codec.id, sys_le16_to_cpu(cfg->codec.cid),
1552+
sys_le16_to_cpu(cfg->codec.vid), cfg->cc_len);
15531553

15541554
if (!IN_RANGE(cfg->latency, BT_ASCS_CONFIG_LATENCY_LOW, BT_ASCS_CONFIG_LATENCY_HIGH)) {
15551555
LOG_WRN("Invalid latency: 0x%02x", cfg->latency);

subsys/bluetooth/audio/bap_unicast_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,8 +1940,8 @@ static int unicast_client_ep_config(struct bt_bap_ep *ep, struct net_buf_simple
19401940
req->latency = codec_cfg->target_latency;
19411941
req->phy = codec_cfg->target_phy;
19421942
req->codec.id = codec_cfg->id;
1943-
req->codec.cid = codec_cfg->cid;
1944-
req->codec.vid = codec_cfg->vid;
1943+
req->codec.cid = sys_cpu_to_le16(codec_cfg->cid);
1944+
req->codec.vid = sys_cpu_to_le16(codec_cfg->vid);
19451945

19461946
req->cc_len = codec_cfg->data_len;
19471947
net_buf_simple_add_mem(buf, codec_cfg->data, codec_cfg->data_len);

0 commit comments

Comments
 (0)