diff options
Diffstat (limited to 'hci/src/hci_layer.c')
-rw-r--r-- | hci/src/hci_layer.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hci/src/hci_layer.c b/hci/src/hci_layer.c index 94e154eed..6a8050b4b 100644 --- a/hci/src/hci_layer.c +++ b/hci/src/hci_layer.c @@ -750,6 +750,20 @@ static waiting_command_t *get_waiting_command(command_opcode_t opcode) { node = list_next(node)) { waiting_command_t *wait_entry = list_node(node); + if (!wait_entry || wait_entry->opcode != opcode) + continue; + + list_remove(commands_pending_response, wait_entry); + + pthread_mutex_unlock(&commands_pending_response_lock); + return wait_entry; + } + // look for any command complete with improper VS Opcode + for (const list_node_t *node = list_begin(commands_pending_response); + node != list_end(commands_pending_response); + node = list_next(node)) { + waiting_command_t *wait_entry = list_node(node); + if (!wait_entry || wait_entry->opcode != opcode) { if(((wait_entry->opcode & HCI_GRP_VENDOR_SPECIFIC) == HCI_GRP_VENDOR_SPECIFIC) && ((opcode & HCI_GRP_VENDOR_SPECIFIC) == HCI_GRP_VENDOR_SPECIFIC)) { |