BLE Host - Don't abort reset if HCI restart fails.

While the host is resetting, it attempts to restart the HCI transport.
This may involve some communication with hardware.  For example, when
the UART transport resets, it closes, reopens, and reconfigures the
UART.

*** Old behavior:
If the HCI transport fails to restart due to a hardware failure, the
host aborts its reset.  As a consequence, stale connections remain open,
and the reset callback does not get called.

*** New behavior:
The host restarts the HCI transport and assumes success.  If the
transport failed to reset, the host will reset itself again when it
fails to sync with the controller.

X-Original-Commit: 11d1a9e5de17c792ce55402fbf19a4308825b015
This commit is contained in:
Christopher Collins
2017-08-23 16:21:10 -07:00
parent 96d8275df5
commit 29e7f82859
+5 -4
View File
@@ -275,10 +275,11 @@ ble_hs_reset(void)
ble_hs_sync_state = 0;
rc = ble_hci_trans_reset();
if (rc != 0) {
return rc;
}
/* Reset transport. Assume success; there is nothing we can do in case of
* failure. If the transport failed to reset, the host will reset itself
* again when it fails to sync with the controller.
*/
(void)ble_hci_trans_reset();
ble_hs_clear_data_queue(&ble_hs_tx_q);
ble_hs_clear_data_queue(&ble_hs_rx_q);