Rtos API example

Embed: (wiki syntax)

« Back to documentation index

GattWriteCallbackParams Struct Reference

GattWriteCallbackParams Struct Reference
[Gatt]

GATT Write event definition. More...

#include <GattCallbackParamTypes.h>

Public Types

enum  WriteOp_t {
  OP_INVALID = 0x00, OP_WRITE_REQ = 0x01, OP_WRITE_CMD = 0x02, OP_SIGN_WRITE_CMD = 0x03,
  OP_PREP_WRITE_REQ = 0x04, OP_EXEC_WRITE_REQ_CANCEL = 0x05, OP_EXEC_WRITE_REQ_NOW = 0x06
}
 

Enumeration of allowed write operations.

More...

Data Fields

Gap::Handle_t connHandle
 Handle of the connection that triggered the event.
GattAttribute::Handle_t handle
 Handle of the attribute to which the write operation applies.
WriteOp_t writeOp
 Type of the write operation.
const uint8_t * data
 Pointer to the data to write.
uint16_t offset
 Offset within the attribute value to be written.
ble_error_t status
 Status of the GattClient Write operation.
uint16_t len
 Length (in bytes) of the data to write.
uint8_t error_code
 Error code of the GattClient Write operation.

Detailed Description

GATT Write event definition.

Instances of this type are created and passed to user registered callbacks whether the GattServer has received a write request or a GattClient has received a write response.

The GattServer only populates the fields offset, len and data when it has received a write request. Callbacks attached to the GattClient do not use those fields.

The GattClient only populates the fields status and error_code when it has received a write response. Callbacks attached to the GattServer do not use those fields.

Definition at line 42 of file GattCallbackParamTypes.h.


Member Enumeration Documentation

enum WriteOp_t

Enumeration of allowed write operations.

Enumerator:
OP_INVALID 

Invalid operation.

OP_WRITE_REQ 

Write request.

OP_WRITE_CMD 

Write command.

OP_SIGN_WRITE_CMD 

Signed write command.

OP_PREP_WRITE_REQ 

Prepare write request.

OP_EXEC_WRITE_REQ_CANCEL 

Execute write request: cancel all prepared writes.

OP_EXEC_WRITE_REQ_NOW 

Execute write request: immediately execute all prepared writes.

Definition at line 46 of file GattCallbackParamTypes.h.


Field Documentation

Handle of the connection that triggered the event.

Definition at line 86 of file GattCallbackParamTypes.h.

const uint8_t* data

Pointer to the data to write.

Data may not persist beyond the callback scope.

Reserved for GattServer registered callbacks.

Definition at line 137 of file GattCallbackParamTypes.h.

uint8_t error_code

Error code of the GattClient Write operation.

Reserved for GattClient registered callbacks.

Definition at line 127 of file GattCallbackParamTypes.h.

Handle of the attribute to which the write operation applies.

Definition at line 91 of file GattCallbackParamTypes.h.

uint16_t len

Length (in bytes) of the data to write.

Reserved for GattServer registered callbacks.

Definition at line 120 of file GattCallbackParamTypes.h.

uint16_t offset

Offset within the attribute value to be written.

Reserved for GattServer registered callbacks.

Definition at line 104 of file GattCallbackParamTypes.h.

Status of the GattClient Write operation.

Reserved for GattClient registered callbacks.

Definition at line 111 of file GattCallbackParamTypes.h.

Type of the write operation.

Definition at line 96 of file GattCallbackParamTypes.h.