terminate a connection CBPeripheralManager side

只愿长相守 提交于 2020-01-11 06:34:06

问题


Is there a recommended way for CBPeripheralManager to terminate a connection. The best way I have found so far is simply not to respond to dynamic value, then the BLE stack seems to close the connection, but that seems rather crude.

There must be a better way?


回答1:


No, you can't forcefully close a connection in a clear way from the peripheral side. There is no API for it.

You can break the connection abruptly by not responding to a request, which results in disconnection at most after 30 seconds. This is the standard behavior defined by the Bluetooth specification Vol.3 Part F 3.3.3

A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed and the local higher layers shall be informed of this failure. No more attribute protocol requests, commands, indica- tions or notifications shall be sent to the target device on this ATT Bearer.



来源:https://stackoverflow.com/questions/21537427/terminate-a-connection-cbperipheralmanager-side

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!