Add route to download firmware on device

This commit is contained in:
2024-10-05 20:00:57 +02:00
parent 37844ae5fa
commit aa262879f0
4 changed files with 35 additions and 1 deletions

View File

@ -3,7 +3,9 @@ use crate::constants;
use crate::crypto::pki;
use crate::energy::energy_actor::EnergyActorAddr;
use crate::server::auth_middleware::AuthChecker;
use crate::server::devices_api::{device_logging_controller, mgmt_controller, utils_controller};
use crate::server::devices_api::{
device_logging_controller, devices_ota, mgmt_controller, utils_controller,
};
use crate::server::unsecure_server::*;
use crate::server::web_api::*;
use crate::server::web_app_controller;
@ -251,6 +253,10 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
"/devices_api/mgmt/sync",
web::post().to(mgmt_controller::sync_device),
)
.route(
"/devices_api/ota/{platform}/{version}",
web::get().to(devices_ota::retrieve_firmware),
)
.route(
"/devices_api/logging/record",
web::post().to(device_logging_controller::report_log),