bluetooth: host: hci_core: fix num_handles assignment

Replaced `sys_cpu_to_le16(1)` with a direct `1` assignment to the
`cp->num_handles` (uint8_t) field to avoid truncation to `0x00` on
big-endian architectures.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This commit is contained in:
Pisit Sawangvonganan 2024-12-10 12:48:46 +07:00 committed by Benjamin Cabé
commit 0156a322b1

View file

@ -248,7 +248,7 @@ void bt_send_one_host_num_completed_packets(uint16_t handle)
BT_ASSERT_MSG(buf, "Unable to alloc for Host NCP");
cp = net_buf_add(buf, sizeof(*cp));
cp->num_handles = sys_cpu_to_le16(1);
cp->num_handles = 1;
hc = net_buf_add(buf, sizeof(*hc));
hc->handle = sys_cpu_to_le16(handle);