16 lines
475 B
Rust
16 lines
475 B
Rust
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();
|
|
}
|