From 9bc5a72f583c6851ec9fc0220c0d78730b07d92a Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 25 Jan 2021 22:41:17 +0100 Subject: [PATCH] btstack_crypto: clear wait for hci result flag, fixes power off if rand was used last --- src/btstack_crypto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/btstack_crypto.c b/src/btstack_crypto.c index 23327e009..49cbf3cf4 100644 --- a/src/btstack_crypto.c +++ b/src/btstack_crypto.c @@ -1085,7 +1085,6 @@ static void btstack_crypto_event_handler(uint8_t packet_type, uint16_t cid, uint 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 @@ -1102,7 +1101,7 @@ static void btstack_crypto_event_handler(uint8_t packet_type, uint16_t cid, uint #endif if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_le_rand)){ if (!btstack_crypto_wait_for_hci_result) return; - btstack_crypto_wait_for_hci_result = true; + btstack_crypto_wait_for_hci_result = false; btstack_crypto_handle_random_data(&packet[6], 8); } if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_read_local_supported_commands)){