Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
60
Ver.1.0.0
4) HCI_EVT_LE_META
It indicates the current event is HCI LE event, and event types can be checked
according to sub event code.
Except for HCI_EVT_LE_META, other HCI events should use the API below to enable
corresponding event masks.
ble_sts_t
blc_hci_setEventMask_cmd
(
u32
evtMask);
//eventMask:
BT/EDR
The definitions of event masks are as follows:
#define
HCI_EVT_MASK_DISCONNECTION_COMPLETE 0x0000000010
#define
HCI_EVT_MASK_ENCRYPTION_CHANGE 0x0000000080
#define
HCI_EVT_MASK_READ_REMOTE_VERSION_INFORMATION_COMPLETE
0x0000000800
If users do not set HCI event masks via this API, only the mask corresponding to
“HCI_CMD_DISCONNECTION_COMPLETE” will be enabled in SDK by default, which
means SDK only ensures the report of Controller disconnect event by default.
3.2.6.2 HCI LE Event
When the event code in HCI event is
“HCI_EVT_LE_META”, it indicates it’s a HCI LE
event, common subevent code are shown as below:
#define
HCI_SUB_EVT_LE_CONNECTION_COMPLETE 0x01
#define
HCI_SUB_EVT_LE_ADVERTISING_REPORT 0x02
#define
HCI_SUB_EVT_LE_CONNECTION_UPDATE_COMPLETE
0x03
1) HCI_SUB_EVT_LE_CONNECTION_COMPLETE
Please refer to
Core_v5.0
(Vol 2/Part E/7.7.65.1
“LE Connection Complete Event”).
When Controller Link Layer establishes connection with peer device, this event will
be reported.
Total data length of this event is 22, and 1-
byte “param len” is 19, as shown below.
Please refer to BLE Spec for data definition.
hci
event
event
code
param
len
subevent
code
connection
handle
Role
peerAddr
type
peer addr
supervision
timeout
conn interval
conn latecncy
0x04
0x3e
19
0x01
status
master
clock
accuracy
Figure 3-16 LE Connection Complete Event
2) HCI_SUB_EVT_LE_ADVERTISING_REPORT
Please refer to
Core_v5.0
(Vol 2/Part E/7.7.65.2
“LE Advertising Report Event”).