Share via


BthSetEncryption (Compact 2013)

3/26/2014

This function requests that the encryption mode on an existing connection be switched.

Syntax

int BthSetEncryption(
  BT_ADDR *pba,
  int fOn
);

Parameters

  • pba
    [in] Pointer to the address of the remote device.
  • fOn
    [in] Specify TRUE to request enabling encryption mode on the specified connection; otherwise, specify FALSE.

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

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_ENCRYPT.

Requirements

Header

bt_api.h

Library

Btd.lib,
Btdrt.lib

See Also

Reference

Bluetooth API Security Management Functions
Bluetooth AG Service Functions