Share via


BthPairRequest (Compact 2013)

3/26/2014

This function begins the process of pairing with a remote device.

Syntax

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

Parameters

  • pba
    [in] Pointer to the address of the remote device.
  • cPinLength
    [in] Length of the PIN pointed to by ppin. The PIN length must be 1 through 16 characters.
  • ppin
    [in] Pointer to the PIN.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_INVALID_PARAMETER

The PIN length is incorrect.

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

Remarks

BthPairRequest passes the parameters to the BthSetPIN function and creates a connection. Once the connection is established, it calls the BthAuthenticate function to authenticate the 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).

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Security Management Functions
Bluetooth AG Service Functions