From 0b36101d4245fe9e3b98856305fcfa2a6bf7b193 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 20 Feb 2018 09:28:06 +0100 Subject: [PATCH] hci: reset num_cmd_packets on vendor specific event for CSR controllers --- src/hci.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/hci.c b/src/hci.c index 208ff4b62..f960e2ae8 100644 --- a/src/hci.c +++ b/src/hci.c @@ -2293,7 +2293,18 @@ static void event_handler(uint8_t *packet, int size){ break; } break; -#endif +#endif + case HCI_EVENT_VENDOR_SPECIFIC: + // Vendor specific commands often create vendor specific event instead of num completed packets + // To avoid getting stuck as num_cmds_packets is zero, reset it to 1 for controllers with this behaviour + switch (hci_stack->manufacturer){ + case BLUETOOTH_COMPANY_ID_CAMBRIDGE_SILICON_RADIO: + hci_stack->num_cmd_packets = 1; + break; + default: + break; + } + break; default: break; }