Compare commits

..

No commits in common. "5364e0fe6e6c7d1dc33815d259e0c25679c09ae7" and "844c083ee4c3eca10b81f2788a22a43af56459fe" have entirely different histories.

1 changed files with 19 additions and 21 deletions

View File

@ -13,9 +13,7 @@ use log::{self, debug, error, info, warn, LevelFilter};
use num_derive::FromPrimitive; use num_derive::FromPrimitive;
use num_traits::FromPrimitive; use num_traits::FromPrimitive;
use crate::proto_async::*; use crate::{proto_async::*, rtio_mgt::*};
#[cfg(has_drtio)]
use crate::rtio_mgt::*;
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Error { pub enum Error {
@ -241,7 +239,7 @@ mod remote_coremgmt {
) )
.await .await
{ {
Ok(Packet::CoreMgmtGetLogReply { last: _, length, data }) => { Ok(Packet::CoreMgmtGetLogReply { last, length, data }) => {
write_chunk(stream, &data[..length as usize]).await?; write_chunk(stream, &data[..length as usize]).await?;
} }
@ -642,13 +640,13 @@ async fn handle_connection(
cfg: Rc<Config>, cfg: Rc<Config>,
_aux_mutex: &Rc<Mutex<bool>>, _aux_mutex: &Rc<Mutex<bool>>,
_routing_table: &RoutingTable, _routing_table: &RoutingTable,
_timer: GlobalTimer, timer: GlobalTimer,
) -> Result<()> { ) -> Result<()> {
if !expect(&stream, b"ARTIQ management\n").await? { if !expect(&stream, b"ARTIQ management\n").await? {
return Err(Error::UnexpectedPattern); return Err(Error::UnexpectedPattern);
} }
let _destination: u8 = read_i8(stream).await? as u8; let destination: u8 = read_i8(stream).await? as u8;
stream.send_slice("e".as_bytes()).await?; stream.send_slice("e".as_bytes()).await?;
loop { loop {
@ -658,14 +656,14 @@ async fn handle_connection(
} }
let msg: Request = FromPrimitive::from_i8(msg?).ok_or(Error::UnrecognizedPacket)?; let msg: Request = FromPrimitive::from_i8(msg?).ok_or(Error::UnrecognizedPacket)?;
match msg { match msg {
Request::GetLog => process!(stream, _timer, _aux_mutex, _routing_table, _destination, get_log), Request::GetLog => process!(stream, timer, _aux_mutex, _routing_table, destination, get_log),
Request::ClearLog => process!(stream, _timer, _aux_mutex, _routing_table, _destination, clear_log), Request::ClearLog => process!(stream, timer, _aux_mutex, _routing_table, destination, clear_log),
Request::PullLog => process!( Request::PullLog => process!(
stream, stream,
_timer, timer,
_aux_mutex, _aux_mutex,
_routing_table, _routing_table,
_destination, destination,
pull_log, pull_log,
&pull_id &pull_id
), ),
@ -673,10 +671,10 @@ async fn handle_connection(
let lvl = read_log_level_filter(stream).await?; let lvl = read_log_level_filter(stream).await?;
process!( process!(
stream, stream,
_timer, timer,
_aux_mutex, _aux_mutex,
_routing_table, _routing_table,
_destination, destination,
set_log_filter, set_log_filter,
lvl lvl
) )
@ -685,10 +683,10 @@ async fn handle_connection(
let lvl = read_log_level_filter(stream).await?; let lvl = read_log_level_filter(stream).await?;
process!( process!(
stream, stream,
_timer, timer,
_aux_mutex, _aux_mutex,
_routing_table, _routing_table,
_destination, destination,
set_uart_log_filter, set_uart_log_filter,
lvl lvl
) )
@ -697,10 +695,10 @@ async fn handle_connection(
let key = read_key(stream).await?; let key = read_key(stream).await?;
process!( process!(
stream, stream,
_timer, timer,
_aux_mutex, _aux_mutex,
_routing_table, _routing_table,
_destination, destination,
config_read, config_read,
&cfg, &cfg,
&key &key
@ -717,10 +715,10 @@ async fn handle_connection(
read_chunk(stream, &mut buffer).await?; read_chunk(stream, &mut buffer).await?;
process!( process!(
stream, stream,
_timer, timer,
_aux_mutex, _aux_mutex,
_routing_table, _routing_table,
_destination, destination,
config_write, config_write,
&cfg, &cfg,
&key, &key,
@ -731,17 +729,17 @@ async fn handle_connection(
let key = read_key(stream).await?; let key = read_key(stream).await?;
process!( process!(
stream, stream,
_timer, timer,
_aux_mutex, _aux_mutex,
_routing_table, _routing_table,
_destination, destination,
config_remove, config_remove,
&cfg, &cfg,
&key &key
) )
} }
Request::Reboot => { Request::Reboot => {
process!(stream, _timer, _aux_mutex, _routing_table, _destination, reboot) process!(stream, timer, _aux_mutex, _routing_table, destination, reboot)
} }
}?; }?;
} }