Diff between 9b96ebec6fe53b77fa554e87edfbab73f8281fcb and 990699816862b77271d6eb8bc7a0fcb9e4e662bd

Changed Files

File Additions Deletions Status
emulator/bthost.c +14 -0 modified

Full Patch

diff --git a/emulator/bthost.c b/emulator/bthost.c
index 312eb29..071794d 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -303,6 +303,17 @@ static void process_evt(struct bthost *bthost, const void *data, uint16_t len)
 	}
 }
 
+static void process_acl(struct bthost *bthost, const void *data, uint16_t len)
+{
+	const struct bt_l2cap_hdr *hdr = data;
+
+	if (len < sizeof(*hdr))
+		return;
+
+	if (len != sizeof(*hdr) + hdr->len)
+		return;
+}
+
 void bthost_receive_h4(struct bthost *bthost, const void *data, uint16_t len)
 {
 	uint8_t pkt_type;
@@ -319,6 +330,9 @@ void bthost_receive_h4(struct bthost *bthost, const void *data, uint16_t len)
 	case BT_H4_EVT_PKT:
 		process_evt(bthost, data + 1, len - 1);
 		break;
+	case BT_H4_ACL_PKT:
+		process_acl(bthost, data + 1, len - 1);
+		break;
 	default:
 		printf("Unsupported packet 0x%2.2x\n", pkt_type);
 		break;