Functions

uint16_t ble_sec_params_set (ble_sec_param_t *p_sec_param)
 Set security parameter. More...
 
uint16_t ble_sec_params_set_with_role (ble_sec_param_t *p_sec_param, uint8_t role)
 Set security parameter for specific role. More...
 
uint16_t ble_sec_enc_start (uint8_t conn_idx)
 Start security encryption, this interface is used by both slave and master. More...
 
uint16_t ble_sec_enc_cfm (uint8_t conn_idx, const ble_sec_cfm_enc_t *p_cfm_enc)
 Send the encrypt confirm information. More...
 
uint16_t ble_sec_get_pair_info (uint8_t *p_iden_addr, uint8_t iden_addr_type, uint8_t *p_irk, uint8_t *p_ltk)
 Get the pair info by peer identity address. More...
 
uint16_t ble_sec_get_pair_info_by_conn_idx (uint8_t conn_idx, uint8_t *p_iden_addr, uint8_t *p_iden_addr_type, uint8_t *p_irk, uint8_t *p_ltk)
 Get the pair info by connection index. More...
 
bool ble_sec_check_bonded (uint8_t conn_idx)
 Check bonded state by connection index. More...
 
bool ble_sec_check_bonded_by_addr (ble_gap_bdaddr_t *p_peer_iden_addr)
 Check bonded state by peer address. More...
 
void ble_sec_ccc_sc_oob_pair_init (oob_info_cb_t p_cb)
 Init oob info for ccc sc pair. More...
 

Detailed Description

Function Documentation

◆ ble_sec_ccc_sc_oob_pair_init()

void ble_sec_ccc_sc_oob_pair_init ( oob_info_cb_t  p_cb)

Init oob info for ccc sc pair.

Parameters
[in]p_cbPointer to the callback for oob info.

◆ ble_sec_check_bonded()

bool ble_sec_check_bonded ( uint8_t  conn_idx)

Check bonded state by connection index.

Parameters
[in]conn_idxACL connection index.
Return values
::trueConnection is bonded.
::falseConnection is not bonded.

◆ ble_sec_check_bonded_by_addr()

bool ble_sec_check_bonded_by_addr ( ble_gap_bdaddr_t p_peer_iden_addr)

Check bonded state by peer address.

Parameters
[in]p_peer_iden_addrPointer to the peer identity address.
Return values
::truePeer address is bonded.
::falsePeer address is not bonded.

◆ ble_sec_enc_cfm()

uint16_t ble_sec_enc_cfm ( uint8_t  conn_idx,
const ble_sec_cfm_enc_t p_cfm_enc 
)

Send the encrypt confirm information.

Parameters
[in]conn_idxACL connection index, the first ACL connection index is 0, and increased one by one.
[in]p_cfm_encPointer to the confirm encryption structure, see ble_sec_cfm_enc_t.
Return values
SDK_SUCCESSThe confirm encryption is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_sec_enc_start()

uint16_t ble_sec_enc_start ( uint8_t  conn_idx)

Start security encryption, this interface is used by both slave and master.

Note
If the local device role is master, it will check that if the peer device is bonded firstly. If the peer device is bonded, the stack will encrypt the link directly, otherwise the stack will send a pair request to the peer device.
If the local device role is slave, the stack will send a security request to the peer device.
Parameters
[in]conn_idxACL connection index, the first ACL connection index is 0, and increased one by one.
Return values
SDK_SUCCESSThe security encryption is successfully set to the BLE stack.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.

◆ ble_sec_get_pair_info()

uint16_t ble_sec_get_pair_info ( uint8_t *  p_iden_addr,
uint8_t  iden_addr_type,
uint8_t *  p_irk,
uint8_t *  p_ltk 
)

Get the pair info by peer identity address.

Parameters
[in]p_iden_addrPointer to the identity address.
[in]iden_addr_typeIdentity address type.
[out]p_irkPointer to the irk.
[out]p_ltkPointer to the ltk.
Return values
SDK_SUCCESSSuccess to find the pair info.
SDK_ERR_LIST_ITEM_NOT_FOUNDFail to get the pair info.

◆ ble_sec_get_pair_info_by_conn_idx()

uint16_t ble_sec_get_pair_info_by_conn_idx ( uint8_t  conn_idx,
uint8_t *  p_iden_addr,
uint8_t *  p_iden_addr_type,
uint8_t *  p_irk,
uint8_t *  p_ltk 
)

Get the pair info by connection index.

Parameters
[in]conn_idxConnection index.
[out]p_iden_addrPointer to the identity address.
[out]p_iden_addr_typePointer to the identity address type.
[out]p_irkPointer to the irk.
[out]p_ltkPointer to the ltk.
Return values
SDK_SUCCESSSuccess to find the pair info.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_CONN_IDXInvalid connection index supplied.
SDK_ERR_LIST_ITEM_NOT_FOUNDItem not found in the bond list.

◆ ble_sec_params_set()

uint16_t ble_sec_params_set ( ble_sec_param_t p_sec_param)

Set security parameter.

Parameters
[in]p_sec_paramPointer to the security parameter structure, ble_sec_param_t.
Return values
SDK_SUCCESSThe security parameter is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_PARAMInvalid parameter supplied.

◆ ble_sec_params_set_with_role()

uint16_t ble_sec_params_set_with_role ( ble_sec_param_t p_sec_param,
uint8_t  role 
)

Set security parameter for specific role.

Parameters
[in]p_sec_paramPointer to the security parameter structure, ble_sec_param_t.
[in]role0: master role, 1: slave role, ble_gap_ll_role_type_t.
Return values
SDK_SUCCESSThe security parameter is successfully set to the BLE stack.
SDK_ERR_POINTER_NULLInvalid pointer supplied.
SDK_ERR_INVALID_PARAMInvalid parameter supplied.