Saturday, October 25, 2014

Generic Attribute Profile (GATT)

GATT comes into play once a dedicated connection is established between two devices, means you have already gone through the advertising process governed by GAP. GATT defines the way that two BLE devices transfers data back and forth using concepts called Services and Characteristics. It make use of a generic data protocol called Attribute Protocol, which is used ti store Services, Characteristics and related data in simple lookup table using 16 - bit IDs for reach entry in table. These 16 - bit IDs are called UUIDs.

Note: Important thing to note here is, GATT connections are EXCLUSIVE. That means a BLE Peripheral device can only be connected to one central device at a time.


How Connections Works

It is interesting to know, that a peripheral device can only be connected to one central device, such as a mobile device, at a time, but a central device can connect to multiple peripheral.

How Connection Works













Client/Server Relationship

Peripheral act as GATT Server and Central act as GATT Client. GATT Server holds ATT lookup data, services and characteristics, whereas GATT Client sends requests to this server.

All transactions are started by the master device, the GATT Client, which receives response from the slave device, the GATT Server.

When establishing a connection, the peripheral will suggest a 'Connection Interval' to the central device, and the central device will try to reconnect every connection interval to see if any new data is available, etc. Marconi Labs ADA iBeacons is an example of such peripheral device. 



Note: It's important to keep in mind that this connection interval is really just a suggestion, though! Your central device may not be able to honor the request because it's busy talking to another peripheral or the required system resources just aren't available.




No comments:

Post a Comment