pub enum Error {
Show 19 variants
Bluetooth(Error),
BluetoothUnavailable,
ProbeNotFound {
identifier: String,
},
NotConnected,
ConnectionFailed {
reason: String,
},
ConnectionLost,
DeviceDisconnectedDuringSetup {
context: String,
},
InvalidData {
context: String,
},
CrcMismatch {
expected: u16,
actual: u16,
},
Timeout,
NotSupported {
operation: String,
},
ProbeError {
message: String,
},
MaxProbesReached {
max: usize,
},
InvalidParameter {
name: String,
value: String,
},
Internal(String),
CharacteristicNotFound {
uuid: String,
},
ServiceNotFound {
uuid: String,
},
ScanInProgress,
ScanModeMismatch {
current: ScanMode,
requested: ScanMode,
},
}Expand description
The main error type for this crate.
Variants§
Bluetooth(Error)
Bluetooth-related error from the underlying BLE library.
Bluetooth is not available or is disabled on this system.
ProbeNotFound
The specified probe was not found.
NotConnected
Operation requires a connection but the probe is not connected.
ConnectionFailed
Failed to establish a connection to the probe.
ConnectionLost
The connection to the probe was lost.
DeviceDisconnectedDuringSetup
The peripheral disconnected during connection setup (e.g. between service discovery and characteristic subscription). Cached GATT handles are stale and must be rebuilt by a full disconnect + reconnect.
Note: this variant uses context (not reason) to match the integrator
usage already in the wild. Stylistic inconsistency with ConnectionFailed { reason }
is accepted as a deliberate trade-off.
InvalidData
Invalid data was received from the probe.
CrcMismatch
CRC check failed for a UART message.
Timeout
A UART message response timed out.
NotSupported
The requested operation is not supported.
ProbeError
The probe reported an error.
MaxProbesReached
The maximum number of probes has been reached.
InvalidParameter
An invalid parameter was provided.
Internal(String)
An internal error occurred.
CharacteristicNotFound
Characteristic not found on the device.
ServiceNotFound
Service not found on the device.
ScanInProgress
The platform reports that a scan is already running on this adapter.
Returned by start_scanning when another party (typically the host
application) owns the adapter scan — on BlueZ this is
org.bluez.Error.InProgress. Fall back to attach to consume the existing
scan instead of owning one.
ScanModeMismatch
Scanning is already active in a different ScanMode.
Returned when attach is called on a manager that owns its scan, or
start_scanning is called on a manager that is attached to the host’s scan.
Stop scanning first, then start in the desired mode.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()