Compare commits

...

2 Commits

Author SHA1 Message Date
occheung 5364e0fe6e mgmt: suppress warning 2024-08-20 17:06:55 +08:00
occheung c50be213ba remote pull_log: ignore last 2024-08-20 16:57:56 +08:00
1 changed files with 21 additions and 19 deletions

View File

@ -13,7 +13,9 @@ 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::*, rtio_mgt::*}; use crate::proto_async::*;
#[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 {
@ -239,7 +241,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?;
} }
@ -640,13 +642,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 {
@ -656,14 +658,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
), ),
@ -671,10 +673,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
) )
@ -683,10 +685,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
) )
@ -695,10 +697,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
@ -715,10 +717,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,
@ -729,17 +731,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)
} }
}?; }?;
} }