BleError

sealed class BleError(source)

Represents specific BLE failures, modeled after the iOS implementation's AccessoryError. This allows for more granular error handling and intelligent reconnection strategies.

Inheritors

Types

Link copied to clipboard
class BluetoothError(exception: BluetoothException) : BleError

Wraps a generic BluetoothException. The reconnection strategy depends on the nature of the Bluetooth error.

Link copied to clipboard
class BluetoothUnavailable(exception: BluetoothUnavailableException) : BleError

Bluetooth is unavailable on the device. This is a non-recoverable error.

Link copied to clipboard
object Companion
Link copied to clipboard
class ConnectionFailed(exception: Throwable) : BleError

An error indicating a failure during the connection attempt. This may be recoverable, so a reconnect attempt is warranted.

Link copied to clipboard
class Disconnected(reason: ConnectionState.Disconnected.Reason?) : BleError

An error indicating a disconnection initiated by the peripheral. This may be recoverable, so a reconnect attempt is warranted.

Link copied to clipboard
class DiscoveryFailed(message: String) : BleError

An error indicating a failure during the service discovery process. This may be recoverable, so a reconnect attempt is warranted.

Link copied to clipboard
class GattError(exception: GattException) : BleError

Wraps a generic GattException. The reconnection strategy depends on the nature of the Gatt error.

Link copied to clipboard
class GenericError(exception: Throwable) : BleError

A generic error for other exceptions that may occur.

Link copied to clipboard
class InvalidAttribute(exception: InvalidAttributeException) : BleError

An invalid attribute was used. This is a non-recoverable error.

Link copied to clipboard
class ManagerClosed(exception: ManagerClosedException) : BleError

The BLE manager was closed. This is a non-recoverable error.

Link copied to clipboard
class OperationFailed(exception: OperationFailedException) : BleError

A BLE operation failed. This may be recoverable.

Link copied to clipboard
class PeripheralNotConnected(exception: PeripheralNotConnectedException) : BleError

The peripheral is not connected. This may be recoverable.

Link copied to clipboard

An error indicating that the peripheral was not found. This is a non-recoverable error and should not trigger a reconnect.

Link copied to clipboard
class Scanning(exception: ScanningException) : BleError

An error occurred while scanning for devices. This may be recoverable.

Link copied to clipboard
class ValueDoesNotMatch(exception: ValueDoesNotMatchException) : BleError

A value did not match what was expected. This may be recoverable.

Properties

Link copied to clipboard
Link copied to clipboard