disconnect

abstract suspend fun disconnect()

Disconnects the active connection, or cancels an in-flight connection attempt, suspending until Peripheral has settled on a disconnected state.

Multiple concurrent invocations will all suspend until disconnected (or failure occurs).

Any coroutines launched from connect will be spun down prior to closing underlying peripheral connection.

Throws

if Peripheral's CoroutineScope has been cancelled.