Partager via


BthPairRequest (Windows CE 5.0)

Send Feedback

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

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 Values

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

OS Versions: Windows CE 5.0 and later.
Header: Bt_api.h.
Link Library: Btdrt.lib.

See Also

Bluetooth OS Functions | Bluetooth Application Development | Winsock Extensions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.