
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
79
Ver.1.0.0
HCI_ERR_INVALID_HCI_CMD_PARAMS
0x12
Duration Time
can’t be configured for
“ADV_TYPE_CONNECTABLE_DIR
ECTED_HIGH_DUTY”.
When Adv Duratrion Time expires, advertising is stopped, if users want to re-configure
adv parameters (such as AdvType, AdvInterval, AdvChannelMap), first the parameters
should be set in the callback function of the event
“BLT_EV_FLAG_ADV_DURATION_TIMEOUT”, then the “bls_ll_setAdvEnable(1)”
should be called to start new advertising.
To trigger the
“BLT_EV_FLAG_ADV_DURATION_TIMEOUT”, a special case should be
noted:
Suppose the “duration_us” is set as “2000000” (i.e. 2s).
If Slave stays in advertising state, when adv time reaches the preset 2s timeout, the
“BLT_EV_FLAG_ADV_DURATION_TIMEOUT” will be triggered to execute
corresponding callback function.
If Slave is connected with Master when adv time is less than the 2s timeout
(suppose adv time is 0.5s), the timeout timing is not cleared but cached in bottom
layer. When Slave stays in connection state for 1.5s (i.e. the preset 2s timeout
moment is reached), since Slave won’t check adv event timeout in connection state,
the callback of “BLT_EV_FLAG_ADV_DURATION_TIMEOUT” won’t be triggered.
When Slave stays in connection state for certain duration (e.g. 10s), then terminates
connection and returns to adv state, before it sends out the first adv packet, the
Stack will regard current time exceeds the preset 2s timeout and trigger the callback
of “BLT_EV_FLAG_ADV_DURATION_TIMEOUT”. In this case, the callback
triggering time largely exceeds the preset timeout moment.
3.2.8.10 blc_ll_setAdvCustomedChannel
The API below is used to customize special advertising channel/scanning channel, and it
only applies to some special a
pplications such as BLE mesh. It’s not recommended to
use this API for other conventional BLE applications.
void
blc_ll_setAdvCustomedChannel
(
u8
chn0,
u8
chn1,
u8
chn2);
chn0/chn1/chn2: customized channel. Default standard channel is 37/38/39. For
example, to set three advertising channels as 2420MHz, 2430MHz and 2450MHz, the
API below should be called:
blc_ll_setAdvCustomedChannel (8, 12, 22);
3.2.8.11 rf_set_power_level_index
5316 BLE SDK provides the API to set output power for BLE RF packet:
void
rf_set_power_level_index (int level);
For the setting of
“level” values, the enum variable
RF_TxPowerTypeDef
in
“drivers/5316/rf_drv.h” can be referred to.