次の方法で共有


BthTerminateIdleConnections (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

int BthTerminateIdleConnections(void);

Parameters

None.

Return Value

This function returns ERROR_SUCCESS when it completes successfully.

A return value of ERROR_SERVICE_NOT_ACTIVE indicates that the hardware is not inserted or that the Bluetooth stack is not present.

Other standard error codes may be returned as appropriate.

Remarks

When this function is successful and connections have been disconnected, L2CAP does not immediately disconnect ACL connections to peers. Instead, it keeps idle connections for a registry-configured timeout. This avoids reconnection overhead in many important cases, such as an SDP query followed by a connection to the resource.

This function forces all currently idle connections to be disconnected immediately. Typically, you do not need to call this function. The stack uses it internally to drop existing connections on controllers that do not support piconets.

It could be useful, however, in a very limited number of cases where the peer device does not support piconets but needs to connect to another device. For example, PDA establishes connection to a Bluetooth-enabled phone and causes it to dial the number. It then wants to disconnect immediately so the phone that does not support piconets could establish Bluetooth connection with the headset.

Requirements

Header bt_api.h
Library Btdrt.lib
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

Bluetooth OS Functions
BthGetBasebandHandles

Other Resources

Bluetooth Application Development