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:
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.
|
<<: 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?
According to foreign media reports, American auto...
For information flow advertising , the content an...
The Alipay staff certainly didn't expect that...
Cost Director Training Course - Cost Management f...
Now more and more people love to play Tik Tok. “W...
Xi Guohua, chairman of China Mobile, confirmed in...
Since the release of iOS 13, there have been many...
Audit expert: Zheng Yuanpan, professor at Zhengzh...
Maybe we won’t get a satisfactory result immediat...
While people were still immersed in the joy of a ...
In less than a month, Apple's WWDC 2020 Globa...
Recently, I have received a lot of inquiries abou...
Just as KOL corresponds to the herd effect in psy...
This article will explain the following four poin...
Distribution fission is one of the means of produ...