bluez protocol stack architecture analysis Bluez architecture: [pic][pic] HCI layer: HCI command grouping: Call hci_sched_cmd() in the hci_send_cmd() function to activate tasklet_schedule(&hdev->cmd_task);. hci_send_cmd() is used to package the incoming data, OGF, OCF, length and parameter pointer into a sk_buff structure. Then the skb_queue_tail() function adds this instruction packet to the tail of the instruction queue of the hci_dev structure of the Bluetooth device. structhci_dev is defined in include/net/bluetooth/hci_core.h. The structure defines data members and function pointers such as open, close, flush, send, etc., which are provided by the Bluetooth driver. When the HCI module is initialized, call tasklet_init() in hci_register_dev() to assign this tasklet to the device. In addition, hdev->rx_task can be activated by calling hci_recv_frame() (in hci_core.h) through an interrupt, and further calling hci_sched_rx(). hdev->tx_task can be activated by calling hci_send_acl() or hci_send_sco() and then calling hci_sched_tx(). Looking back, let\'s look at hci_send_cmd(). When the tasklet hdev->cmd_task is running, it calls hci_cmd_task(), and then further calls hci_send_frame(). This is the transmission function of the HCI core, which can transmit all types of HCI data. Event grouping: The processing of event grouping requires the hdev->rx_task mentioned above. In the corresponding processing function hci_rx_task(), it is necessary to...
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore