How to disconnect ACL connection in Symbian translation

zhaozj2021-02-16  45

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);

转载请注明原文地址:https://www.9cbs.com/read-27028.html

New Post(0)