Font Size: a A A

The Design And Implementation Of The HCI Layer Of Bluetooth Low Energy(BLE) 4.2 Protocal Stack

Posted on:2019-12-06Degree:MasterType:Thesis
Country:ChinaCandidate:L JiaFull Text:PDF
GTID:2428330590975450Subject:Software engineering
Abstract/Summary:PDF Full Text Request
In recent years,with the rapid development of wireless communication technology,Bluetooth technology has been playing a very important role in wireless communication technology.It has been favored by all walks of life for its various advantages.Bluetooth protocol stack is the core of Bluetooth technology,and the host controller interface protocol is an important communication protocol in the Bluetooth protocol stack.For Bluetooth applications,the function of application implementation largely depends on the function of HCI layer implementation,so the implementation of HCI layer is very important for the BLE protocol stack.Based on the in-depth understanding of the Bluetooth core protocol specification,this thesis focuses on the design of HCI layer protocol according to the low power Bluetooth 4.2 core protocol specification.Through the analysis of the existing problems of the protocol stack,this thesis optimizes the design from two aspects: HCI layer protocol memory space optimization and HCI protocol layer finite state machine code optimization.In order to avoid the repeated function calls generated by HCI commands construction,a pre storage mechanism for HCI layer protocol packet is designed.In order to reduce the memory consumption,a command grouping strategy based on double-queue is designed.For the design of HCI lauyer state machine,it is proposed to judge the state mechanism in the event to improve the efficiency of the state machine.In order to reduce unnecessary state jumps and reduce the amount of code,a design strategy based on state mode and a strategy of designing hash tables with state parameters are proposed.Based on the above key points,this thesis implements HCI layer protocol,including the command sending module in the HCI layer,the data receiving module,the event processing module,the interface of the HCI layer to the upper layer protocol and the HCI transport layer.In order to test the function and code size of HCI layer in the BLE 4.2 protocol stack developed in this thesis,a hardware platform is built,which takes STM32F103RBT6 as microcontroller unit and CC2564 as BLE controller.The test result shows that all functions of HCI layer in BLE 4.2 protocol stack are implemented in this thesis.The communication between host and controller is properly implemented in this thesis.Meanwhile,Compared with the protocol stack Btstack,The HCI layer output file size of the protocol stack is reduced by 28.72%.The effect of code cost optimization is obvious,which has achieved the objectives of design.
Keywords/Search Tags:Bluetooth Low Energy 4.2 protocal stack, HCI protocal, HCI transport layer, Code optimization
PDF Full Text Request
Related items