Add route to download firmware on device
This commit is contained in:
@ -25,6 +25,12 @@ pub fn save_update(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get the content of an OTA update
|
||||
pub fn get_ota_update(platform: OTAPlatform, version: &semver::Version) -> anyhow::Result<Vec<u8>> {
|
||||
let path = AppConfig::get().path_ota_update(platform, version);
|
||||
Ok(std::fs::read(path)?)
|
||||
}
|
||||
|
||||
/// Get the list of OTA software updates for a platform
|
||||
pub fn get_ota_updates_for_platform(platform: OTAPlatform) -> anyhow::Result<Vec<OTAUpdate>> {
|
||||
let ota_path = AppConfig::get().ota_platform_dir(platform);
|
||||
|
Reference in New Issue
Block a user