File syn_ble_gatt.c¶
FileList > ble > syn_ble_gatt.c
Go to the source code of this file
Zero-Heap Generic Attribute Profile (GATT) Implementation.
#include "syn_ble_gatt.h"#include <string.h>
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. |
Public Static Functions¶
| Type | Name |
|---|---|
| const SYN_BLE_GATT_Attr * | find_attr (const SYN_BLE_GATT * gatt, uint16_t handle) Internal attribute lookup helper. |
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.
Public Static Functions Documentation¶
function find_attr¶
Internal attribute lookup helper.
Parameters:
gattGATT server handle.handleAttribute handle.
Returns:
Attribute pointer or NULL.
The documentation for this class was generated from the following file src/syntropic/ble/syn_ble_gatt.c