次の方法で共有


BthTerminateIdleConnections (Compact 2013)

3/26/2014

This function disconnects all idle connections held by the L2CAP layer.

Syntax

int BthTerminateIdleConnections(void);

Parameters

None.

Return Value

Value

Description

ERROR_SUCCESS

Success.

ERROR_SERVICE_NOT_ACTIVE

The Bluetooth stack is not present.

Other standard HRESULT error codes may be returned as appropriate.

Remarks

Under typical circumstances, L2CAP does not immediately disconnect Asynchronous Connection-Oriented logical transport (ACL) connections that it is not using. Instead, an ACL connection is disconnected only after remaining unused during a registry-configurable time-out period. This time-out period avoids reconnection overhead in many important cases, such as an Service Discovery Protocol (SDP) query followed by a connection to the resource.

This function forces the L2CAP to immediately disconnect all idle connections. Typically, you do not have to call this function. This function might be useful, however, in a very limited number of cases in which the peer device does not support piconets but has to connect to another device. For example, a PDA establishes a connection to a Bluetooth-enabled phone and causes it to dial the number. Then it wants to disconnect immediately so that the phone that does not support piconets could establish a Bluetooth connection with the headset.

Requirements

Header

bt_api.h

Library

Btdrt.lib

See Also

Reference

Bluetooth API Management Functions
Bluetooth AG Service Functions
BthGetBasebandHandles