mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
add HACK to deal with duplicate HCI Reset Complete events seen on cheapo CSR8510 A10 USB Dongle
This commit is contained in:
parent
24139500d2
commit
dc277fca3b
13
src/hci.c
13
src/hci.c
@ -581,7 +581,7 @@ static void event_handler(uint8_t *packet, int size){
|
||||
// get num cmd packets
|
||||
// log_info("HCI_EVENT_COMMAND_COMPLETE cmds old %u - new %u\n", hci_stack->num_cmd_packets, packet[2]);
|
||||
hci_stack->num_cmd_packets = packet[2];
|
||||
|
||||
|
||||
if (COMMAND_COMPLETE_EVENT(packet, hci_read_buffer_size)){
|
||||
// from offset 5
|
||||
// status
|
||||
@ -960,6 +960,17 @@ static void event_handler(uint8_t *packet, int size){
|
||||
hci_stack->substate++;
|
||||
}
|
||||
}
|
||||
|
||||
// HACK to deal with duplicate HCI Reset Complete events seen on cheapo CSR8510 A10 USB Dongle
|
||||
if (COMMAND_COMPLETE_EVENT(packet, hci_reset)){
|
||||
if (hci_stack->state == HCI_STATE_INITIALIZING) {
|
||||
if (hci_stack->config == 0 || ((hci_uart_config_t *)hci_stack->config)->baudrate_main == 0){
|
||||
hci_stack->substate = 6; // >> 1 = 3
|
||||
} else {
|
||||
hci_stack->substate = 2; // >> 1 = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user