Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Generic Attribute Profile (GATT)

Generic Attribute Profile (GATT) More...

Modules

 GATT Client APIs
 
 GATT Server APIs
 

Data Structures

struct  bt_gatt_attr
 GATT Attribute structure. More...
 
struct  bt_gatt_service_static
 GATT Service structure. More...
 
struct  bt_gatt_service
 GATT Service structure. More...
 
struct  bt_gatt_service_val
 Service Attribute Value. More...
 
struct  bt_gatt_include
 Include Attribute Value. More...
 
struct  bt_gatt_cb
 GATT callback structure. More...
 
struct  bt_gatt_chrc
 Characteristic Attribute Value. More...
 
struct  bt_gatt_cep
 Characteristic Extended Properties Attribute Value. More...
 
struct  bt_gatt_ccc
 
struct  bt_gatt_scc
 
struct  bt_gatt_cpf
 GATT Characteristic Presentation Format Attribute Value. More...
 

Macros

#define BT_GATT_ERR(_att_err)   (-(_att_err))
 Construct error return value for attribute read and write callbacks. More...
 
#define BT_GATT_CHRC_BROADCAST   0x01
 Characteristic broadcast property. More...
 
#define BT_GATT_CHRC_READ   0x02
 Characteristic read property. More...
 
#define BT_GATT_CHRC_WRITE_WITHOUT_RESP   0x04
 Characteristic write without response property. More...
 
#define BT_GATT_CHRC_WRITE   0x08
 Characteristic write with response property. More...
 
#define BT_GATT_CHRC_NOTIFY   0x10
 Characteristic notify property. More...
 
#define BT_GATT_CHRC_INDICATE   0x20
 Characteristic indicate property. More...
 
#define BT_GATT_CHRC_AUTH   0x40
 Characteristic Authenticated Signed Writes property. More...
 
#define BT_GATT_CHRC_EXT_PROP   0x80
 Characteristic Extended Properties property. More...
 
#define BT_GATT_CEP_RELIABLE_WRITE   0x0001
 
#define BT_GATT_CEP_WRITABLE_AUX   0x0002
 
#define BT_GATT_CCC_NOTIFY   0x0001
 Client Characteristic Configuration Notification. More...
 
#define BT_GATT_CCC_INDICATE   0x0002
 Client Characteristic Configuration Indication. More...
 
#define BT_GATT_SCC_BROADCAST   0x0001
 Server Characteristic Configuration Broadcast. More...
 

Enumerations

enum  {
  BT_GATT_PERM_NONE = 0 , BT_GATT_PERM_READ = BIT(0) , BT_GATT_PERM_WRITE = BIT(1) , BT_GATT_PERM_READ_ENCRYPT = BIT(2) ,
  BT_GATT_PERM_WRITE_ENCRYPT = BIT(3) , BT_GATT_PERM_READ_AUTHEN = BIT(4) , BT_GATT_PERM_WRITE_AUTHEN = BIT(5) , BT_GATT_PERM_PREPARE_WRITE = BIT(6)
}
 
enum  { BT_GATT_WRITE_FLAG_PREPARE = BIT(0) , BT_GATT_WRITE_FLAG_CMD = BIT(1) }
 

Detailed Description

Generic Attribute Profile (GATT)

Macro Definition Documentation

◆ BT_GATT_CCC_INDICATE

#define BT_GATT_CCC_INDICATE   0x0002

#include <include/bluetooth/gatt.h>

Client Characteristic Configuration Indication.

If set, changes to Characteristic Value shall be indicated.

◆ BT_GATT_CCC_NOTIFY

#define BT_GATT_CCC_NOTIFY   0x0001

#include <include/bluetooth/gatt.h>

Client Characteristic Configuration Notification.

Client Characteristic Configuration Values

If set, changes to Characteristic Value shall be notified.

◆ BT_GATT_CEP_RELIABLE_WRITE

#define BT_GATT_CEP_RELIABLE_WRITE   0x0001

#include <include/bluetooth/gatt.h>

Characteristic Extended Properties Bit field values

◆ BT_GATT_CEP_WRITABLE_AUX

#define BT_GATT_CEP_WRITABLE_AUX   0x0002

