Add a route to upload update to the platform
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use crate::devices::device::{DeviceId, DeviceRelayID};
|
||||
use crate::ota::ota_update::OTAPlatform;
|
||||
use clap::{Parser, Subcommand};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
@ -296,12 +297,14 @@ impl AppConfig {
|
||||
|
||||
/// Get the directory that will store OTA updates
|
||||
pub fn ota_dir(&self) -> PathBuf {
|
||||
self.logs_dir().join("ota")
|
||||
self.storage_path().join("ota")
|
||||
}
|
||||
|
||||
/// Get the directory that will store OTA updates of a given device reference
|
||||
pub fn ota_of_device(&self, dev_ref: &str) -> PathBuf {
|
||||
self.ota_dir().join(dev_ref)
|
||||
/// Get the path to the file that will contain an OTA update
|
||||
pub fn path_ota_update(&self, platform: OTAPlatform, version: &semver::Version) -> PathBuf {
|
||||
self.ota_dir()
|
||||
.join(platform.to_string())
|
||||
.join(version.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user