Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
110
Ver.1.0.0
5316 BLE SDK supports both Legacy Pairing and Secure Connection Pairing, SDK uses
Legacy Pairing by default. If users want to use SC, call the function below:
void
blc_smp_enableScFlag
(
int
en);
en = 1, enable SC;
en = 0 (default), disable SC.
Please note that this function should be called in initialization.
3.5.2 Enable SMP
int
bls_smp_enableParing
(
smp_paringTrriger_t
encrypt_en);
The following introduces the definition of the enum
type “smp_paringTrriger_t” and
meanings of each parameter.
typedef enum
{
SMP_PARING_DISABLE_TRRIGER
= 0,
SMP_PARING_CONN_TRRIGER
,
SMP_PARING_PEER_TRRIGER
,
}
smp_paringTrriger_t
;
1) encrypt_en = SMP_PARING_DISABLE_TRRIGER;
It indicates pairing encryption is disabled for current device connection. Even if peer
device requests for pairing encryption, the device will reject this request.
It applies to the case when current device does not support encrypted pairing.
As shown below, Master sends pairing request, and then Slave responds with
“SM_Pairing_Failed”.
Figure 3-46 Pairing Disable
2) encrypt_en = SMP_PARING_CONN_TRRIGER;
It indicates current device will actively initiate pairing encryption request once it
’s
connected with peer device. If peer device initiates pairing request first, current
device will still send pairing request and also respond to the request from peer
device.
As shown below, Slave actively sends the
“SM_Security_Req”: