Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
bt_gatt_attr Struct Reference

GATT Attribute structure. More...

#include <gatt.h>

Data Fields

const struct bt_uuiduuid
 
ssize_t(* read )(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset)
 Attribute read callback. More...
 
ssize_t(* write )(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
 Attribute write callback. More...
 
voiduser_data
 
uint16_t handle
 
uint8_t perm
 

Detailed Description

GATT Attribute structure.

Field Documentation

◆ handle

uint16_t bt_gatt_attr::handle

Attribute handle

◆ perm

uint8_t bt_gatt_attr::perm

Attribute permissions

◆ read

ssize_t(* bt_gatt_attr::read) (struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset)

Attribute read callback.

The callback can also be used locally to read the contents of the attribute in which case no connection will be set.

Parameters
connThe connection that is requesting to read
attrThe attribute that's being read
bufBuffer to place the read result in
lenLength of data to read
offsetOffset to start reading from
Returns
Number fo bytes read, or in case of an error BT_GATT_ERR() with a specific ATT error code.

◆ user_data

void* bt_gatt_attr::user_data

Attribute user data

◆ uuid

const struct bt_uuid* bt_gatt_attr::uuid

Attribute UUID

◆ write

ssize_t(* bt_gatt_attr::write) (struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)

Attribute write callback.

Parameters
connThe connection that is requesting to write
attrThe attribute that's being written
bufBuffer with the data to write
lenNumber of bytes in the buffer
offsetOffset to start writing from
flagsFlags (BT_GATT_WRITE_*)
Returns
Number of bytes written, or in case of an error BT_GATT_ERR() with a specific ATT error code.

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