Calling btdev_receive_h4 without prior logic will allow this function
to print some debug logs. E.g.: in case when the received packet type
is not supported.
> Bluetooth emulator ver 5.66
> vhci0: > ff 00 01 00 ....
> vhci0: Unsupported packet 0xff
if (len < 1)
return FALSE;
- switch (buf[0]) {
- case BT_H4_CMD_PKT:
- case BT_H4_ACL_PKT:
- case BT_H4_SCO_PKT:
- case BT_H4_ISO_PKT:
- btdev_receive_h4(btdev, buf, len);
- break;
- }
+ btdev_receive_h4(btdev, buf, len);
return TRUE;
}
if (len < 1)
return false;
- switch (buf[0]) {
- case BT_H4_CMD_PKT:
- case BT_H4_ACL_PKT:
- case BT_H4_SCO_PKT:
- case BT_H4_ISO_PKT:
- btdev_receive_h4(vhci->btdev, buf, len);
- break;
- }
+ btdev_receive_h4(vhci->btdev, buf, len);
return true;
}