From 6412c070eb4b427adf2ce5db82a3014f24d80486 Mon Sep 17 00:00:00 2001 From: ZhongYao Luo Date: Tue, 3 Dec 2019 17:45:47 +0800 Subject: [PATCH] bluetooth: h5: sending priority events through bt_recv_pri By default all events are processed through bt_recv, which results in lost events and subsys/bluetooth/hci_core.c:hci_event function assertions fail to pass Signed-off-by: ZhongYao Luo --- drivers/bluetooth/hci/h5.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/bluetooth/hci/h5.c b/drivers/bluetooth/hci/h5.c index bab17b87c28..082a00344e4 100644 --- a/drivers/bluetooth/hci/h5.c +++ b/drivers/bluetooth/hci/h5.c @@ -397,6 +397,12 @@ static void h5_process_complete_packet(u8_t *hdr) net_buf_put(&h5.rx_queue, buf); break; case HCI_EVENT_PKT: + if (buf->len > sizeof(struct bt_hci_evt_hdr) && + bt_hci_evt_is_prio(((struct bt_hci_evt_hdr *)buf->data)->evt)) { + hexdump("=> ", buf->data, buf->len); + bt_recv_prio(buf); + break; + } case HCI_ACLDATA_PKT: hexdump("=> ", buf->data, buf->len); bt_recv(buf);