Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
86
Ver.1.0.0
As specified in BLE Spec, L2CAP is mainly used for data transfer between Controller and
Host. Most work is finished in stack bottom layer with little involvement of the user. Users
only need to call the following APIs to set correspondingly.
3.3.1 Register L2CAP Data Processing Function
In BLE SDK architecture, Controller transfers data with Host via HCI. Data from HCI to
Host will be processed in L2CAP layer first. The API below serves to register this
processing function.
void
blc_l2cap_register_handler
(
void
*p);
In BLE Slave applications such as 5316 remote/5316 module, the function to process
data of Controller in L2CAP layer of SDK is shown as below:
int
blc_l2cap_packet_receive
(
u16
connHandle,
u8
* p);
This function is already implemented in stack, which it will analyze the received data and
transfer the data to ATT or SMP.
Initialization:
blc_l2cap_register_handler (blc_l2cap_packet_receive)
;
In 5316 hci, only Slave controller is implemented. F
unction “blc_hci_sendACLData2Host”
serves to transmit data of controller to BLE Host device via hardware interface such as
UART.
int
blc_hci_sendACLData2Host
(
u16
handle
,
u8
*p)
Initialization:
blc_l2cap_register_handler (blc_hci_sendACLData2Host);