hci: support de-init

This commit is contained in:
Matthias Ringwald 2021-01-08 17:32:38 +01:00
parent 3a2e210743
commit 4688f21608
2 changed files with 15 additions and 0 deletions

View File

@ -3124,6 +3124,16 @@ void hci_init(const hci_transport_t *transport, const void *config){
hci_state_reset();
}
void hci_deinit(void){
#ifdef HAVE_MALLOC
if (hci_stack) {
free(hci_stack);
}
#endif
hci_stack = NULL;
disable_l2cap_timeouts = 0;
}
/**
* @brief Configure Bluetooth chipset driver. Has to be called before power on, or right after receiving the local version information
*/

View File

@ -1311,6 +1311,11 @@ uint8_t hci_get_allow_role_switch(void);
*/
HCI_STATE hci_get_state(void);
/**
* @brief De-Init HCI
*/
void hci_deinit(void);
// setup test connections, used for fuzzing
void hci_setup_test_connections_fuzz(void);