BleException

sealed class BleException : Exception

Base exception class for all BLE-related errors in the BleX library.

This sealed class hierarchy provides a type-safe way to handle different categories of BLE errors. Each subclass represents a specific type of failure that can occur during BLE operations.

Exception Hierarchy

Usage Example

try {
connection.readCharacteristicResult(serviceUuid, charUuid)
.onSuccess { data -> processData(data) }
.onFailure { error ->
when (error) {
is BleConnectionException -> handleConnectionError(error)
is BleCharacteristicException -> handleCharacteristicError(error)
is BleTimeoutException -> retryOperation()
is BleNotFoundException -> logMissingService(error)
is BlePermissionException -> requestPermissions(error.missingPermissions)
}
}
} catch (e: BleException) {
Log.e("BLE", "GATT status: ${e.gattStatus}, message: ${e.message}")
}

See also

Inheritors

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
abstract val gattStatus: Int?

The GATT status code associated with this error, if available.

Link copied to clipboard
open val message: String?

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard