Add a route to get the list of supported platforms for OTA
This commit is contained in:
@ -181,7 +181,10 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
|
||||
web::delete().to(devices_controller::delete_device),
|
||||
)
|
||||
// OTA API
|
||||
// TODO : list supported platform references
|
||||
.route(
|
||||
"/web_api/ota/supported_platforms",
|
||||
web::get().to(ota_controller::supported_platforms),
|
||||
)
|
||||
// TODO : upload a new software update
|
||||
// TODO : list ota software update per platform
|
||||
// TODO : download a OTA file
|
||||
|
@ -2,5 +2,6 @@ pub mod auth_controller;
|
||||
pub mod devices_controller;
|
||||
pub mod energy_controller;
|
||||
pub mod logging_controller;
|
||||
pub mod ota_controller;
|
||||
pub mod relays_controller;
|
||||
pub mod server_controller;
|
||||
|
7
central_backend/src/server/web_api/ota_controller.rs
Normal file
7
central_backend/src/server/web_api/ota_controller.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use crate::ota::ota_update::OTAPlatform;
|
||||
use crate::server::custom_error::HttpResult;
|
||||
use actix_web::HttpResponse;
|
||||
|
||||
pub async fn supported_platforms() -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(vec![OTAPlatform::Wt32Eth01]))
|
||||
}
|
Reference in New Issue
Block a user