终止连接CBPeripheralManager端 [英] terminate a connection CBPeripheralManager side

查看:163
本文介绍了终止连接CBPeripheralManager端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CBPeripheralManager 是否有终止连接的推荐方法。到目前为止,我发现的最好方法就是不响应动态值,然后BLE堆栈似乎关闭了连接,但这似乎很粗糙。

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.

更好的方法?

推荐答案

不,您不能从外围设备强制以清晰的方式强制关闭连接。没有API。

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

您可以通过不响应请求来突然断开连接,这最多会在30秒后断开连接。这是蓝牙规范第3卷F部分3.3.3定义的标准行为。

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


30秒内未完成的交易将超时。这种
交易应被视为失败,并且应将此失败通知本地较高的
层。不得在此ATT承载上将更多的属性协议
请求,命令,指示或通知发送到目标设备

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.

这篇关于终止连接CBPeripheralManager端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