次の方法で共有


BthGetLinkKey (Windows Embedded CE 6.0)

1/6/2010

This function retrieves the link key for the Bluetooth device.

Note

To preserve Win32 compatibility, consider using the Winsock equivalent of this function. To do so, pass SO_BTH_GET_LINK as the optname value in getsockopt.

Syntax

int BthGetLinkKey(
  BT_ADDR* pba,
  unsigned char key[16]
);

Parameters

  • pba
    [in] Pointer to the Bluetooth address.
  • key
    [in] Retrieves the link key for the Bluetooth device identified in pba. The active connection to the device is not necessary, nor is the presence of the Bluetooth controller.

Return Value

This function returns ERROR_SUCCESS when it completes successfully.

A return value of ERROR_SERVICE_NOT_ACTIVE indicates that the Bluetooth stack is not present.

Other standard error codes may be returned as appropriate.

Remarks

Typically, the Bluetooth stack manages link keys automatically, such as storing them when they are created. This function is mainly useful for backup purposes.

The link key length is 16 bytes. You cannot create link keys; they are generated by the Bluetooth hardware.

Requirements

Header bt_api.h
Library Btdrt.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

Bluetooth OS Functions

Other Resources

Bluetooth Application Development