Updated crates for the daemon part
This commit is contained in:
parent
cfd7b79eac
commit
475e9621a1
6 changed files with 21 additions and 36 deletions
|
|
@ -5,22 +5,23 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
anyhow = "1.0.83"
|
||||
axum = { version = "0.7.5", features = ["macros"] }
|
||||
fern = { version = "0.6.2", features = ["colored"] }
|
||||
axum = { version = "0.8.8", features = ["macros"] }
|
||||
fern = { version = "0.7.1", features = ["colored"] }
|
||||
humantime = "2.1.0"
|
||||
log = "0.4.21"
|
||||
nom = "7.1.3"
|
||||
nom = "8.0.0"
|
||||
serde_json = "1.0.118"
|
||||
serialport = "4.5.1"
|
||||
tokio = {version = "1.37.0", features = ["full"]}
|
||||
tower-http = { version = "0.5.2", features = ["fs", "trace"] }
|
||||
tower-http = { version = "0.6.8", features = ["fs", "trace"] }
|
||||
radomctl-protocol = { path = "../protocol" }
|
||||
postcard = {version = "1.0.10", features = ["use-std"]}
|
||||
dfu-libusb = "0.3.0"
|
||||
dfu-libusb = "0.5.5"
|
||||
rusb = "0.9"
|
||||
clap = { version = "4.5.19", features = ["derive"] }
|
||||
indicatif = "0.17.8"
|
||||
indicatif = "0.18.3"
|
||||
tokio-serial = {version = "5.4.4", features = ["codec", "rt"] }
|
||||
tokio-util = { version = "0.7.13", features = ["codec", "rt"] }
|
||||
bytes = "1.9.0"
|
||||
futures = "0.3.31"
|
||||
nom-language = "0.1.0"
|
||||
|
|
|
|||
|
|
@ -7,9 +7,8 @@ use std::{
|
|||
use anyhow::{anyhow, Context};
|
||||
use clap::Parser;
|
||||
use dfu_libusb::{Dfu, DfuLibusb};
|
||||
use postcard::{from_bytes_cobs, to_stdvec_cobs};
|
||||
use postcard::to_stdvec_cobs;
|
||||
use radomctl_protocol::*;
|
||||
use radomctld::logger::setup_logger;
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Cli {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use fern::colors::{Color, ColoredLevelConfig};
|
||||
use log::{debug, error, info, warn};
|
||||
use std::io;
|
||||
|
||||
pub fn setup_logger() -> Result<()> {
|
||||
let colors = ColoredLevelConfig::new()
|
||||
|
|
|
|||
|
|
@ -1,17 +1,9 @@
|
|||
use anyhow::anyhow;
|
||||
use anyhow::Result;
|
||||
use anyhow::{anyhow, Context};
|
||||
use axum::{
|
||||
extract::State,
|
||||
http::StatusCode,
|
||||
routing::{get, post},
|
||||
Json, Router,
|
||||
};
|
||||
use axum::{extract::State, routing::get, Json, Router};
|
||||
use clap::Parser;
|
||||
use fern::colors::{Color, ColoredLevelConfig};
|
||||
use log::{debug, error, info, warn, Level};
|
||||
use log::{debug, error, info};
|
||||
use serde_json::{json, Value};
|
||||
use std::time::Duration;
|
||||
use std::{borrow::Borrow, io};
|
||||
use tokio::{
|
||||
self,
|
||||
io::{AsyncBufReadExt, AsyncWriteExt, BufStream},
|
||||
|
|
@ -20,10 +12,7 @@ use tokio::{
|
|||
task::JoinSet,
|
||||
};
|
||||
use tokio_serial;
|
||||
use tower_http::{
|
||||
services::{ServeDir, ServeFile},
|
||||
trace::TraceLayer,
|
||||
};
|
||||
use tower_http::{services::ServeFile, trace::TraceLayer};
|
||||
|
||||
use radomctld::{
|
||||
logger::setup_logger,
|
||||
|
|
@ -34,7 +23,7 @@ use radomctld::{
|
|||
async fn process_socket(
|
||||
socket: TcpStream,
|
||||
cmd_tx: mpsc::Sender<Command>,
|
||||
mut pos_rx: watch::Receiver<(f32, f32)>,
|
||||
pos_rx: watch::Receiver<(f32, f32)>,
|
||||
) {
|
||||
let mut stream = BufStream::new(socket);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@ use nom::{
|
|||
character::complete::{
|
||||
alphanumeric1, i8, multispace0, multispace1, newline, none_of, not_line_ending, space1,
|
||||
},
|
||||
combinator::{all_consuming, map, opt, recognize, rest},
|
||||
error::{context, convert_error, VerboseError},
|
||||
multi::{many0, many1},
|
||||
combinator::{all_consuming, map, opt, recognize},
|
||||
error::context,
|
||||
multi::many1,
|
||||
number::complete::float,
|
||||
sequence::{preceded, separated_pair, terminated},
|
||||
Err as NomErr, IResult, Parser,
|
||||
};
|
||||
use nom_language::error::{convert_error, VerboseError};
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum Command {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,19 @@
|
|||
use anyhow::Result;
|
||||
use bytes::{BufMut, BytesMut};
|
||||
use futures::{stream::StreamExt, SinkExt};
|
||||
use log::{debug, error, info, warn};
|
||||
use postcard::{from_bytes_cobs, to_stdvec_cobs};
|
||||
use radomctl_protocol::{HostMessage, PositionTarget, RadomMessage};
|
||||
use std::{env, io, str, time::Duration};
|
||||
use tokio::time::sleep;
|
||||
use std::{io, time::Duration};
|
||||
use tokio::{
|
||||
self,
|
||||
io::{AsyncBufReadExt, AsyncWriteExt, BufStream},
|
||||
net::{TcpListener, TcpStream},
|
||||
sync::{self, mpsc, watch},
|
||||
io::AsyncBufReadExt,
|
||||
sync::{mpsc, watch},
|
||||
time,
|
||||
};
|
||||
use tokio_serial::SerialPortBuilderExt;
|
||||
use tokio_util::codec::{Decoder, Encoder};
|
||||
|
||||
use crate::rotctlprotocol::{parse_command, Command};
|
||||
use crate::rotctlprotocol::Command;
|
||||
|
||||
struct ProtocolCodec;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue