Font Size: a A A

Design And Implementation Of Application Layer For Bluetooth Low Energy Stack 4.2

Posted on:2019-01-31Degree:MasterType:Thesis
Country:ChinaCandidate:P WangFull Text:PDF
GTID:2428330590975448Subject:Software engineering
Abstract/Summary:PDF Full Text Request
As a new type of short distance wireless communication technologies,the Bluetooth low energy(BLE)has the characteristics of low power,low cost,anti-interference,and flexible connection.It has been widely used in many fields,such as security systems,wearable devices,smart home,and so on.In the BLE 4.2 version,privacy protection and data transmission rates are improved,and a configuration file that supports IP connection is developed,which make it become the best solution for Internet of Things.Currently,there are many BLE 4.2 protocol stack products on the market,but most of them have the following three problems: First,instead of giving the source code,these products only provide the libraries and Application Programming Interface.As a result,users are unable to modify and expand the protocol stack.Second,these protocol stack products have large code size due to the combination of traditional Bluetooth and BLE functions,which is not suitable for smaller embedded products.Third,most products place too much emphasis on the integrity and diversity of function without considering the extra overhead caused by stack code.This paper researches and implements the application layer of BLE 4.2 protocol stack,including Generic Attribute Profile(GATT)and Generic Access Profile(GAP),based on the BLE 4.2 core specification.During the implementation,the main source of the code overhead of application layer is obtained by analyzing the contradiction between protocol design and practical application,including data-related overhead,such as data copy overhead,memory management overhead,function call overhead of the inter-layer data,and no-data related overhead.In order to optimize the data copy overhead and memory management overhead in application layer,a reserved allocation strategy for the packet header is designed;in order to reduce the small and repeated function call overhead between GATT layer and ATT layer,GAP layer and HCI layer,the inter-layer interaction strategy based on the mediator model was proposed;in order to optimize the no-data overhead,the mechanism of registering callback function is designed and the way of judging state when dealing with event was adopted to design the GATT state machine.In order to test the function and code size of application layer in the BLE 4.2 protocol stack developed by this thesis,a hardware platform is build,which takes STM32F103RBT6 as Microcontroller Unit and CC2564 as BLE Controller.The test result shows that compared with the open source protocol stack BTStack,the size of application layer output file is reduced by 23.3% and the executable file is decreased by 12.4%.So,the effect of the optimization of code overhead is obvious while realizing the function of GATT layer and GAP layer in BLE 4.2 protocol stack.
Keywords/Search Tags:Bluetooth Low Energy 4.2, application, GATT profile, GAP profile, optimize the code overhead
PDF Full Text Request
Related items