Do you understand these concepts in BLE?

Do you understand these concepts in BLE?

[[374244]]

This article is reprinted from the WeChat public account "Embedded from 0 to 1", which can be followed through the following QR code. To reprint this article, please contact the Embedded from 0 to 1 public account.

We used the Bluetooth debugging assistant on an Android phone to communicate with the TB-02-kit module. Many people may not understand many of the concepts. Today we will sort out the entire data communication process and some of the concepts involved. If you have any misunderstandings, please leave a message.

History of Bluetooth

History of Bluetooth

Difference between Bluetooth and BLE

Bluetooth is a short-range 2.4 GHz wireless communication technology that enables data exchange between devices.

Generally, BR/EDR Bluetooth before Bluetooth 3.0 is called traditional Bluetooth (classic Bluetooth BT: BlueTooth), while LE Bluetooth under the Bluetooth 4.0 specification is called low-power Bluetooth.

Bluetooth low energy is developed based on traditional Bluetooth.

BLE technology uses a very fast connection method, so it can be in a "non-connected" state (saving energy). At this time, the two ends of the link only know each other, open the link only when necessary, and then close the link in the shortest possible time - the purpose of this design is to achieve low power consumption.

BLE advantages: fast search speed, fast connection speed, ultra-low power consumption to maintain connection and transmit data; disadvantage is that the transmission rate is slightly low.

BLE Bluetooth module main application areas

1. Mobile expansion device

2. Automotive electronic equipment

3. Health and medical supplies: heart rate belt, blood pressure monitor, etc.

4. Positioning applications: indoor positioning, underground positioning, etc.

5. Close-range data collection: wireless meter reading, wireless telemetry, etc.

6. Data transmission: smart home indoor control, Bluetooth dimming, printer, etc.

BLE data communication

A Gatt contains multiple services; a service contains multiple characteristics; a characteristic contains multiple descriptors;

Conversely, one descriptor corresponds to one characteristic; one characteristic corresponds to one service; and one service corresponds to one Gatt.

Service, Characteristic, and Descriptor all use UUID as a unique identifier.

As shown in the figure above, in the BLE debugging software we used before, we can see that the first three services shown in the figure are the three basic services required by BLE:

  1. #define GAP_SERVICE_UUID 0x1800 // Generic Access Profile
  2. #define GATT_SERVICE_UUID 0x1801 // Generic Attribute Profile
  3. #define DEVINFO_SERV_UUID 0x180A // Device Information

Generally speaking, the remaining service is the service for data communication with the BLE module, and the Characteristic in the Service is the key to exchanging data between the mobile phone and the BLE terminal.

Therefore, the data communication operations we have mentioned above are all data communications with Unknown Characteristic.

Why are so many nouns defined?

After the Bluetooth connection is successful, data transmission is to read, write, notify and other operations on the characteristic value parameter;

For the convenience of management, we may have more than one characteristic value. We can create multiple characteristic values ​​as needed, such as one characteristic value for recording the value of ambient humidity, one characteristic value for recording the temperature value of the device, and so on.

We can also classify these characteristic values. Each category is equivalent to a service. A device can have multiple services, and each service can contain multiple characteristic values.

For the sake of convenience, each feature value has its attributes, so we will also see some other terms, such as permission, value, descriptor, etc.

To do

In the next article, we will use Qt to develop a BLE debugging software for Android system to realize data transmission and reception with Bluetooth module, which is actually to realize the data reading and writing operation with Unknown Characteristic in Unknown Service of the following UUID.

  1. static const QLatin1String serviceUuid( "{00010203-0405-0607-0809-0a0b0c0d1910}" );

<<:  The final struggle: Trump bans eight Chinese apps including QQ and Alipay

>>:  Why do many apps always need to be upgraded? What are they trying to do?

Recommend

"Happy Candy Crush" APP Operation Analysis

Happy Match 3 is a strategy game developed by Ten...

Earth forest, a fleeting landscape

Earth forest is a kind of semi-loose and semi-con...

2019 Alipay product operation analysis!

1. Product Overview 1.1 Product Introduction Prod...

The world's first! Hydrogen powered

On September 21, a large blue mining vehicle was ...

How do free tool apps acquire users?

The way for free tools to acquire users must be a ...

Ah? This pavilion can make it rain by itself?

Did you know that there is an interesting pavilio...

How to reduce the size of Android apps

【51CTO.com Quick Translation】I wonder if you have...

"Dry Goods" Complete Guide to Internet Finance New Media Marketing Plan!

New media is a relative concept. There will alway...

How much does it cost to make an electrical applet in Shangluo?

How much does it cost to produce the Shangluo Ele...