標籤:enable 協議棧 cti workqueue col name tin ... 工作
在藍芽enable的過程中會進行多個線程的建立以及將線程與隊列進行綁定的工作。該篇文章主要分析一下處理hci資料這個 線程。
void BTU_StartUp(void){... btu_bta_msg_queue = fixed_queue_new(SIZE_MAX); btu_general_alarm_hash_map = hash_map_new(BTU_GENERAL_ALARM_HASH_MAP_SIZE, hash_function_pointer, NULL, (data_free_fn)alarm_free, NULL); btu_general_alarm_queue = fixed_queue_new(SIZE_MAX); btu_oneshot_alarm_hash_map = hash_map_new(BTU_ONESHOT_ALARM_HASH_MAP_SIZE, hash_function_pointer, NULL, (data_free_fn)alarm_free, NULL); btu_oneshot_alarm_queue = fixed_queue_new(SIZE_MAX); btu_l2cap_alarm_hash_map = hash_map_new(BTU_L2CAP_ALARM_HASH_MAP_SIZE, hash_function_pointer, NULL, (data_free_fn)alarm_free, NULL); btu_l2cap_alarm_queue = fixed_queue_new(SIZE_MAX); bt_workqueue_thread = thread_new(BT_WORKQUEUE_NAME);//該線程為處理各個task 的線程,之後會與多個隊資料行繫結
// Continue startup on bt workqueue thread. thread_post(bt_workqueue_thread, btu_task_start_up, NULL);//在bt_workqueue_thread中繼續startup的工作
return;
}
Bluedroid協議棧HCI線程資料處理流程分析