Detecting BLE disconnection

Having Paired (but not Bonded) devices - is there a way to restart scanning should the peripheral device be turned off/unpowered?

Testing for peer.isConnected() false once connected where peer is connected BlePeerDevice type does not appear to work?

This should work?

There is a difference between peripheral and central devices:

You can use this method, or you can simply monitor BLE.connected() (for peripheral devices) or peer.connected() for central devices.

Thanks - the check is being done on a central device. If I have both devices connected and paired then unplug the peripheral device the central device isn’t detecting the peripheral has been disconnected. Would there need to be a communication / keep alive for the disconnection to be detected?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.