Triggering the dfu bootloader works

This commit is contained in:
Sebastian 2024-10-03 22:54:05 +02:00
parent ceb4dc035f
commit 524ed8f2c6
7 changed files with 131 additions and 25 deletions

View file

@ -0,0 +1,16 @@
use std::time::Duration;
use postcard::{from_bytes_cobs, to_stdvec_cobs};
use radomctl_protocol::*;
use radomctld::logger::setup_logger;
pub fn main() -> () {
let mut port = serialport::new("/dev/ttyACM0", 115_200)
.timeout(Duration::from_millis(10))
.open()
.expect("Failed to open port");
let host_msg = HostMessage::TriggerDFUBootloader;
let msg_bytes = to_stdvec_cobs(&host_msg).unwrap();
port.write_all(&msg_bytes).unwrap();
}

View file

@ -12,13 +12,17 @@ use tokio::{
task::JoinSet,
};
use tokio_serial;
use tower_http::{services::ServeFile, trace::TraceLayer};
use radomctld::{
logger::setup_logger,
rotctlprotocol::{parse_command, Command},
rotor::control_rotor,
};
use tower_http::{
services::{ServeDir, ServeFile},
trace::TraceLayer,
};
async fn process_socket(
socket: TcpStream,