From: Arkadiusz Bokowy Date: Tue, 19 Sep 2023 16:27:45 +0000 (+0200) Subject: hciemu: Call btdev_receive_h4 unconditionally X-Git-Tag: accepted/tizen/unified/20240117.163238~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=804702e87b145b4e0655f8a4a95529580cfc845d;p=platform%2Fupstream%2Fbluez.git hciemu: Call btdev_receive_h4 unconditionally 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 --- diff --git a/emulator/hciemu.c b/emulator/hciemu.c index b9b98fb..14377f8 100755 --- a/emulator/hciemu.c +++ b/emulator/hciemu.c @@ -189,14 +189,7 @@ static gboolean receive_btdev(GIOChannel *channel, GIOCondition condition, 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; } diff --git a/emulator/vhci.c b/emulator/vhci.c index c6a5caa..7b36300 100755 --- a/emulator/vhci.c +++ b/emulator/vhci.c @@ -74,14 +74,7 @@ static bool vhci_read_callback(struct io *io, void *user_data) 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; }