Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
77
Ver.1.0.0
5) adv_channelMap
The
“adv_channelMap” is used to set advertising channel. It can choose any one or
more of channel 37, 38, 39.
The value “adv_channelMap” can be the following three
or any combination of the three.
#define
BLT_ENABLE_ADV_37
BIT(0)
#define
BLT_ENABLE_ADV_38
BIT(1)
#define
BLT_ENABLE_ADV_39
BIT(2)
#define
BLT_ENABLE_ADV_ALL
(BLT_ENABLE_ADV_37 | BLT_ENABLE_ADV_38 |
BLT_ENABLE_ADV_39)
6) advFilterPolicy
The
“advFilterPolicy” serves to set filtering policy for scan request/connect request
from other device when adv packet is transmitted. Address to be filtered needs to be
pre-loaded in whitelist.
Filte
ring type options are shown as below. The “ADV_FP_NONE” can be selected if
whitelist filter is not needed.
#define
ADV_FP_ALLOW_SCAN_ANY_ALLOW_CONN_ANY 0x00
#define
ADV_FP_ALLOW_SCAN_WL_ALLOW_CONN_ANY 0x01
#define
ADV_FP_ALLOW_SCAN_ANY_ALLOW_CONN_WL 0x02
#define
ADV_FP_ALLOW_SCAN_WL_ALLOW_CONN_WL 0x03
#define
ADV_FP_NONE ADV_FP_ALLOW_SCAN_ANY_ALLOW_CONN_ANY
The table below lists possible values and reasons for the return value
“ble_sts_t”.
ble_sts_t
Value
ERR Reason
BLE_SUCCESS
0
HCI_ERR_INVALID_HCI_CMD_PARA
MS
0x12
The value of intervalMin or
intervalMax does not meet the
requirement of BLE Spec.
According to Host command design in HCI part of BLE Spec, eight parameters are
configured simultaneously by the
API “bls_ll_setAdvParam”. This setting also takes some
coupling parameters into consideration. For example, the “advType” has limits to the
setting of intervalMin and intervalMax, and range check depends on the advType; if
advType and advInterval are set in two APIs, the range check is uncontrollable.
Considering users may often modify some common parameters, three independent APIs
are provided, so that users can directly call one API to modify corresponding
parameter(s), rather than call
ing the “bls_ll_setAdvParam” to set eight parameters
simultaneously.
ble_sts_t
bls_ll_setAdvInterval
(
u16
intervalMin,
u16
intervalMax);
ble_sts_t
bls_ll_setAdvChannelMap
(
u8
adv_channelMap);