components/bt/host/bluedroid/stack/btm/btm_sec.c
///SMP_INCLUDED == TRUE
/*******************************************************************************
**
** Function         BTM_SecRegister
**
** Description      Application manager calls this function to register for
**                  security services.  There can be one and only one application
**                  saving link keys.  BTM allows only first registration.
**
** Returns          TRUE if registered OK, else FALSE
**
*******************************************************************************/


Description      Application manager calls this function to register for
security services.  There can be one and only one application
saving link keys.  BTM allows only first registration.

Returns          TRUE if registered OK, else FALSE
Description Application manager calls this function to register for security services . There can be one and only one application saving link keys . BTM allows only first registration . Returns TRUE if registered OK else FALSE
BOOLEAN BTM_SecRegister(tBTM_APPL_INFO *p_cb_info)
{
#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
    BT_OCTET16      temp_value = {0};
#endif
    BTM_TRACE_EVENT("%s application registered\n", __func__);
#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
    BTM_TRACE_DEBUG("%s p_cb_info->p_le_callback == 0x%p\n", __func__, p_cb_info->p_le_callback);
    if (p_cb_info->p_le_callback) {
        BTM_TRACE_EVENT("%s SMP_Register( btm_proc_smp_cback )\n", __func__);
        SMP_Register(btm_proc_smp_cback);
        if (memcmp(btm_cb.devcb.id_keys.ir, &temp_value, sizeof(BT_OCTET16)) == 0) {
            btm_ble_reset_id();
        }
#if (!BLE_UPDATE_BLE_ADDR_TYPE_RPA)
        BD_ADDR peer_addr = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
        BT_OCTET16 peer_irk = {0x0};
        btsnd_hcic_ble_add_device_resolving_list (0, peer_addr, peer_irk, btm_cb.devcb.id_keys.irk);
#endif
    } else {
        BTM_TRACE_WARNING("%s p_cb_info->p_le_callback == NULL\n", __func__);
    }
#endif
    btm_cb.api = *p_cb_info;
#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
    BTM_TRACE_DEBUG("%s btm_cb.api.p_le_callback = 0x%p\n", __func__, btm_cb.api.p_le_callback);
#endif
    BTM_TRACE_EVENT("%s application registered\n", __func__);
    return (TRUE);
}
BOOLEAN BTM_SecRegister ( tBTM_APPL_INFO * p_cb_info ) { #if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE BT_OCTET16 temp_value = { 0 } ; #endif BTM_TRACE_EVENT ( " \n " , __func__ ) ; #if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE BTM_TRACE_DEBUG ( " \n " , __func__ , p_cb_info -> p_le_callback ) ; if ( p_cb_info -> p_le_callback ) { BTM_TRACE_EVENT ( " \n " , __func__ ) ; SMP_Register ( btm_proc_smp_cback ) ; if ( memcmp ( btm_cb . devcb . id_keys . ir , & temp_value , sizeof ( BT_OCTET16 ) ) == 0 ) { btm_ble_reset_id ( ) ; } #if ( ! BLE_UPDATE_BLE_ADDR_TYPE_RPA ) BD_ADDR peer_addr = { 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 } ; BT_OCTET16 peer_irk = { 0x0 } ; btsnd_hcic_ble_add_device_resolving_list ( 0 , peer_addr , peer_irk , btm_cb . devcb . id_keys . irk ) ; #endif } else { BTM_TRACE_WARNING ( " \n " , __func__ ) ; } #endif btm_cb . api = * p_cb_info ; #if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE BTM_TRACE_DEBUG ( " \n " , __func__ , btm_cb . api . p_le_callback ) ; #endif BTM_TRACE_EVENT ( " \n " , __func__ ) ; return ( TRUE ) ; }
SMP_INCLUDED == TRUE
Function         BTM_SecRegister
SMP_INCLUDED == TRUE Function BTM_SecRegister
/* if no IR is loaded, need to regenerate all the keys */ /* add local irk to controller */