adda lot of basic webserver back

This commit is contained in:
2025-09-15 01:21:50 +02:00
parent 049a9d027c
commit 65f6670ca4
6 changed files with 279 additions and 142 deletions

View File

@@ -1,6 +1,7 @@
use crate::hal::Box;
use alloc::string::String;
use async_trait::async_trait;
use core::error::Error;
use serde::Serialize;
#[async_trait]
@@ -17,6 +18,12 @@ pub trait BatteryInteraction {
async fn get_battery_state(&mut self) -> Result<BatteryState, BatteryError>;
}
impl From<BatteryError> for anyhow::Error {
fn from(err: BatteryError) -> Self {
anyhow::anyhow!(err)
}
}
#[derive(Debug, Serialize)]
pub struct BatteryInfo {
pub voltage_milli_volt: u16,