adda lot of basic webserver back
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user