File syn_ble_l2cap.h¶
FileList > ble > syn_ble_l2cap.h
Go to the source code of this file
Zero-Heap BLE Logical Link Control and Adaptation Protocol (L2CAP).
#include "../common/syn_defs.h"#include "syn_ble_hci.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_BLE_L2CAP_Connection |
| struct | SYN_BLE_L2CAP_s |
Public Types¶
| Type | Name |
|---|---|
| typedef void(* | SYN_BLE_L2CAP_RxCb |
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_ble_l2cap_connect (SYN_BLE_L2CAP * l2cap, uint16_t conn_handle) Register connection handle. |
| SYN_Status | syn_ble_l2cap_disconnect (SYN_BLE_L2CAP * l2cap, uint16_t conn_handle) Unregister connection handle. |
| SYN_Status | syn_ble_l2cap_encode_pdu (uint16_t conn_handle, uint16_t cid, const uint8_t * payload, uint16_t len, uint8_t * tx_buf, uint16_t * tx_len) Encode L2CAP PDU for transmission over HCI ACL. |
| SYN_Status | syn_ble_l2cap_init (SYN_BLE_L2CAP * l2cap, SYN_BLE_L2CAP_RxCb rx_cb, void * user_data) Initialize L2CAP engine context. |
| SYN_Status | syn_ble_l2cap_process_acl (SYN_BLE_L2CAP * l2cap, uint16_t conn_handle, uint8_t pb_bc_flags, const uint8_t * data, uint16_t len) Process incoming ACL packet from HCI layer. |
Macros¶
| Type | Name |
|---|---|
| define | SYN_BLE_L2CAP_BUF_SIZE 256U |
| define | SYN_BLE_L2CAP_CID_ATT 0x0004U |
| define | SYN_BLE_L2CAP_CID_SIGNALING 0x0005U |
| define | SYN_BLE_L2CAP_CID_SMP 0x0006U |
| define | SYN_BLE_MAX_CONNECTIONS 2U |
Public Types Documentation¶
typedef SYN_BLE_L2CAP_RxCb¶
typedef void(* SYN_BLE_L2CAP_RxCb) (SYN_BLE_L2CAP *l2cap, uint16_t conn_handle, uint16_t cid, const uint8_t *payload, uint16_t len, void *user_data);
L2CAP PDU Received Callback
Public Functions Documentation¶
function syn_ble_l2cap_connect¶
Register connection handle.
Parameters:
l2capContext handle pointer.conn_handleConnection handle assigned by HCI.
Returns:
SYN_OK on success.
function syn_ble_l2cap_disconnect¶
Unregister connection handle.
Parameters:
l2capContext handle pointer.conn_handleConnection handle assigned by HCI.
Returns:
SYN_OK on success.
function syn_ble_l2cap_encode_pdu¶
Encode L2CAP PDU for transmission over HCI ACL.
SYN_Status syn_ble_l2cap_encode_pdu (
uint16_t conn_handle,
uint16_t cid,
const uint8_t * payload,
uint16_t len,
uint8_t * tx_buf,
uint16_t * tx_len
)
Parameters:
conn_handleConnection handle.cidChannel ID (e.g. SYN_BLE_L2CAP_CID_ATT).payloadPDU payload buffer.lenPayload length.tx_bufOutput buffer for HCI ACL frame.tx_lenOutput size pointer.
Returns:
SYN_OK on success.
function syn_ble_l2cap_init¶
Initialize L2CAP engine context.
Parameters:
l2capContext handle pointer.rx_cbPDU receive callback.user_dataUser context pointer.
Returns:
SYN_OK on success.
function syn_ble_l2cap_process_acl¶
Process incoming ACL packet from HCI layer.
SYN_Status syn_ble_l2cap_process_acl (
SYN_BLE_L2CAP * l2cap,
uint16_t conn_handle,
uint8_t pb_bc_flags,
const uint8_t * data,
uint16_t len
)
Parameters:
l2capContext handle pointer.conn_handleConnection handle.pb_bc_flagsPacket boundary/broadcast flags.dataACL payload.lenPayload length.
Returns:
SYN_OK on success.
Macro Definition Documentation¶
define SYN_BLE_L2CAP_BUF_SIZE¶
Maximum reassembled L2CAP PDU size
define SYN_BLE_L2CAP_CID_ATT¶
Attribute Protocol (ATT) Channel
define SYN_BLE_L2CAP_CID_SIGNALING¶
LE Signaling Channel
define SYN_BLE_L2CAP_CID_SMP¶
Security Manager Protocol (SMP) Channel
define SYN_BLE_MAX_CONNECTIONS¶
Maximum active BLE connection handles
The documentation for this class was generated from the following file src/syntropic/ble/syn_ble_l2cap.h