Zephyr API Documentation 4.0.0-rc3
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

GATT Attribute. More...

#include <gatt.h>

Data Fields

const struct bt_uuiduuid
 Attribute Type, aka.
 
bt_gatt_attr_read_func_t read
 Attribute Value read method.
 
bt_gatt_attr_write_func_t write
 Attribute Value write method.
 
void * user_data
 Private data for read() and write() implementation.
 
uint16_t handle
 Attribute Handle or zero, maybe?
 
uint16_t perm
 Attribute Permissions.
 

Detailed Description

GATT Attribute.

This type primarily represents an ATT Attribute that may be an entry in the local ATT database. The objects of this type must be part of an array that forms a GATT service.

While the formed GATT service is registered with the local GATT server, pointers to this type can typically be given to GATT server APIs, like bt_gatt_notify().

Note
This type is given as an argument to the bt_gatt_discover() application callback, but it's not a proper object of this type. The field perm, and methods read() and write() are not available, and it's unsound to pass the pointer to GATT server APIs.

Field Documentation

◆ handle

uint16_t bt_gatt_attr::handle

Attribute Handle or zero, maybe?

The meaning of this field varies and is not specified here. Some APIs use this field as input/output. It does not always contain the Attribute Handle.

Note
Use bt_gatt_attr_get_handle() for attributes in the local ATT database.
See also
bt_gatt_discover_func_t about this field.

◆ perm

uint16_t bt_gatt_attr::perm

Attribute Permissions.

Bit field of bt_gatt_perm.

The permissions are security requirements that must be satisfied before calling read() or write().

See also
bt_gatt_discover_func_t about this field.

◆ read

bt_gatt_attr_read_func_t bt_gatt_attr::read

Attribute Value read method.

Readable Attributes must implement this method.

Must be NULL if the attribute is not readable.

The behavior of this method is determined by the Attribute Type.

See bt_gatt_attr_read_func_t.

◆ user_data

void* bt_gatt_attr::user_data

Private data for read() and write() implementation.

The meaning of this field varies and is not specified here.

Note
Attributes may have the same Attribute Type but have different implementations, with incompatible user data. Attribute Type alone must not be used to infer the type of the user data.
See also
bt_gatt_discover_func_t about this field.

◆ uuid

const struct bt_uuid* bt_gatt_attr::uuid

Attribute Type, aka.

"UUID"

The Attribute Type determines the interface that can be expected from the read() and write() methods and the possible permission configurations.

E.g. Attribute of type BT_UUID_GATT_CPF will act as a GATT Characteristic Presentation Format descriptor as specified in Core Specification 3.G.3.3.3.5.

You can define a new Attribute Type.

◆ write

bt_gatt_attr_write_func_t bt_gatt_attr::write

Attribute Value write method.

Writeable Attributes must implement this method.

Must be NULL if the attribute is not writable.

The behavior of this method is determined by the Attribute Type.

See bt_gatt_attr_write_func_t.


The documentation for this struct was generated from the following file: