transport/usb: Drop events when not mounted

If controller sends events before USB transport is ready
event will be added to events queue but later interface
initialization will clear queue without sending notification
that event was sent to host.

This change drops events generated by controller (most likely first NOP)
if host is not connected yet.
This commit is contained in:
Jerzy Kasenberg
2021-11-22 08:50:45 +01:00
committed by kasjer
parent 3ac5007168
commit 57eb4237ae
+5
View File
@@ -285,6 +285,11 @@ ble_hci_trans_ll_evt_tx(uint8_t *hci_ev)
assert(hci_ev != NULL);
if (!tud_ready()) {
ble_hci_trans_buf_free(hci_ev);
return 0;
}
pkt = os_memblock_get(&ble_hci_pkt_pool);
if (pkt == NULL) {
ble_hci_trans_buf_free(hci_ev);