Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1 78 Ver.1.0.0
ble_sts_t bls_ll_setAdvFilterPolicy(u8 advFilterPolicy);
The parameters of the three APIs are the same as “bls_ll_setAdvParam”.
Return value ble_sts_t:
1) “bls_ll_setAdvChannelMap” and “bls_ll_setAdvFilterPolicy” will always return
“BLE_SUCCESS”.
2) “bls_ll_setAdvInterval” will return “BLE_SUCCESS” or
“HCI_ERR_INVALID_HCI_CMD_PARAMS”.
3.2.8.8 bls_ll_setAdvEnable
Please refer to Core_v5.0 (Vol 2/Part E/ 7.8.9 “LE Set Advertising Enable Command”).
ble_sts_t bls_ll_setAdvEnable(u8 en);
en”: 1 - Enable Advertising; 0 - Disable Advertising.
1) In Idle state, by enabling Advertising, Link Layer will enter Advertising state.
2) In Advertising state, by disabling Advertising, Link Layer will enter Idle state.
3) In other states, neither enabling or disabling Advertising does not affect Link Layer
state.
4) ble_sts_t will always return “BLE_SUCCESS”.
3.2.8.9 bls_ll_setAdvDuration
ble_sts_t bls_ll_setAdvDuration (u32 duration_us, u8
duration_en);
After “bls_ll_setAdvParam” sets all adv parameters successfully, and the
“bls_ll_setAdvEnable(1)” is called to start advertising, the API “bls_ll_setAdvDuration”
can be called to set duration of adv event, so that advertising will be automatically
disabled after this duration.
“duration_en”: 1 - enable timing function; 0 - disable timing function. “duration_us”(unit:
us): The “duration_us” is valid only when the “duration_en” is set to 1.
The firmware starts timing from the set timing. When this duration expires, “AdvEnable”
becomes invalid, and advertising will stop. None Conn state will switch to Idle State. The
Link Layer event “BLT_EV_FLAG_ADV_DURATION_TIMEOUT” will be triggered.
As specified in BLE Spec, the duration time of adv type
“ADV_TYPE_CONNECTABLE_DIRECTED_HIGH_DUTY” should equal or less than
1.28s. The duration time in telink SDK is fixed as 1.28s, i.e. advertising will stop after the
1.28s duration. Therefore, for this adv type, calling “bls_ll_setAdvDuration” will be invalid.
The return value “ble_sts_t” is shown as below.