The difference between server client in BLE


Preface

Here is the conclusion directly: whoever sends the data will be the server.
These two concepts made me very dizzy, so I checked and summarized as follows.

Official explanation

The GATT server:the device containing the characteristic database that is being read or written by a GATT client.
The GATT client:the device that is reading or writing data from or to the GATT server.

In other words, GATT client and server are the relationship between the two parties in communication, and GATT Server (server) maintains the ATT lookup table and the definition of service and characteristic. GATT client (Client) initiates a request to Server for data communication


Official example

An example of this is given in the Android developer documentation :

Once the phone and the activity tracker have established a connection, they start transferring GATT metadata to one another. Depending on the kind of data they transfer, one or the other might act as the server. For example, if the activity tracker wants to report sensor data to the phone, it might make sense for the activity tracker to act as the server. If the activity tracker wants to receive updates from the phone, then it might make sense for the phone to act as the server.


当手机与一个After Bluetooth devices establish a Bluetooth connection, they begin to transmit GATT metadata to each other. At this time, who is the server depends on the type of data transmitted between the mobile phone and the Bluetooth device. For example, when the Bluetooth device needs to report the data collected by the sensor to the mobile phone, it is more reasonable to use the Bluetooth device as the server; when the Bluetooth device needs to obtain updated information from the mobile phone, it is more reasonable to use the mobile phone as the server.


Related concepts

slightly


Reference

BLUETOOTH BLOG —— A Developer’s Guide To Bluetooth

Android developer documentation

Introduction to GATT Profile

What is a client and server in BLE?

Introduction to BLE GATT

Summary of GAP layer roles

Guess you like

Origin blog.csdn.net/weixin_39591031/article/details/112469241