In the process of Bluetooth enable, multiple threads are created and the threads are bound to the queue. This article mainly analyzes the processing of HCI data this thread.
voidBtu_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); /c6>Btu_l2cap_alarm_queue=fixed_queue_new (Size_max);Bt_workqueue_thread=thread_new (bt_workqueue_name);//The thread is the thread that handles each task and then binds to multiple queues
//Continue startup on BT workqueue thread.thread_post (Bt_workqueue_thread, btu_task_start_up, NULL);//InThe job of continuing startup in Bt_workqueue_thread
Return
}
Bluedroid protocol stack HCI thread data processing flow analysis