◆ BT_GATT_CHRC_AUTH

#define BT_GATT_CHRC_AUTH   0x40

#include <include/bluetooth/gatt.h>

Characteristic Authenticated Signed Writes property.

If set, permits signed writes to the Characteristic Value.

◆ BT_GATT_CHRC_BROADCAST

#define BT_GATT_CHRC_BROADCAST   0x01

#include <include/bluetooth/gatt.h>

Characteristic broadcast property.

Characteristic Properties Bit field values

If set, permits broadcasts of the Characteristic Value using Server Characteristic Configuration Descriptor.

◆ BT_GATT_CHRC_EXT_PROP

#define BT_GATT_CHRC_EXT_PROP   0x80

#include <include/bluetooth/gatt.h>

Characteristic Extended Properties property.

If set, additional characteristic properties are defined in the Characteristic Extended Properties Descriptor.

◆ BT_GATT_CHRC_INDICATE

#define BT_GATT_CHRC_INDICATE   0x20

#include <include/bluetooth/gatt.h>

Characteristic indicate property.

If set, permits indications of a Characteristic Value with acknowledgment.

◆ BT_GATT_CHRC_NOTIFY

#define BT_GATT_CHRC_NOTIFY   0x10

#include <include/bluetooth/gatt.h>

Characteristic notify property.

If set, permits notifications of a Characteristic Value without acknowledgment.

◆ BT_GATT_CHRC_READ

#define BT_GATT_CHRC_READ   0x02

#include <include/bluetooth/gatt.h>

Characteristic read property.

If set, permits reads of the Characteristic Value.

◆ BT_GATT_CHRC_WRITE

#define BT_GATT_CHRC_WRITE   0x08

#include <include/bluetooth/gatt.h>

Characteristic write with response property.

If set, permits write of the Characteristic Value with response.

◆ BT_GATT_CHRC_WRITE_WITHOUT_RESP

#define BT_GATT_CHRC_WRITE_WITHOUT_RESP   0x04

#include <include/bluetooth/gatt.h>

Characteristic write without response property.

If set, permits write of the Characteristic Value without response.

◆ BT_GATT_ERR

#define BT_GATT_ERR (   _att_err)    (-(_att_err))

#include <include/bluetooth/gatt.h>

Construct error return value for attribute read and write callbacks.

Parameters
_att_errATT error code
Returns
Appropriate error code for the attribute callbacks.

◆ BT_GATT_SCC_BROADCAST

#define BT_GATT_SCC_BROADCAST   0x0001

#include <include/bluetooth/gatt.h>

Server Characteristic Configuration Broadcast.

Server Characteristic Configuration Values

If set, the characteristic value shall be broadcast in the advertising data when the server is advertising.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

#include <include/bluetooth/gatt.h>

GATT attribute permission bit field values

Enumerator
BT_GATT_PERM_NONE 

No operations supported, e.g. for notify-only

BT_GATT_PERM_READ 

Attribute read permission.

BT_GATT_PERM_WRITE 

Attribute write permission.

BT_GATT_PERM_READ_ENCRYPT 

Attribute read permission with encryption.

    If set, requires encryption for read access.
BT_GATT_PERM_WRITE_ENCRYPT 

Attribute write permission with encryption.

    If set, requires encryption for write access.
BT_GATT_PERM_READ_AUTHEN 

Attribute read permission with authentication.

    If set, requires encryption using authenticated link-key for read
    access.
BT_GATT_PERM_WRITE_AUTHEN 

Attribute write permission with authentication.

    If set, requires encryption using authenticated link-key for write
    access.
BT_GATT_PERM_PREPARE_WRITE 

Attribute prepare write permission.

    If set, allows prepare writes with use of BT_GATT_WRITE_FLAG_PREPARE
    passed to write callback.

◆ anonymous enum

anonymous enum

#include <include/bluetooth/gatt.h>

GATT attribute write flags

Enumerator
BT_GATT_WRITE_FLAG_PREPARE 

Attribute prepare write flag.

   If set, write callback should only check if the device is
   authorized but no data shall be written.
BT_GATT_WRITE_FLAG_CMD 

Attribute write command flag.

   If set, indicates that write operation is a command (Write without
   response) which doesn't generate any response.