次の方法で共有


BthEnterSniffMode (Compact 2013)

3/26/2014

This function places the Asynchronous Connection-Oriented logical transport (ACL) connection to the peer device in sniff mode.

Syntax

int BthEnterSniffMode(
  BT_ADDR *pba,
  unsigned short sniff_mode_max,
  unsigned short sniff_mode_min,
  unsigned short sniff_attempt,
  unsigned short sniff_timeout,
  unsigned short *pinterval
);

Parameters

  • pba
    [in] Pointer to the Bluetooth address of the peer device.
  • sniff_mode_max
    [in] The maximum acceptable time between sniff periods in Baseband slots (0.625 milliseconds).The value can range from 0x0001 through 0xFFFF and represents 0.625 ms through 40.9 seconds.
  • sniff_mode_min
    [in] The minimum acceptable time between sniff periods in Baseband slots (0.625 milliseconds).The value can range from 0x0001 through 0xFFFF and represents 0.625 ms through 40.9 seconds.
  • sniff_attempt
    [in] The time for the sniff attempt in Baseboard receive slots (0.625 milliseconds). The time length is equal to (2 * sniff_attempt -1) * 0.625 msec. The value can range from 0x0001 through 0x7FFF and represents 0.625 ms through 40.9 seconds.
  • sniff_timeout
    [in] The sniff timeout in Baseboard receive slots (0.625 milliseconds). Zero specifies no timeout. If sniff_timeout is greater than zero, the time length is equal to (2 * sniff_attempt -1) * 0.625 msec. If sniff_timeout is zero, the time length is 0 msec. The value can range from 0x0001 through 0x7FFF and represents 0.625 ms through 40.9 seconds.
  • pinterval
    [out] The time between sniff intervals in Baseband slots (0.625 milliseconds).

Return Value

The following table shows the possible return values.

Value

Description

ERROR_SUCCESS

Success.

ERROR_NOT_FOUND

An active connection to the specified peer 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

For more in formation, see "Sniff Mode" in the Core Specification v2.1 + EDR on the Bluetooth website.

Note

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

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Management Functions
Bluetooth AG Service Functions
BthExitSniffMode