Share via


BthPairRequest (Windows Embedded CE 6.0)

1/6/2010

This function requests the personal identification number (PIN) for a Bluetooth device.

Note

The PIN is an ASCII string that is not terminated by \0. Although it can be any binary data, it is typically limited to digits that can be dialed on the phone (0-9) or typed on a computer keyboard (alphanumeric characters).

Syntax

int BthPairRequest ( 
  BT_ADDR* pba, 
  int cPinLength, 
  unsigned char *ppin
);

Parameters

  • pba
    [in] Points to BT_ADDR that stores the address of the peer device.
  • cPinLength
    [in] PIN length must be between 1 and 16 bytes.
  • ppin
    [in] Pointer to the PIN.

Return Value

If pairing is established between two Bluetooth devices, then this function returns ERROR_SUCCESS. Other standard error codes may be returned as appropriate.

Remarks

BthPairRequest passes the parameters to the BthSetPIN function and creates an ACL connection. Once the connection is established, it calls the BthAuthenticate function to authenticate the device.

BT_ADDR is defined in Ws2bth.h:

typedef ULONGLONG bt_addr, *pbt_addr, BT_ADDR, *PBT_ADDR;

Requirements

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

See Also

Reference

Bluetooth OS Functions

Concepts

Winsock Extensions

Other Resources

Bluetooth Application Development