components/bt/host/bluedroid/stack/btm/btm_sec.c
/*******************************************************************************
**
** Function         BTM_SecGetDeviceLinkKey
**
** Description      This function is called to obtain link key for the device
**                  it returns BTM_SUCCESS if link key is available, or
**                  BTM_UNKNOWN_ADDR if Security Manager does not know about
**                  the device or device record does not contain link key info
**
** Parameters:      bd_addr      - Address of the device
**                  link_key     - Link Key is copied into this array
**
*******************************************************************************/
Function         BTM_SecGetDeviceLinkKey
Description      This function is called to obtain link key for the device
it returns BTM_SUCCESS if link key is available, or
BTM_UNKNOWN_ADDR if Security Manager does not know about
the device or device record does not contain link key info

bd_addr      - Address of the device
link_key     - Link Key is copied into this array
Function BTM_SecGetDeviceLinkKey Description This function is called to obtain link key for the device it returns BTM_SUCCESS if link key is available or BTM_UNKNOWN_ADDR if Security Manager does not know about the device or device record does not contain link key info bd_addr - Address of the device link_key - Link Key is copied into this array
tBTM_STATUS BTM_SecGetDeviceLinkKey (BD_ADDR bd_addr, LINK_KEY link_key)
{
    tBTM_SEC_DEV_REC *p_dev_rec;
    if (((p_dev_rec = btm_find_dev (bd_addr)) != NULL)
            && (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN)) {
        memcpy (link_key, p_dev_rec->link_key, LINK_KEY_LEN);
        return (BTM_SUCCESS);
    }
    return (BTM_UNKNOWN_ADDR);
}
tBTM_STATUS BTM_SecGetDeviceLinkKey ( BD_ADDR bd_addr , LINK_KEY link_key ) { tBTM_SEC_DEV_REC * p_dev_rec ; if ( ( ( p_dev_rec = btm_find_dev ( bd_addr ) ) != NULL ) && ( p_dev_rec -> sec_flags & BTM_SEC_LINK_KEY_KNOWN ) ) { memcpy ( link_key , p_dev_rec -> link_key , LINK_KEY_LEN ) ; return ( BTM_SUCCESS ) ; } return ( BTM_UNKNOWN_ADDR ) ; }
Function         BTM_SecGetDeviceLinkKey
Description      This function is called to obtain link key for the device
it returns BTM_SUCCESS if link key is available, or
BTM_UNKNOWN_ADDR if Security Manager does not know about
the device or device record does not contain link key info
Function BTM_SecGetDeviceLinkKey Description This function is called to obtain link key for the device it returns BTM_SUCCESS if link key is available or BTM_UNKNOWN_ADDR if Security Manager does not know about the device or device record does not contain link key info