Commit 47238a29 authored by Robert Hedman's avatar Robert Hedman

Fixed missing endOfMessage case in controller

parent c2e1a9bb
......@@ -23,9 +23,12 @@ use serial::prelude::*;
//lidar
const LIDAR_ADDRESS: &str = "127.0.0.1:8080";
const COUNTER_SERIAL_PORT: &str = "/dev/cu.usbmodem1422";
const LIDAR_BUF_SIZE: usize = 4096;
//Arduinos
const COUNTER_SERIAL_PORT: &str = "/dev/cu.usbmodem1422";
const DRIVER_SERIAL_PORT: &str = "/dev/cu.usbmodem1423";
//controller
const REMOTE_OPERATOR_ADDRESS: &str = "10.9.0.3:30000"; // remember to double check port!
const CONTROLLER_SAMPLING_TIME: u32 = 200; //ms
......@@ -89,7 +92,7 @@ fn main() {
// get controller input (We expect to set soloMode here.)
for r in stream.try_clone().expect("stream clone failed").bytes() {
match r {
Ok(b) => { // TODO Add case if EOM is missing
Ok(b) => {
if b == 250 && !recording {
//println!("Server found start of message");
message[received_bytes] = b;
......@@ -117,7 +120,11 @@ fn main() {
},
Err(_) => {}, //TODO
}
}
if received_bytes > message_len && recording { // EOM is missing!
received_bytes = 0;
recording = false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment