terminate a connection CBPeripheralManager side

后端 未结 1 1639
失恋的感觉
失恋的感觉 2021-01-14 10:05

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 t

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-14 10:50

    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.

    0 讨论(0)
提交回复
热议问题