BthWriteLinkPolicySettings (Compact 2013)

3/26/2014

This function writes the link policy for the specified connection.

Syntax

int BthWriteLinkPolicySettings(
  BT_ADDR *pba,
  unsigned short lps
);

Parameters

  • pba
    [in] Pointer to the address that identifies the connection.
  • lps
    [in] The link policy for the connection.

    The following table shows the flags that can be used in combination.

    Flag

    Description

    0x0000

    Disables all LAN Manager (LM) modes.

    0x0001

    Enables the master/subordinate device switch.

    0x0002

    Enables hold mode.

    0x0004

    Enables sniff mode.

    0x0008

    Enables park mode.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_NOT_FOUND

An active connection to the specified connection does not exist.

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

The link policy is not persistent. It reverts to the default setting when the connection is closed.

For more information, see "Write Link Policy Settings" 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_LINK_POLICY.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Management Functions
Bluetooth AG Service Functions