Triggering the dfu bootloader works
This commit is contained in:
parent
ceb4dc035f
commit
524ed8f2c6
7 changed files with 131 additions and 25 deletions
16
daemon/src/bin/trigger-dfu.rs
Normal file
16
daemon/src/bin/trigger-dfu.rs
Normal 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();
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue