Share via


BthAuthenticateEx (Compact 2013)

3/26/2014

This function authenticates a Bluetooth peer device with specific connection characteristics.

Syntax

DWORD BthAuthenticateEx(
  const BT_ADDR *pRemoteDevice,
    const BTSecurityLevel RequiredSecurityLevel,
    const BTSSPBondingType BondingType,
    const BOOL PersistKey
);

Parameters

  • pRemoteDevice
    [in] Pointer to the address of device to authenticate.
  • RequiredSecurityLevel
    [in] Security level required of the shared link key. For more information, see BTSecurityLevel
  • BondingType
    [in] The type of bonding to use. For a description of bonding modes, see BTSSPBondingType.
  • PersistKey
    [in] Specify TRUE to have the stack save any newly-generated link key for use in later connections.; FALSE otherwise.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_NOT_AUTHENTICATED

The required security level cannot be achieved or the peer device aborted the connection or pairing operation.

Remarks

This function authenticates a peer device, connecting to it if necessary. The local and peer devices verify that they share a link key. The shared link key indicates a pre-existing relationship between the devices.

The link key must meet the security requirements specified by the RequiredSecurityLevel parameter. If an existing link key does not meet those requirements or the devices do not share a link key, a new link key is generated.

If a new link key is generated, the authentication process may include user interaction to verify the identity of one or both devices, depending on the RequiredSecurityLevel argument, the devices’ I/O capabilities, and the presence of out-of-band authentication data.

Requirements

Header

bt_api.h

Library

Btd.lib,
Btdrt.lib

See Also

Reference

Bluetooth API Security Management Functions
Bluetooth API Management Functions
BTSecurityLevel
BTSSPBondingType