Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
76
Ver.1.0.0
ADV_TYPE_NONCONNECTABLE_UNDIRECTED
= 0x03,
//ADV_NONCONN_IND
ADV_TYPE_CONNECTABLE_DIRECTED_LOW_DUTY
= 0x04,
//ADV_INDIRECT_IND (low duty cycle)
}
advertising_type
;
By default, the most common adv event type is
ADV_TYPE_CONNECTABLE_UNDIRECTED
.
3) ownAddrType
It is used to specify MAC address type in adv packets.
There are two basic address types: public and random.
/* Device Address Type */
#define
BLE_ADDR_PUBLIC 0
#define
BLE_ADDR_RANDOM 1
There are four optional values for
“ownAddrType 4” to specify adv address type.
typedef enum
{
OWN_ADDRESS_PUBLIC
= 0,
OWN_ADDRESS_RANDOM
= 1,
OWN_ADDRESS_RESOLVE_PRIVATE_PUBLIC
= 2,
OWN_ADDRESS_RESOLVE_PRIVATE_RANDOM
= 3,
}
own_addr_type_t
;
Only two parameters are introduced herein.
OWN_ADDRESS_PUBLIC means using public MAC address for advertising. The
actual address is the set by
API “API blc_ll_initAdvertising_module(u8 *public_adr)”
in MAC address initialization.
OWN_ADDRESS_RANDOM means using random static MAC address for
advertising. The address is set by the API below.
blc_ll_setRandomAddr(mac_random_static);
4) peerAddrType and *peerAddr
When advType is set as directed adv type
(
ADV_TYPE_CONNECTABLE_DIRECTED_HIGH_DUTY
or
ADV_TYPE_CONNECTABLE_DIRECTED_LOW_DUTY
), the “peerAddrType” and
“*peerAddr” serve to specify the type and address of peer device MAC Address.
When advType is set as type other than directed adv, the two parameters are invalid,
and they can be set as “0” and “NULL”.