diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-01A0682A-50B1-57AB-9939-6CC8FCCD782D.dita --- a/Symbian3/PDK/Source/GUID-01A0682A-50B1-57AB-9939-6CC8FCCD782D.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-01A0682A-50B1-57AB-9939-6CC8FCCD782D.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,17 +1,17 @@ - - - - - -Disconnecting ACL links

A link layer level ioctl is provided to disconnect an baseband link without first closing the open sockets using that link. This provides the ability to quickly disconnect one or all current Bluetooth asynchronous connection-oriented links (ACL) open on a device.

How to disconnect ACL links

The TLMDisconnectACLIoctl structure contains the device address of the remote device to be disconnected and the reason code to be supplied during the disconnection.

Basic Procedure

To directly disconnect individual Bluetooth ACL links:

  1. Create a TLMDisconnectACLBuf packaged structure, which contains the address of the Bluetooth device to be disconnected and the reason to be given to the other device for its disconnection.

  2. Call the KLMDisconnectACLIoctl ioctl on the socket with the link manager level KSolBtLM, passing the package buffer.

Example: Disconnecting ACL links

Here is a simple disconnect example.

  1. Starting with an open socket

    RSocket sock; -ret=sock.Open(ss,pInfo.iAddrFamily,pInfo.iSockType,pInfo.iProtocol);
  2. Identify the Bluetooth device to be disconnected and provide a reason for the disconnect.

    TLMDisconnectACLBuf aclConnBuf; -aclConnBuf().iDevAddr = devAddr; // devAddr is a TBTDevAddr -aclConnBuf().iReason = 0x13; // Remote User Ended Connection -TRequestStatus stat;
  3. Send Ioctl command to disconnect.

    sock.Ioctl(KLMDisconnectACLIoctl, stat, &aclConnBuf, KSolBtLM); + + + + + +Disconnecting ACL links

    A link layer level ioctl is provided to disconnect an baseband link without first closing the open sockets using that link. This provides the ability to quickly disconnect one or all current Bluetooth asynchronous connection-oriented links (ACL) open on a device.

    How to disconnect ACL links

    The TLMDisconnectACLIoctl structure contains the device address of the remote device to be disconnected and the reason code to be supplied during the disconnection.

    Basic Procedure

    To directly disconnect individual Bluetooth ACL links:

    1. Create a TLMDisconnectACLBuf packaged structure, which contains the address of the Bluetooth device to be disconnected and the reason to be given to the other device for its disconnection.

    2. Call the KLMDisconnectACLIoctl ioctl on the socket with the link manager level KSolBtLM, passing the package buffer.

    Example: Disconnecting ACL links

    Here is a simple disconnect example.

    1. Starting with an open socket

      RSocket sock; +ret=sock.Open(ss,pInfo.iAddrFamily,pInfo.iSockType,pInfo.iProtocol);
    2. Identify the Bluetooth device to be disconnected and provide a reason for the disconnect.

      TLMDisconnectACLBuf aclConnBuf; +aclConnBuf().iDevAddr = devAddr; // devAddr is a TBTDevAddr +aclConnBuf().iReason = 0x13; // Remote User Ended Connection +TRequestStatus stat;
    3. Send Ioctl command to disconnect.

      sock.Ioctl(KLMDisconnectACLIoctl, stat, &aclConnBuf, KSolBtLM); User::WaitForRequest(stat);
    Where Next?

    This tutorial set takes you through all the steps involved in setting up and communicating over a Bluetooth connection.

    • Listening for Incoming Bluetooth Connections

    • Handling the Local Device Name

    • Performing Low-level Configuration

    • Debugging the Host Controller

    • Disconnecting ACL links - This document

    \ No newline at end of file