use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("USB error: {0}")]
Usb(#[from] rusb::Error),
#[error("device is not opened")]
DeviceNotOpened,
#[error("invalid device response")]
InvalidResponse,
#[error("device initialization failed")]
InitializationFailed,
#[error("operation timed out")]
Timeout,
}
pub type Result<T> = std::result::Result<T, Error>;