Technical details about Bluetooth low energy technology connections

Bluetooth® low energy technology is an evolution of the classic Bluetooth standard that focuses on providing reliable, efficient, and low-power link connectivity between devices. It has ultra-low power consumption for long battery life. At the end of 2014, the 4.2 version of the Bluetooth Technology Core Specification was officially released. In this release, the latest privacy protection mechanism has been introduced. In addition, this version greatly improves the speed and reliability of data transmission between low-power Bluetooth technology devices. Due to the increased capacity of the low-power Bluetooth technology packet, the data transfer speed between devices can be increased by 2.5 times compared with the Bluetooth 4.1 version. The increase in data transmission speed and packet capacity can reduce the probability of transmission errors and reduce battery power consumption, thereby improving the efficiency of networking. This article provides a detailed explanation of the connection between low-power Bluetooth technology devices. I hope to help developers design more innovative products and solutions.
Technical details about Bluetooth low energy technology connections

In the process of establishing a connection between low-power Bluetooth technology, devices are paired: master and slave devices. If the master wants to establish a connection with the slave, the master needs to initiate a connection request (ConnecTIonRequest, CONNECT_REQ), so the master can be called the connection initiator; at the same time, the slave must be connectable and have the ability to resolve the connection request CONNECT_REQ, the slave can be called It is a broadcaster. FIG. 1 is a frame structure of a connection request CONNECT_REQ.

Figure 1 CONNECT_REQ frame structure

Figure 1 CONNECT_REQ frame structure

Among them, InitA is the Bluetooth device address of the connection initiator, and the length is 6 bytes; AdvA is the broadcaster's Bluetooth device address, and the length is 6 bytes. In addition to InitA and AdvA, the most important part of the frame format is LLData, which contains meaningful parameters that are needed during the connection establishment process.

In order to better understand the connection request CONNECT_REQ, we can find a similar example in our daily life to help us understand its meaning. Many readers should have work experience. Before starting a new job, they need to sign a labor contract with the employer. CONNECT_REQ is a "labor contract" provided by the "employer" master. The slave confirmed that the "contract" came into effect and the connection of low-power Bluetooth technology was established. Next, we will analyze the articles in the "contract" one by one (as shown in Figure 2).

Figure 2 LLData schematic

Figure 2 LLData schematic

(1) Access address (AA: Access Address)

The first clause of the contract is to assign an employee a unique identification code within the company, similar to the job number, which the employee can use within the company; when the employee leaves the company, the unique identification code automatically expires; even this An employee joins the company again and his/her new job number is different from the old one. Similarly, before the two Bluetooth low energy technology devices establish a connection, the master device is responsible for generating the access address, which is similar to a 4-byte random number. When the connection is established, both the master and the slave use this connection. The incoming address is used for communication; when the connection is disconnected, the access address is automatically invalidated.

(2) CRCInit (CRC initial value)

The second clause of this "contract" is CRCInit, which is a key for employees within the company, through which employees can access resources within the company. For low-power Bluetooth technology devices, the master and slave use CRCIinit to verify the integrity of the packet.

(3) WinSize and WinOffset

The third clause of the contract specifies the time when the employee first reports to the company and the length of each job in the future. WinSize and WinOffset have similar definitions in the low-power Bluetooth technology connection. WinOffset defines the offset of a communication window after the CONNECT_REQ command, as shown in Figure 3. After the slave device receives the CONNECT_REQ, the slave device takes some time and performs some related configuration according to the LLData parameter. Therefore, WinOffeset provides time for the slave device to perform such operation, and transmitWindowOffset=WinOffset&TImes; 1.25 ms. WinSize defines the window time of the device each time the transceiver is turned on. Whether it is master or slave, they follow the definition of WinSize, window time transmitWindowSize=WinSize&TImes; 1.25 ms.

Therefore, after CONNECT_REQ, the first data frame sent by the master to the slave, we call it the "anchor point" (as shown in Figure 3), because all subsequent connection events are based on this moment. Periodic changes. From the red block diagram we can see that the first data frame cannot be earlier than (1.25ms + transmitWindowOffset) and can not be later than (1.25 ms + transmitWindowOffset + transmitWindowSize).

Figure 3 initiate connection timing diagram

Figure 3 initiate connection timing diagram

(4) Interval, Latency & TImeout

Under normal circumstances, people's working hours are nine to five, five days a week. However, in the connection mechanism of low-power Bluetooth technology, we have adopted a more flexible "flexible work system". For the flexible working system of low-power Bluetooth technology connection, there are three parameters to understand, Interval, Lantivity and Timeout.

Figure 4 connection event timing diagram

Figure 4 connection event timing diagram

After the connection is established, the data interaction between the master and the slave can be called a connection event. The period of the connection event (connInterval) is set by the Interval parameter, connInterval=Interval×1.25 ms, the value of connInterval The range is between 7.5 ms and 4 s seconds. Therefore, after the anchor point is determined, the master and slave will interact with the data at the time interval determined by connInterval, as shown in Figure 4.

However, for low-power Bluetooth technology, the low-power feature needs special consideration, and in practical applications, there is no need to generate a connection event every connInterval, so the parameter Lantian is introduced, which can effectively reduce the connection event. Generated, connSlaveLatency= Latency. connSlaveLatency defines how many consecutive connection events a slave device can ignore. It does not need to listen for packets from the master in these ignored connection events. This also means that the slave device does not need to be at the moment of each connection event. Wake up and turn on the RF receiver for listening, so it can effectively reduce the power consumption of the slave device. This is also an important reason why low-power Bluetooth technology can achieve its low power consumption.

The Timeout parameter defines the length of the connection timeout, connSupervisionTimeout = Timeout × 10 ms, which ranges from 100 ms to 32 s. Whether it is the master or the slave, after receiving a data frame, if the next data frame is not waiting for the duration of the connSupervisionTimeout, the connection may be considered to have been disconnected. It should be emphasized here that connSupervisionTimeout must be greater than (1 + connSlaveLatency) × connInterval × 2, otherwise, even if the slave device is in the Lantency state, it will be mistaken for the connection timeout, causing the connection to be disconnected.

(5) ChM & Hop

We all know that Bluetooth uses frequency hopping technology. When the connection is established, the master and slave devices need to use some mechanism to perform frequency hopping on the preset channel spectrum according to the preset hop span. The channel map comes from the ChM parameters, and the span of each hop comes from the Hop parameter. Hop is an integer ranging from 5 to 16. The following formula provides a way for frequency hopping to work:

Technical details about Bluetooth low energy technology connections

Author: Ren Kai Bluetooth SIG Asia Pacific Technical Project Manager

Screwdrivers

Wonke Electric CO.,Ltd. , https://www.wkdq-electric.com