Ble Not Found Exception
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()
}
}Content copied to clipboard