ConnectionPool

interface ConnectionPool

Interface for managing connection pool settings in BLE devices.

Provides methods for setting, resetting, validating hex IDs, and generating QR data for connection pools.

Functions

Link copied to clipboard
abstract fun cacheId(deviceId: String, poolId: String)

Caches the connection pool ID locally for the specified device.

Link copied to clipboard
abstract fun getConnectionPoolQRData(poolId: String): String

Generates a configuration command string that can be encoded into a QR code.

Link copied to clipboard
abstract suspend fun getId(deviceId: String): String

Retrieves the current connection pool ID for the specified device.

abstract fun getId(deviceId: String, callback: (Result<String>) -> Unit)

Callback-based version of getId for Java interoperability.

Link copied to clipboard
abstract fun isValidId(poolId: String): Boolean

Checks if the given ID is a valid 4-character hexadecimal value.

Link copied to clipboard
abstract suspend fun resetId(deviceId: String): CommandResponse

Resets the connection pool ID to the default '0000'.

abstract fun resetId(deviceId: String, callback: (Result<CommandResponse>) -> Unit)

Callback-based version of resetId for Java interoperability.

Link copied to clipboard
abstract suspend fun setId(deviceId: String, poolId: String): CommandResponse

Sets the connection pool ID to the specified 4-character hexadecimal value.

abstract fun setId(deviceId: String, poolId: String, callback: (Result<CommandResponse>) -> Unit)

Callback-based version of setId for Java interoperability.