Compartilhar via


BthCreateSynchronousConnection (Compact 2013)

3/26/2014

This function creates a synchronous connection to the specified device.

Syntax

int BthCreateSynchronousConnection
(
BT_ADDR         *pbt,
unsigned short  *pHandle,
unsigned int    txBandwidth,
unsigned int    rxBandwidth,
unsigned short  maxLatency,
unsigned short  voiceSetting,
unsigned char   retransmit
);

Parameters

  • pbt
    [in] Pointer to the Bluetooth address.
  • phandle
    [out] Pointer to the connection handle.
  • txBandwidth
    [in] Transmit bandwidth in octets per second.
  • rxBandwidth
    [in] Receive bandwidth in octets per second.
  • maxLatency
    [in] Maximum latency in milliseconds. Must be in the range of 0x0004 through 0xFFFF. 0xFFFF specifies no maximum.
  • voiceSetting
    [in] Encoding and data format settings for voice connections. For values, see "VOICE SETTING" in the Bluetooth Core V2.1 + EDR specification.
  • retransmit
    [in] Retransmission effort. Only the following values are valid; all other values are reserved.

    Value

    Description

    0x00

    No retransmissions.

    0x01

    At least one retransmission; optimize for power consumption.

    0x02

    At least one retransmission; optimize for link quality.

    0xFF

    Does not matter.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_CONNECTION_INVALID

No asynchronous connection-oriented link (ACL) found.

ERROR_OUTOFMEMORY

Unable to create HCI command.

ERROR_INTERNAL_ERROR

HCI call failed.

ERROR_TIMEOUT

HCI call timed out.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Connection Functions