use std::time::Duration;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("bluetooth: {0}")]
Bluetooth(#[from] btleplug::Error),
#[error("no Bluetooth adapter available")]
NoAdapter,
#[error("band {name:?} not found within {timeout:?}; is it on and not connected to another app?")]
NotFound {
name: String,
timeout: Duration,
},
#[error("characteristic {0} missing; unsupported device or firmware")]
MissingCharacteristic(&'static str),
#[error("no response to command 0x{opcode:02x} within {timeout:?}")]
Timeout {
opcode: u8,
timeout: Duration,
},
#[error("command 0x{opcode:02x} failed with status {status}")]
CommandFailed {
opcode: u8,
status: u8,
},
#[error("disconnected")]
Disconnected,
#[error("recording: {0}")]
Storage(#[from] rusqlite::Error),
#[error("io: {0}")]
Io(#[from] std::io::Error),
}