Started to integrate the webinterface

This commit is contained in:
Sebastian 2024-06-29 16:01:40 +02:00
parent b9437480e1
commit f2fe686b0e
7 changed files with 694 additions and 67 deletions

View file

@ -1,3 +1,4 @@
use anyhow::Result;
use log::{debug, error, info, warn};
use tokio::{
self,
@ -9,7 +10,10 @@ use tokio::{
use crate::rotctlprotocol::{parse_command, Command};
pub async fn control_rotor(mut rx_cmd: mpsc::Receiver<Command>, pos_tx: watch::Sender<(f32, f32)>) {
pub async fn control_rotor(
mut rx_cmd: mpsc::Receiver<Command>,
pos_tx: watch::Sender<(f32, f32)>,
) -> Result<()> {
let mut actual_az = 0.0;
let mut actual_el = 0.0;
@ -43,7 +47,7 @@ pub async fn control_rotor(mut rx_cmd: mpsc::Receiver<Command>, pos_tx: watch::S
pos_tx.send((actual_az, actual_el)).unwrap();
},
else => return
else => return Ok(())
};
}
}