Compartilhar via


BthWriteAuthenticationEnable (Compact 2013)

3/26/2014

This function sets the value for the authentication setting.

Syntax

int BthWriteAuthenticationEnable(
  unsigned char ae
);

Parameters

  • ae
    [in] Specifies whether authentication is enabled or disabled:

    • A value of 0x00 indicates that authentication is disabled.
    • A value of 0x01 indicates that authentication is enabled for all connections.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

The authentication setting controls whether the local device is required to authenticate at the remote device when setting up the connection. The authentication occurs between the request for, or acceptance of, a connection and the completion of connection setup.

Authentication setting is not persistent. It reverts to the default setting when the adapter is reinitialized. For example, when the adapter is reinserted or the device is powered down.

For more information, see "Write Authentication Enable" in the Core Specification v2.1 + EDR on the Bluetooth web site.

Note

To preserve Microsoft Win32 compatibility, consider using the Winsock equivalent of this function. To do so, set the optname parameter in the setsockopt function to SO_BTH_SET_AUTHN_ENABLE.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Management Functions
Bluetooth AG Service Functions