bt_status_t btif_enable_bluetooth(void) { BTIF_TRACE_DEBUG0("BTIF ENABLE BLUETOOTH"); if (btif_core_state != BTIF_CORE_STATE_DISABLED) { ALOGD("not disabled\n"); return BT_STATUS_DONE; } btif_core_state = BTIF_CORE_STATE_ENABLING; /* Create the GKI tasks and run them */ bte_main_enable(btif_local_bd_addr.address); return BT_STATUS_SUCCESS; }
/****************************************************************************** ** ** Function bte_main_boot_entry ** ** Description BTE MAIN API - Entry point for BTE chip/stack initialization ** ** Returns None ** ******************************************************************************/ int bte_main_boot_entry(bluedroid_init_done_cb_t cb) { hci = hci_layer_get_interface(); if (!hci) { APPL_TRACE_ERROR("%s could not get hci layer interface.\n", __func__); return -2; } bluedroid_init_done_cb = cb; osi_init(); //Enbale HCI bte_main_enable(); return 0; }
/****************************************************************************** ** ** Function bte_main_boot_entry ** ** Description BTE MAIN API - Entry point for BTE chip/stack initialization ** ** Returns None ** ******************************************************************************/ int bte_main_boot_entry(bluedroid_init_done_cb_t cb) { #ifdef CONFIG_BLUEDROID_MEM_DEBUG osi_mem_dbg_init(); #endif if (gki_init()) { LOG_ERROR("%s: Init GKI Module Failure.\n", __func__); return -1; } hci = hci_layer_get_interface(); if (!hci) { LOG_ERROR("%s could not get hci layer interface.\n", __func__); return -2; } btu_hci_msg_queue = fixed_queue_new(SIZE_MAX); if (btu_hci_msg_queue == NULL) { LOG_ERROR("%s unable to allocate hci message queue.\n", __func__); return -3; } bluedroid_init_done_cb = cb; //Caution: No event dispatcher defined now in hci layer //data_dispatcher_register_default(hci->event_dispatcher, btu_hci_msg_queue); hci->set_data_queue(btu_hci_msg_queue); #if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE)) //bte_load_ble_conf(BTE_BLE_STACK_CONF_FILE); #endif //Enbale HCI bte_main_enable(); return 0; }