/*******************************************************************************
*
* Function btm_ble_start_encrypt
*
* Description This function is called to start LE encryption.
*
*
* Returns BTM_SUCCESS if encryption was started successfully
*
******************************************************************************/
//debug_stamp
tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk,
BT_OCTET16 stk) {
tBTM_CB* p_cb = &btm_cb;
tBTM_SEC_DEV_REC* p_rec = btm_find_dev(bda);
BT_OCTET8 dummy_rand = {0};
BTM_TRACE_ERROR("btm_ble_start_encrypt");
if (!p_rec) {
BTM_TRACE_ERROR("Link is not active, can not encrypt!");
return BTM_WRONG_MODE;
}
if (p_rec->sec_state ==