1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use thiserror::Error;

#[derive(Error, Debug)]
pub enum CapabilityError {
    #[error("Invalid peripheral reference")]
    Error,
}

#[derive(Error, Debug)]
pub enum BluetoothError {
    #[error("The selected default bluetooth adapter [0] is invalid")]
    InvalidBluetoothAdapter,

    #[error("Invalid peripheral reference")]
    InvalidPeripheralReference,

    #[error("Unable to unpack peripheral properties")]
    InvalidPeriperipheralProperty,

    #[error("No write characteristic found that satisfy target value")]
    NotFoundTargetCharacteristic,

    #[error(transparent)]
    InternalError(#[from] btleplug::Error),

    #[error("Invalid or absent characteristic")]
    InvalidCharacteristic,
}