components/bt/host/bluedroid/stack/btm/btm_sec.c
/*******************************************************************************
**
** Function         BTM_SecBondByTransport
**
** Description      This function is called to perform bonding with peer device.
**                  If the connection is already up, but not secure, pairing
**                  is attempted.  If already paired BTM_SUCCESS is returned.
**
** Parameters:      bd_addr      - Address of the device to bond
**                  transport    - doing SSP over BR/EDR or SMP over LE
**                  pin_len      - length in bytes of the PIN Code
**                  p_pin        - pointer to array with the PIN Code
**                  trusted_mask - bitwise OR of trusted services (array of UINT32)
**
**  Note: After 2.1 parameters are not used and preserved here not to change API
*******************************************************************************/
Function         BTM_SecBondByTransport
Description      This function is called to perform bonding with peer device.
If the connection is already up, but not secure, pairing
is attempted.  If already paired BTM_SUCCESS is returned.



After 2.1 parameters are not used and preserved here not to change API
Function BTM_SecBondByTransport Description This function is called to perform bonding with peer device . If the connection is already up but not secure pairing is attempted . If already paired BTM_SUCCESS is returned . After 2 . 1 parameters are not used and preserved here not to change API
tBTM_STATUS BTM_SecBondByTransport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
                                    UINT8 pin_len, UINT8 *p_pin, UINT32 trusted_mask[])
{
#if (BLE_INCLUDED == TRUE)
    tBT_DEVICE_TYPE     dev_type;
    tBLE_ADDR_TYPE      addr_type;
    BTM_ReadDevInfo(bd_addr, &dev_type, &addr_type);
    if ((transport == BT_TRANSPORT_LE && (dev_type & BT_DEVICE_TYPE_BLE) == 0) ||
            (transport == BT_TRANSPORT_BR_EDR && (dev_type & BT_DEVICE_TYPE_BREDR) == 0)) {
        return BTM_ILLEGAL_ACTION;
    }
#endif  
    return btm_sec_bond_by_transport(bd_addr, transport, pin_len, p_pin, trusted_mask);
}
tBTM_STATUS BTM_SecBondByTransport ( BD_ADDR bd_addr , tBT_TRANSPORT transport , UINT8 pin_len , UINT8 * p_pin , UINT32 trusted_mask [ ] ) { #if ( BLE_INCLUDED == TRUE ) tBT_DEVICE_TYPE dev_type ; tBLE_ADDR_TYPE addr_type ; BTM_ReadDevInfo ( bd_addr , & dev_type , & addr_type ) ; if ( ( transport == BT_TRANSPORT_LE && ( dev_type & BT_DEVICE_TYPE_BLE ) == 0 ) || ( transport == BT_TRANSPORT_BR_EDR && ( dev_type & BT_DEVICE_TYPE_BREDR ) == 0 ) ) { return BTM_ILLEGAL_ACTION ; } #endif return btm_sec_bond_by_transport ( bd_addr , transport , pin_len , p_pin , trusted_mask ) ; }
Function         BTM_SecBondByTransport
Description      This function is called to perform bonding with peer device.
Function BTM_SecBondByTransport Description This function is called to perform bonding with peer device .
/* LE device, do SMP pairing */ ///BLE_INCLUDED == TRUE