Briefly
In low power Bluetooth, the protocol for data transmission is ATT and GATT, both of which are transferred after the connection is established, i.e. in a connection state. Some scenarios, such as not establishing a connection, or simply do not need to establish a connection, can actually pass some information through advertising.
About Gap
Gap is generic access profile, this layer also belongs to the host, from the literal meaning, it is responsible for how to help the device for access, specifically, the connection establishment process, encryption process processing (encryption also involves the SMP protocol), Because there is no encryption process in the connection setup process, it is very bad if the wireless communication is not encrypted.
Advertising how to send information
In fact, in the link layer can see the structure of advertising package, which has advertising type and so on, its data is in the package of ADV data payload part. That is, a advertiser has been outgoing broadcast, this broadcast contains a small amount of necessary information, at this time, scanner and initiator both have the ability to listen to these broadcast packets, they can receive the contents of advertising package, and from which to resolve the ADV The meaning of data, if you feel that they are interested in, then you may be able to initiate further requests.
Sanner can also send a scan request package to advertiser, which is used to request a scan response package that may have a little more information. The package structure of the advertising and scan response is the same, but the data information that may be filled in will be different, and the following can look at their structure:
The structure of the data is in AD Structure, generally only into an ad Structure (of course there are many), different applications will have different practices. AD structure The first byte is the length, indicating the remaining data length, and the data section is divided into AD type and ad data, which indicates the data type and the corresponding data content. This is still easy to understand.
In addition, because there is no connection at this time, the transfer of these data is occurring in the advertising channel.
What information advertising can transmit
This is more important, that is, the meaning of the ad type and ad data sections in. Not only advertiser to be clear about which values this part should fill, but the scanner and initiator of interest will parse the values to make the necessary judgments.
AD Type
There are probably 30来 species, and for the sake of coding convenience, the SIG is assigned number for each ad type, which can be directly seen in the number assigned here.
AD Data
Let's look at what's in the first place:
This is in the document "Supplement to the Bluetooth Core specification" provisions, you can go to the SIG website to find the download to see. You can initially see the data can be filled in the service UUID, local name, so that the other scan when the search for the name, service information and so on. There are also flag,tx power information, etc., and can have OOB-related data. Apperance is also often seen to indicate what type of Device advertiser is (Mouse, Keyboard, sensor, etc.). Of course, there are some address related information and so on. The specific meaning, still have to look supplement to the Bluetooth Core specification.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
[Ble--gap] The transfer of information in advertising