Share via


BthGetCurrentMode (Compact 2013)

3/26/2014

This function retrieves the current mode of the Asynchronous Connection-Oriented (ACL) connection to the specified remote device.

Syntax

int BthGetCurrentMode(
  BT_ADDR *pba,
  unsigned char *pmode
);

Parameters

  • pba
    [in] Pointer to the Bluetooth address.
  • pmode
    [out] Pointer to the current mode of the specified ACL connection.

    The following table shows the possible values.

    Value

    Description

    0x00

    Active mode.

    0x01

    Hold mode.

    0x02

    Sniff mode.

    0x03

    Park mode.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_NOT_FOUND

An active ACL connection to the specified device does not exist.

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

This function is equivalent to sending the BTH_HCI_IOCTL_GET_HANDLE_MODE HCI IOCTL message.

Note

To preserve Win32 compatibility, consider using the Winsock equivalent of this function. To do so, set the optname parameter in the getsockopt function to SO_BTH_GET_MODE.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Management Functions
Bluetooth AG Service Functions