Share via


BthAnswerPairRequest (Compact 2013)

3/26/2014

This function responds to a request for the personal identification number (PIN) for a Bluetooth device.

Syntax

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

Parameters

  • pba
    [in] Pointer to the address of the remote device.
  • cPinLength
    [in] PIN length. Must be 1 through 16 bytes.
  • 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 outside the limits.

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

This function is called after a device receives a pairing request. This function passes the parameters to the BthSetPIN function and waits for the pairing to be established.

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