Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
52
Ver.1.0.0
irq_blt_sdk_handler ();
……
}
void
main_loop
(
void
)
{
///////////////////// BLE entry ////////////////////////////
blt_sdk_main_loop();
////////////////////// UI entry ////////////////////////////
……
}
F
unction “blt_sdk_main_loop” at BLE entry serves to process data and events related to
BLE protocol stack. UI entry is for user application code.
3.2.4.1 Timing Sequence in Idle State
When Link Layer is in Idle state, no task is processed in Link Layer and Physical Layer,
function “blt_sdk_main_loop” doesn’t work and won’t generate any interrupt, i.e. the
whole timing sequence of mainloop is occupied by UI entry.
3.2.4.2 Timing Sequence in Advertising State
Adv event
Adv event
Adv interval
chn 37
chn 38
chn 39
TX
RX
TX
TX
RX
RX
UI task/suspend
UI task/suspend
Figure 3-9 Timing Sequence in Advertising State
, an Adv event is triggered by Link Layer during each adv interval.
A typical Adv event with three active adv channels will send an advertising packet in
channel 37, 38 and 39, respectively. After an adv packet is sent, Slave enters Rx state,
and waits for response from Master: If Slave receives a scan request from Master, it will
send a scan response to Master; if Slave receives a connect request from Master, it will
establish BLE connection with Master and enter Connection state Slave Role.
It should be noted that the code of adv event
is executed in function “blt_sdk_main_loop”
of mainloop. Therefore, adv event will not occupy irq time and lead to failure in real-time
irq response.