Moved battery, os docking into a new "v1" module

Added all_info to a module in v1
This commit is contained in:
Jordon Brooks 2023-06-25 11:53:22 +01:00
parent 8169dfd022
commit 1e5bda520a
16 changed files with 18 additions and 16 deletions

View file

@ -1,39 +0,0 @@
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Clone)]
pub struct Dock {
pub brand: String, // ex: JSAUX
pub model: String, // ex: HB0603
pub usb_ids: Vec<[u16; 2]>,
}
impl Dock {
pub fn new() -> Dock {
Dock { brand: String::new(),
model: String::new(),
usb_ids: vec![],
}
}
pub fn to_string(self) -> String {
serde_json::to_string(&self).expect("Failed to parse into string")
}
}
#[derive(Deserialize, Serialize, Clone)]
pub struct DockInfo {
pub dock_info: Dock,
pub is_docked: bool,
pub fallback_detection: bool,
}
impl DockInfo {
pub fn new() -> DockInfo {
DockInfo { dock_info: Dock::new(),
is_docked: false,
fallback_detection: false
}
}
pub fn to_string(self) -> String {
serde_json::to_string(&self).expect("Failed to parse into string")
}
}