void BTU_ShutDown(void) { #if BTU_DYNAMIC_MEMORY FREE_AND_RESET(btu_cb_ptr); #endif btu_task_shut_down(); hash_map_free(btu_general_alarm_hash_map); osi_mutex_free(&btu_general_alarm_lock); hash_map_free(btu_oneshot_alarm_hash_map); osi_mutex_free(&btu_oneshot_alarm_lock); hash_map_free(btu_l2cap_alarm_hash_map); osi_mutex_free(&btu_l2cap_alarm_lock); vTaskDelete(xBtuTaskHandle); vQueueDelete(xBtuQueue); btu_general_alarm_hash_map = NULL; btu_oneshot_alarm_hash_map = NULL; btu_l2cap_alarm_hash_map = NULL; xBtuTaskHandle = NULL; xBtuQueue = 0; }
bool btc_config_init(void) { osi_mutex_new(&lock); config = config_new(CONFIG_FILE_PATH); if (!config) { LOG_WARN("%s unable to load config file; starting unconfigured.\n", __func__); config = config_new_empty(); if (!config) { LOG_ERROR("%s unable to allocate a config object.\n", __func__); goto error; } } if (config_save(config, CONFIG_FILE_PATH)) { // unlink(LEGACY_CONFIG_FILE_PATH); } return true; error:; config_free(config); osi_mutex_free(&lock); config = NULL; LOG_ERROR("%s failed\n", __func__); return false; }
bool btc_config_clean_up(void) { btc_config_flush(); config_free(config); osi_mutex_free(&lock); config = NULL; return true; }
static void hci_layer_deinit_env(void) { command_waiting_response_t *cmd_wait_q; if (hci_host_env.command_queue) { fixed_queue_free(hci_host_env.command_queue, osi_free_func); } if (hci_host_env.packet_queue) { fixed_queue_free(hci_host_env.packet_queue, osi_free_func); } cmd_wait_q = &hci_host_env.cmd_waiting_q; list_free(cmd_wait_q->commands_pending_response); osi_mutex_free(&cmd_wait_q->commands_pending_response_lock); osi_alarm_free(cmd_wait_q->command_response_timer); cmd_wait_q->command_response_timer = NULL; }