Connection

sealed interface Connection

Manages connections with Efento devices. The Connection interface allows you to establish and handle connections to Efento devices. Multiple instances of Connection can be used to connect to several devices simultaneously. However, it's important to note that only one Connection can be active per device at any given time.

Inheritors

Properties

Link copied to clipboard
abstract val isConnected: Boolean

Checks if the connection is initialized and established. Returns true if the connection is active, false otherwise.

Functions

Link copied to clipboard
abstract suspend fun connect()

Establishes and initializes a new connection. Throws BluetoothConnectionException if there is already an active connection to the device.

Link copied to clipboard
abstract suspend fun disconnect()

Terminates the existing connection. Throws BluetoothConnectionException if an attempt is made to disconnect from a device that was not previously connected.