Bluetooth Basics explore

Bluetooth acquaintance

The Bluetooth module can transmit data through the serial port (SPI, IIC) and the MCU controlling device. Bluetooth module can be used as master and slave. Host is the ability to search for other Bluetooth module and take the initiative to establish a connection from the machine can not take the initiative to establish a connection, can only wait for others to connect their own.
BR / EDR: basal rate / enhanced data rates (version: 2.0 / 2.1)
is characterized by: continuing to support wireless connection to peer (P2P) network topology establish one: a communication (11) device.

LE: low energy consumption (version: 4.0 / 4.1 / 4.2 )
is characterized by: support a wireless connection for a short time, using a plurality of network topology, including point to point, a broadcast (one to many) and grids (many)

Bluetooth Features

Here Insert Picture Description

Bluetooth protocol stack layers

1. Physical layer (PHY): RF transmission.

2. Link Layer (LL): control the radio status includes waiting, advertisement, scanning, initialized, is connected.

3. The Host Control Interface Layer (HCI): a host controller and a communication interface.

4. The logical link control and adaptation protocol layer (L2CAP): providing a data package services, allow the point to point communication logic.

5. Security management (SM): encryption and decryption of secure connections and data exchange services.

6. attribute protocol layer (ATT): Allow device (server) shows specific data (attributes) to another device (client).

7. Generic Attribute profile layer (GATT): defines the service using the ATT frame, all data traffic to establish a connection between the two devices is processed by a subroutine GATT.

8. The Generic Access Profile Layer (GAP): providing a common feature for all Bluetooth devices, such as a transmission mode and access procedures, protocols and applications described. GAP Services include device discovery, connection mode, security, authentication, joint models and service discovery.

http://5b0988e595225.cdn.sohucs.com/images/20171024/af210b839b174e0ea05acfc418852486.png

Bluetooth transmission main building process from machine

http://5b0988e595225.cdn.sohucs.com/images/20171024/612b6427b7e14946bcf9976d56af59fa.jpeg

http://note.youdao.com/noteshare?id=773685f048610f54aa15043a7f9e0678&sub=F47C207D48AA4DCAA45D2E82E687E7FF

Defined state (state) and role (role) of

http://www.wowotech.net/content/uploadfile/201603/0b4e534c15ee5ffb7cb0d24c67fa1a0f20160312143237.gif

Standby state is the initial state, i.e., does not transmit data nor receive data. The command of the higher layer entity (such as in the GAP host software), may be any other one state, you can switch to any state except Connection state.

Advertising state is the state data can be sent over a broadcast channel, enters the Standby state. It broadcast data may be received by the state in Scanning Initiating or entity. Advertising layer entity may switch back to Standby state status command. Further, the connection is successful, the state can be switched for the Connection.

Scanning state is the state data can be received through the broadcast channel, enters the Standby state. Depending on the type of the data broadcast Advertiser, some Scanner can actively request some additional data to the Advertiser. Scanning layer entity may switch back to Standby state status command.

Initiating state and the Scanning state similar, but is a special reception state, enters the Standby state, can receive data broadcast Advertiser connectable to, and after receiving the data, sends a connection request to establish a connection and Advertiser. When the connection is successful, Initiater and are switched to the corresponding Advertiser Connection state.

Connection state is established and the state of an entity separate channel, after the channel is established, automatically switches from the Initiating or Advertising. After the channel off, it will return to the Standby state.

Glossary

(1) GAAT: Generic Attribute Profile, GATT profile is a general specification for transmitting and receiving data blocks are called "attributes" in the link BLE. BLE all current applications are based on GATT. Bluetooth SIG provides many low-power device configuration file. A profile is the specification of how the device works in a particular application. Note that a device can implement multiple configuration files. For example, a device may include a heart rate monitor and the power detection.

(2) Characteristic Characteristic comprises a variable and a single 0-n number of variables used to describe Characteristic descriptor, characteristic may be considered a type, similar to a class.

(3) Descriptor Descriptor is used to describe the properties characteristic variable. For example, a descriptor may specify a human readable description of a characteristic variable or acceptable range, or a specific unit of measurement variable characteristic. Service service is a collection of characteristic. For example, you might have one called "Heart Rate Monitor (heart rate monitor)," the service, which includes a number of characteristics, such as "heart rate measurement (heart rate monitor)" and so on. You can bluetooth.org find the configuration file and a list of services based on the GATT currently supported.

Guess you like

Origin blog.csdn.net/walter247443819/article/details/91958279