How to disconnect ACL connection
The IOCTL of the link layer is disconnected without first closing the socket using a baseband connection. It can be used to quickly close all Bluetooth connections on a device. TLMDisconnectaCliocTl includes a reason code for disconnecting the address of the remote device and disconnecting
Directly disconnect a single Bluetooth ACL connection:
· Create a TLMDisconnectaClbuf structure that contains Bluetooth device addresses and disconnects to disconnect.
· Call KlmdisConnectaCliocTl IOCTL, transfer package buffer data via ksolbtlm
Example
// Open socketRSocket sock; ret = sock.Open (ss, pInfo.iAddrFamily, pInfo.iSockType, pInfo.iProtocol); (then, assuming ret == KErrNone) // Send IoctlTLMDisconnectACLBuf aclConnBuf; aclConnBuf () iDevAddr = devAddr.; // devAddr is a TBTDevAddraclConnBuf () iReason = 0x13;. // Remote User Ended ConnectionTRequestStatus stat; sock.Ioctl (KLMDisconnectACLIoctl, stat, & aclConnBuf, KSolBtLM); User :: WaitForRequest (stat);