mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-11 03:47:01 +00:00
crypto: fix lockup when stack is shutdown while waiting for result of HCI Command, e.g. LE Read Local P256 Public Key
This commit is contained in:
parent
beceedde07
commit
0c23bea1f5
@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
- Crypto: fix lockup when stack is shutdown while waiting for result of HCI Command, e.g. LE Read Local P256 Public Key
|
||||
|
||||
## Changes December 2018
|
||||
|
||||
### Changed
|
||||
- L2CAP: provide channel mode (basic/ertm) and fcs option in L2CAP_EVENT_CHANNEL_OPENED
|
||||
- RFCOMM: support L2CAP ERTM. Callbacks passed to rfcomm_enable_l2cap_ertm() are used to manage ERTM buffers
|
||||
|
@ -944,6 +944,14 @@ static void btstack_crypto_event_handler(uint8_t packet_type, uint16_t cid, uint
|
||||
if (packet_type != HCI_EVENT_PACKET) return;
|
||||
|
||||
switch (hci_event_packet_get_type(packet)){
|
||||
case BTSTACK_EVENT_STATE:
|
||||
log_info("BTSTACK_EVENT_STATE");
|
||||
if (btstack_event_state_get_state(packet) != HCI_STATE_HALTING) break;
|
||||
if (!btstack_crypto_wait_for_hci_result) break;
|
||||
// request stack to defer shutdown a bit
|
||||
hci_halting_defer();
|
||||
break;
|
||||
|
||||
case HCI_EVENT_COMMAND_COMPLETE:
|
||||
if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_le_encrypt)){
|
||||
if (hci_get_state() != HCI_STATE_WORKING) return;
|
||||
|
Loading…
Reference in New Issue
Block a user