Add a route to upload update to the platform
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub enum OTAPlatform {
|
||||
#[serde(rename = "Wt32-Eth01")]
|
||||
Wt32Eth01,
|
||||
}
|
||||
|
||||
impl Display for OTAPlatform {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
let s = serde_json::to_string(&self).unwrap().replace('"', "");
|
||||
write!(f, "{s}")
|
||||
}
|
||||
}
|
||||
|
||||
/// Single OTA update information
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)]
|
||||
pub struct OTAUpdate {
|
||||
platform: OTAPlatform,
|
||||
version: semver::Version,
|
||||
file_size: usize,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user