NimBLE-Arduino 2.1.3
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ble_gatt_access_ctxt Struct Reference

#include <ble_gatt.h>

Public Attributes

uint8_t op
 
struct os_mbufom
 
union { 
 
   const struct ble_gatt_chr_def *   chr 
 
   const struct ble_gatt_dsc_def *   dsc 
 
};  
 

Detailed Description

Context for an access to a GATT characteristic or descriptor. When a client reads or writes a locally registered characteristic or descriptor, an instance of this struct gets passed to the application callback.

Member Data Documentation

◆ [union]

union { ... } ble_gatt_access_ctxt

The GATT operation being performed dictates which field in this union is valid. If a characteristic is being accessed, the chr field is valid. Otherwise a descriptor is being accessed, in which case the dsc field is valid.

◆ chr

const struct ble_gatt_chr_def* ble_gatt_access_ctxt::chr

The characteristic definition corresponding to the characteristic being accessed. This is what the app registered at startup.

◆ dsc

const struct ble_gatt_dsc_def* ble_gatt_access_ctxt::dsc

The descriptor definition corresponding to the descriptor being accessed. This is what the app registered at startup.

◆ om

struct os_mbuf* ble_gatt_access_ctxt::om

A container for the GATT access data. o For reads: The application populates this with the value of the characteristic or descriptor being read. o For writes: This is already populated with the value being written by the peer. If the application wishes to retain this mbuf for later use, the access callback must set this pointer to NULL to prevent the stack from freeing it.

◆ op

uint8_t ble_gatt_access_ctxt::op

Indicates the gatt operation being performed. This is equal to one of the following values: o BLE_GATT_ACCESS_OP_READ_CHR o BLE_GATT_ACCESS_OP_WRITE_CHR o BLE_GATT_ACCESS_OP_READ_DSC o BLE_GATT_ACCESS_OP_WRITE_DSC