Android: GATT Low Energy Bluetooth Profile

I want to send information from my Android device to a microcontroller (e.g. Arduino). Using Bluetooth Classic, I simply send an array of data bytes to the microcontroller and process the byte array accordingly.

I started reading about Bluetooth Low Energy and I hear all this talk about GATT profiles. Why do I need to create a GATT profile? What GATT profile will do for me in case of information exchange from an Android device to a microcontroller?

Thanks in advance!

+6
source share
2 answers

GATT profiles are a way of communication between the central Bluetooth and a peripheral device. Suppose I have an application that reads temperature from a sensor. My current setup is that the phone acts as a central, sensor attached to the bluetooth LE chip, as a peripheral.

So, I am communicating with the bluetooth LE chip using this profile. In the GATT profile declaration in the chip, I will define the service and two characteristics. Two characteristics:

  • Sensor Protection
  • Temperature value

The sensor has read and write permissions, while the temperature has only read permission.

So, in your application, when you want to read the temperature value, first write 0x01 to the enabler characteristic, and then read the value from the temperature value.

To define features and services, bluetooth has the concept of UUID and pens. UUIDs are globally unique, and pens are assigned to the chip.

Services include all the available features. So, in the hierarchy, you have profiles that can have several services, which, in turn, can have several characteristics.

To explain everything in the answer would be too much. Why don't you learn the basic concepts here ? I found these documents really useful.

+7
source

The whole concept of Bluetooth Low Energy is to use less power to transfer between two Bluetooth devices. To do this, you can not use the traditional Bluetooth classics, which supports the channel, even if the data transfer is not performed. Thus, the ATT / GATT concept was developed, which provides specifications for transmitting short data packets over the BLE channel between two Low Energy devices. In this regard, when two devices are not communicating, it will be as good as it is stopped. To implement BLE services, you must use these ATT / GATT profiles and protocols.

GATT provides a specification of how a group of attributes (which are nothing more than data) are grouped into meaningful services. It performs general ATT data transfer and storage operations, defining its own client-server mechanism. This simplifies the life of developers by defining the whole structure for you, and you just need to group these characteristics and services by setting up profiles and applications for development there.

+2
source

All Articles