diff --git a/src/command/bc125at/battery_charge_time.rs b/src/command/bc125at/battery_charge_time.rs new file mode 100644 index 0000000..4eaffa8 --- /dev/null +++ b/src/command/bc125at/battery_charge_time.rs @@ -0,0 +1,7 @@ +use crate::command::{OkResponse, command, range_param, range_response}; + +range_param!(BatteryChargeTime(0..=16): u8); +range_response!(BatteryChargeTime => BatteryChargeTimeError : InvalidBatteryChargeTime("volume must be between [1..16], got `{0}`")); + +command!(b"BSV": GetBatteryInfo => BatteryChargeTime); +command!(b"BSV": SetBatteryInfo(BatteryChargeTime) => OkResponse); diff --git a/src/command/bc125at/lcd_contrast.rs b/src/command/bc125at/lcd_contrast.rs new file mode 100644 index 0000000..80ff740 --- /dev/null +++ b/src/command/bc125at/lcd_contrast.rs @@ -0,0 +1,7 @@ +use crate::command::{OkResponse, command, range_param, range_response}; + +range_param!(LcdContrast(1..=15): u8); +range_response!(LcdContrast => LcdContrastError : InvalidLcdContrast("LCD contrast must be between [1..15], got `{0}`")); + +command!(b"CNT": GetLcdContrast => LcdContrast); +command!(b"CNT": SetLcdContrast(LcdContrast) => OkResponse); diff --git a/src/command/bc125at/mod.rs b/src/command/bc125at/mod.rs index 835aca9..0da677d 100644 --- a/src/command/bc125at/mod.rs +++ b/src/command/bc125at/mod.rs @@ -1,9 +1,15 @@ +mod battery_charge_time; mod firmware_version; +mod lcd_contrast; mod program_mode; mod squelch; mod volume; +pub use battery_charge_time::{ + BatteryChargeTime, BatteryChargeTimeError, GetBatteryInfo, SetBatteryInfo, +}; pub use firmware_version::{FirmwareVersion, FirmwareVersionError, GetFirmwareVersion}; +pub use lcd_contrast::{GetLcdContrast, LcdContrast, LcdContrastError, SetLcdContrast}; pub use program_mode::{EnterProgramMode, ExitProgramMode}; pub use squelch::{GetSquelchLevel, SetSquelchLevel, SquelchLevel, SquelchLevelError}; pub use volume::{GetVolumeLevel, SetVolumeLevel, VolumeLevel, VolumeLevelError};