added method to upload filesystem images
All checks were successful
Build Project / test (push) Successful in 5m58s

This commit is contained in:
2025-02-18 20:47:31 +00:00
parent a5e374b79f
commit 5e0ba37bc7
6 changed files with 81 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
use std::{fs, path::PathBuf};
use log::info;
use log::{debug, info};
use std::str::FromStr;
use thiserror::Error;
@@ -69,11 +69,13 @@ pub fn get_files(
.strip_suffix(".bin")
.ok_or(GetFilesError::Extension)?
.replace('-', ".");
// TODO this is kinda messy
let board_config = BoardConfig::from_str(split_name[1])?;
let service = split_name[0];
let board_type = BoardType::from_str(&product_name).unwrap();
let version_replaced = version.replace('.', "_");
let fw_url =
format!("{hostname}/firmware/{board_type}/{board_config}/{version_replaced}.bin");
format!("{hostname}/{service}/{board_type}/{board_config}/{version_replaced}.bin");
let cfg = OTAConfiguration {
version: version.to_string(),
url: fw_url,