File syn_ble_gatt.h¶
FileList > ble > syn_ble_gatt.h
Go to the source code of this file
Zero-Heap Generic Attribute Profile (GATT) Server Engine.
#include "../common/syn_defs.h"#include "syn_ble_att.h"#include "syn_ble_l2cap.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_BLE_GATT_Attr |
| struct | SYN_BLE_GATT_s |
Public Types¶
| Type | Name |
|---|---|
| typedef SYN_Status(* | SYN_BLE_GATT_ReadCb |
| typedef SYN_Status(* | SYN_BLE_GATT_WriteCb |
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_ble_gatt_init (SYN_BLE_GATT * gatt, const SYN_BLE_GATT_Attr * table, uint16_t table_len, void * user_data) Initialize GATT Server context. |
| SYN_Status | syn_ble_gatt_notify (SYN_BLE_GATT * gatt, uint16_t conn_handle, uint16_t attr_handle, const uint8_t * val, uint16_t val_len, uint8_t * tx_buf, uint16_t * tx_len) Encode Outbound GATT Notification for attribute. |
| SYN_Status | syn_ble_gatt_process_att_pdu (SYN_BLE_GATT * gatt, uint16_t conn_handle, const uint8_t * att_pdu, uint16_t pdu_len, uint8_t * resp_buf, uint16_t * resp_len) Process incoming ATT PDU received over L2CAP channel 0x0004. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_BLE_MAX_ATTRIBUTES 32U |
| define | SYN_BLE_PROP_INDICATE 0x20U |
| define | SYN_BLE_PROP_NOTIFY 0x10U |
| define | SYN_BLE_PROP_READ 0x02U |
| define | SYN_BLE_PROP_WRITE 0x08U |
| define | SYN_BLE_PROP_WRITE_CMD 0x04U |
| define | SYN_BLE_UUID_CCCD 0x2902U |
| define | SYN_BLE_UUID_CHARACTERISTIC 0x2803U |
| define | SYN_BLE_UUID_PRIMARY_SERVICE 0x2800U |
| define | SYN_BLE_UUID_SECONDARY_SERVICE 0x2801U |
Public Types Documentation¶
typedef SYN_BLE_GATT_ReadCb¶
typedef SYN_Status(* SYN_BLE_GATT_ReadCb) (SYN_BLE_GATT *gatt, uint16_t conn_handle, uint16_t attr_handle, uint8_t *val, uint16_t *val_len, void *user_data);
Attribute Read Callback
typedef SYN_BLE_GATT_WriteCb¶
typedef SYN_Status(* SYN_BLE_GATT_WriteCb) (SYN_BLE_GATT *gatt, uint16_t conn_handle, uint16_t attr_handle, const uint8_t *val, uint16_t val_len, void *user_data);
Attribute Write Callback
Public Functions Documentation¶
function syn_ble_gatt_init¶
Initialize GATT Server context.
SYN_Status syn_ble_gatt_init (
SYN_BLE_GATT * gatt,
const SYN_BLE_GATT_Attr * table,
uint16_t table_len,
void * user_data
)
Parameters:
gattContext handle pointer.tableAttribute table array pointer.table_lenCount of attribute entries.user_dataUser context pointer.
Returns:
SYN_OK on success.
function syn_ble_gatt_notify¶
Encode Outbound GATT Notification for attribute.
SYN_Status syn_ble_gatt_notify (
SYN_BLE_GATT * gatt,
uint16_t conn_handle,
uint16_t attr_handle,
const uint8_t * val,
uint16_t val_len,
uint8_t * tx_buf,
uint16_t * tx_len
)
Parameters:
gattContext handle pointer.conn_handleTarget connection handle.attr_handleTarget characteristic value attribute handle.valValue buffer pointer.val_lenValue byte length.tx_bufOutput buffer for HCI ACL payload.tx_lenOutput size pointer.
Returns:
SYN_OK on success.
function syn_ble_gatt_process_att_pdu¶
Process incoming ATT PDU received over L2CAP channel 0x0004.
SYN_Status syn_ble_gatt_process_att_pdu (
SYN_BLE_GATT * gatt,
uint16_t conn_handle,
const uint8_t * att_pdu,
uint16_t pdu_len,
uint8_t * resp_buf,
uint16_t * resp_len
)
Parameters:
gattContext handle pointer.conn_handleConnection handle.att_pduReceived ATT PDU buffer.pdu_lenPDU length.resp_bufBuffer to store outbound ATT Response PDU.resp_lenPointer to store response size.
Returns:
SYN_OK on success.
Macro Definition Documentation¶
define SYN_BLE_MAX_ATTRIBUTES¶
Maximum GATT attribute table capacity
define SYN_BLE_PROP_INDICATE¶
Indicate Property
define SYN_BLE_PROP_NOTIFY¶
Notify Property
define SYN_BLE_PROP_READ¶
Read Property
define SYN_BLE_PROP_WRITE¶
Write Request Property
define SYN_BLE_PROP_WRITE_CMD¶
Write Command (Without Response) Property
define SYN_BLE_UUID_CCCD¶
Client Characteristic Configuration Descriptor UUID
define SYN_BLE_UUID_CHARACTERISTIC¶
Characteristic Declaration UUID
define SYN_BLE_UUID_PRIMARY_SERVICE¶
Primary Service Declaration UUID
define SYN_BLE_UUID_SECONDARY_SERVICE¶
Secondary Service Declaration UUID
The documentation for this class was generated from the following file src/syntropic/ble/syn_ble_gatt.h