ble_ledly/communication_protocol/
mod.rs

1use crate::capability::{
2    brightness::BrightnessOption,
3    color::ColorOption,
4    hw_animate::{HWAnimateOption, HWAnimationSpeedSetting, HWStaticColorOption},
5    light::LightOption,
6};
7
8pub mod generic_rgb;
9
10//----------//
11// Re-export//
12//----------//
13////////////////////////////////////////
14pub use self::generic_rgb::GenericRGB;
15////////////////////////////////////////
16
17pub trait Protocol {
18    fn light(&self, option: &LightOption) -> Vec<u8>;
19    fn color(&self, option: &ColorOption) -> Vec<u8>;
20    fn brightness(&self, option: &BrightnessOption) -> Vec<u8>;
21    fn hw_animate(&self, option: &HWAnimateOption) -> Vec<u8>;
22
23    // animate hwspecific helpers //
24    fn _animation_speed(setting: &HWAnimationSpeedSetting) -> u8;
25    fn _static_color(color: &HWStaticColorOption) -> u8;
26}