Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
63
Ver.1.0.0
#define
BLT_EV_FLAG_RX_DATA_ABANDOM
16
#define
BLT_EV_FLAG_SMP_PINCODE_PROCESS 17
#define
BLT_EV_FLAG_SMP_KEY_MISSING 18
#define
BLT_EV_FLAG_PHY_UPDATE 19
Telink defined event is only used in BLE Slave applications (remote/module). There are
two methods to call back Telink defined events in BLE slave applications.
1) The first: Registering the callback function of each event independently, which we
call “independent registration.” The prototype of callback function is:
typedef void
(*blt_event_callback_t)(u8 e, u8 *p, int n);
“e”: event number.
“p”: It’s the pointer of the data transmitted from the bottom layer when callback
function is executed, and it varies with the callback functions.
“n”: length of valid data pointed by pointer.
The API for registering callback functions is:
void
bls_app_registerEventCallback
(
u8
e,
blt_event_callback_t
p);
2) The second: Callback functions of all the events share one entry. Whether the event
responds depends on if the corresponding event mask is enabled. This we call
“shared event entry”.
Registering event callback via “shared event entry” use the same API of HCI event:
typedef int
(*
hci_event_handler_t
) (
u32
h,
u8
*para,
int
n);
void
blc_hci_registerControllerEventHandler
(
hci_event_handler_t
handler
);
Even the same register callback function of HCI event is used, the implementation of
the function is slightly different.
HCI event callback function:
h = HCI_FLAG_EVENT_BT_STD | hci_event_code;
Telink defined event
“shared event entry”:
H = HCI_FLAG_EVENT_TLK_MODULE | e;
“e” is the event number of Telink defined event.
“shared event entry” of Telink defined event is similar to the mask of HCI event.
Whether each event repsonds depends on the mask set by the API below:
ble_sts_t
bls_hci_mod_setEventMask_cmd(u32 evtMask)
;
The relationship between evtMask and event number is:
evtMask = BIT(e);