BleNotFoundException

class BleNotFoundException(message: String, val serviceUuid: String? = null, val characteristicUuid: String? = null, val gattStatus: Int? = null) : BleException

Exception thrown when a requested GATT service or characteristic is not found.

This exception indicates that the device does not expose the expected service or characteristic, which could mean:

  • The device is a different model than expected

  • The device firmware version doesn't support the feature

  • Service discovery was incomplete

  • The UUID is incorrect

Usage Example

when (error) {
is BleNotFoundException -> {
error.serviceUuid?.let { service ->
Log.e("BLE", "Service not found: $service")
}
error.characteristicUuid?.let { char ->
Log.e("BLE", "Characteristic not found: $char")
}
// Suggest user to check device compatibility
showIncompatibleDeviceMessage()
}
}

See also

Constructors

Link copied to clipboard
constructor(message: String, serviceUuid: String? = null, characteristicUuid: String? = null, gattStatus: Int? = null)

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard

The UUID of the characteristic that was not found, as a string.

Link copied to clipboard
open override val gattStatus: Int? = null

The GATT status code, if available.

Link copied to clipboard
open val message: String?
Link copied to clipboard
val serviceUuid: String? = null

The UUID of the service that was not found, as a 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