add HACK to deal with duplicate HCI Reset Complete events seen on cheapo CSR8510 A10 USB Dongle

This commit is contained in:
matthias.ringwald 2014-06-13 13:11:21 +00:00
parent 24139500d2
commit dc277fca3b

View File

@ -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
}
}
}
}
}