歡迎轉載opendevkit文章, 更好排版和效果, 請關注文章原始地址:http://www.opendevkit.com/?e=110

通過分析獨立任務,我們能更清楚的弄明白,協議棧部分到底有多少獨立執行線。


任務個數和作用

grep GKI_create_task發現,

./main/bte_main.c:204: GKI_create_task((TASKPTR)btu_task, BTU_TASK, BTE_BTU_TASK_STR,

主要任務,處理上層請求,處理下層事件,承上啟下!

./btif/src/btif_core.c:463: status = GKI_create_task(btif_task, BTIF_TASK, BTIF_TASK_STR,

bt interface任務。

./btif/src/btif_media_task.c:699: retval =GKI_create_task((TASKPTR)btif_media_task, A2DP_MEDIA_TASK,

媒體任務,處理多媒體事件。

實際上, GKI_create_task也是封裝的pthread_create

grep pthread_create發現,

./gki/ulinux/gki_ulinux.c:806: if (pthread_create( &timer_thread_id,

gki層提供的timer線程,為各種timer提供支持。

./hci/src/btsnoop.c:589: if (pthread_create(&thread_id, NULL,

嗅探任務,負責hci的數據包嗅探。

./hci/src/bt_hci_bdroid.c:161: if (pthread_create(&hc_cb.worker_thread, &thread_attr, \

對hci uart寫隊列處理的任務,包括hci的cmd,sco的數據包。

./hci/src/userial.c:363: if (pthread_create(&(userial_cb.read_thread), &thread_attr, \

讀hci uart,讀後分發!

./btif/src/btif_sock_thread.c:170: if( pthread_create(&thread_id, &thread_attr, start_routine, arg)!=0 )

為app層提供操作rfcomm的簡便方法,也就是使用socket通信!android的藍芽操作主要是玩rfcomm目前!

./btif/src/btif_hl.c:5171: if ( pthread_create(&thread_id, &thread_attr, start_routine, arg)!=0 )

hl profile自己的任務,需要才打開!

./btif/co/bta_hh_co.c:138: if ( pthread_create(&thread_id, &thread_attr, start_routine, arg)!=0 )

hh profile自己的任務,需要才打開!

./udrv/ulinux/uipc.c:573: if (pthread_create(&uipc_main.tid, (const pthread_attr_t *) NULL, (void*)uipc_read_task,
NULL) < 0)


處理a2dp_audio_hw中out_write接口發過來的數據,也就是sco數據處理!

arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()