转载 2015年07月09日 10:07:22


Generic Attribute Profile (GATT) is built on top of the Attribute Protocol (ATT) and establishes common operations and a framework for the data transported and stored by the Attribute Protocol. GATT defines two roles: Server and Client. The GATT roles are not necessarily tied to specific GAP roles and may be specified by higher layer profiles. GATT and ATT are not transport specific and can be used in both BR/EDR and LE. However, GATT and ATT are mandatory to implement in LE since it is used for discovering services.

The GATT server stores the data transported over the Attribute Protocol and accepts Attribute Protocol requests, commands and confirmations from the GATT client. The GATT server sends responses to requests and when configured, sends indication and notifications asynchronously to the GATT client when specified events occur on the GATT server. GATT also specifies the format of data contained on the GATT server.

Attributes, as transported by the Attribute Protocol, are formatted as services and characteristics. Services may contain a collection of characteristics. Characteristics contain a single value and any number of descriptors describing the characteristic value.

With the defined structure of services, characteristics and characteristic descriptors a GATT client that is not specific to a profile can still traverse the GATT server and display characteristic values to the user. The characteristic descriptors can be used to display descriptions of the characteristic values that may make the value understandable by the user.

GATT-based Profile Hierarchy 

The GATT Profile specifies the structure in which profile data is exchanged. This structure defines basic elements such as services and characteristics, used in a profile. The top level of the hierarchy is a profile. A profile is composed of one or more services necessary to fulfill a use case. A service is composed of characteristics or references to other services. Each characteristic contains a value and may contain optional information about the value. The service and characteristic and the components of the characteristic (i.e., value and descriptors) contain the profile data and are all stored in attributes on the server.
GATT profiles.png 
 GATT profile hierarchy


A service is a collection of data and associated behaviors to accomplish a particular function or feature of a device or portions of a device. A service may reference other primary or secondary services and/or a set of characteristics that make up the service.
There are two types of services: primary and secondary. A primary service provides the primary functionality of a device. A secondary service provides auxiliary functionality of a device and is referenced from at least one primary service on the device.
To maintain backward compatibility with earlier clients, later revisions of a service definition can only add new referenced services or optional characteristics. Later revisions of a service definition are also forbidden from changing behaviors from previous revision of the service definition. Services may be used in one or more profiles to fulfill a particular use case.

Referenced Services

A referenced service is a method incorporating another service definition on the server as part of the service referencing it. When a service references another service, the entire referenced service becomes part of the new service including any nested referenced services and characteristics. The referenced service still exists as an independent service. There are no limits to the depth of nested references.


A characteristic is a value used in a service along with properties and configuration information about how the value is accessed and information about how the value is displayed or represented. A characteristic definition contains a characteristic declaration, characteristic properties, and a value. It may also contain descriptors that describe the value or permit configuration of the server with respect to the characteristic value.

通用属性配置文件(Generic Attribute profile,GATT)

1. 角色        除了GAP定义了角色之外,BLE还定义了另外2种角色:GATT服务器和GATT客户端,它们完全独立于GAP的角色。提供数据的设备称为GATT服务器,访问GATT服务器而获得...
  • zhaoshuzhaoshu
  • zhaoshuzhaoshu
  • 2016年08月29日 15:46
  • 1274


Tieto公司某蓝牙大牛写得《程序员》投稿文章 Android 4.2蓝牙介绍 蓝牙一词源于公元十世纪丹麦国王HaraldBlatand名字中的Blatand。Blatand的英文之意就是Blue...
  • IT1039871366
  • IT1039871366
  • 2015年06月10日 14:27
  • 3043


  • YSSJZ960427031
  • YSSJZ960427031
  • 2016年03月27日 10:06
  • 12697

Generic Attribute Profile (GATT) 通用属性协议

•Designed for use by the application or a profile, so that an attribute client can communicate with ...
  • yinghuihong
  • yinghuihong
  • 2013年06月26日 14:33
  • 5674


译至: 当蓝牙技术联盟宣布正式采用蓝牙核心规范4.0版时,它包括...
  • robertsong2004
  • robertsong2004
  • 2014年08月20日 16:32
  • 3580


  • luo_gw123
  • luo_gw123
  • 2014年10月30日 09:57
  • 1438

UUID of GATT descriptor

UUID of GATT descriptor
  • jeaklcucter
  • jeaklcucter
  • 2015年10月30日 17:03
  • 462

安卓蓝牙技术之GATT(Generic Attribute Profile)

通过BLE连接,读写属性类小数据的Profile通用规范。现在所有的BLE应用Profile都是基于GATT的。 Designed for use by the application or a p...
  • xxdw1992
  • xxdw1992
  • 2018年01月13日 08:37
  • 116

Summary of GATT Profile Attribute Types

比较常用的一张表,必须熟练掌握。 Attribute Type UUID Description 0x2800 Primary...
  • qinrenzhi
  • qinrenzhi
  • 2017年07月18日 20:54
  • 92

Android BLE 扫描 通信

Android 设备扫描 低功耗蓝牙(BLE)设备,通信 (蓝牙4.0)
  • jeesia
  • jeesia
  • 2016年04月03日 14:56
  • 784