ble-ledly 0.1.0-alpha.0

A customizable and extensible cross-platform high-level Bluetooth Low Energy light controller.
Documentation
use thiserror::Error;

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

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

    #[error(transparent)]
    IOError(#[from] std::io::Error),

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

    #[error("invalid peripheral reference during service discovery")]
    InvalidPeripheralReference,

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

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

#[derive(Error, Debug)]
pub enum LightControlError {
    #[error("the supplied value is not within the appropriate range: [{0}]")]
    InvalidRange(String),

    #[error("the supplied value is not valid")]
    InvalidValue,
}