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

Useful Information | What does a high-conversion information flow ad look like?

For information flow advertising , the content an...

Microsoft, you should be held accountable for the "pay whore" incident

The Alipay staff certainly didn't expect that...

Cost Director Training Course - Cost Management from Beginner to Mastery

Cost Director Training Course - Cost Management f...

Analysis of the popular Tik Tok follower-boosting strategy!

Now more and more people love to play Tik Tok. “W...

Is iOS 13.2.2 worth updating? Know these points and you will understand

Since the release of iOS 13, there have been many...

How to use data to drive operational growth

Maybe we won’t get a satisfactory result immediat...

For an inventory H5, what are the factors that cause it to go viral?

While people were still immersed in the joy of a ...

How to build a user growth system from scratch?

Recently, I have received a lot of inquiries abou...

How should an APP build a user growth system? Share 6 points!

Just as KOL corresponds to the herd effect in psy...

How to write a coupon promotion plan?

This article will explain the following four poin...

Disassembly of “New Oriental” Datang Xiaoyu distribution activity!

Distribution fission is one of the means of produ...