Skip to content

Commit 0552d32

Browse files
committed
samples: bluetooth: hci_uart: Fix command len calculation
Due to a historical error introduced during an hci_uart refactor, the get_len() function was using the wrong HCI H4 packet identifier for commands. Instead of using H4_CMD (0x01) it was trying to match BT_BUF_CMD (0x00). Signed-off-by: Carles Cufi <[email protected]>
1 parent 795d36f commit 0552d32

File tree

1 file changed

+1
-1
lines changed
  • samples/bluetooth/hci_uart/src

1 file changed

+1
-1
lines changed

samples/bluetooth/hci_uart/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static bool valid_type(uint8_t type)
7878
static uint32_t get_len(const uint8_t *hdr_buf, uint8_t type)
7979
{
8080
switch (type) {
81-
case BT_BUF_CMD:
81+
case H4_CMD:
8282
return ((const struct bt_hci_cmd_hdr *)hdr_buf)->param_len;
8383
case H4_ISO:
8484
return sys_le16_to_cpu(((const struct bt_hci_iso_data_hdr *)hdr_buf)->slen);

0 commit comments

Comments
 (0)