summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2018-04-12 21:17:55 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2018-04-12 21:17:55 +0100
commit257abdc879b7f52abe433bc678e2913c96647003 (patch)
treee1b8bfb7d7fae1c5a0ebb4a70aff33c374dcf5e6
parent3da799c532362943073a692c0351b25af2d45793 (diff)
downloadcanopied-257abdc879b7f52abe433bc678e2913c96647003.tar.bz2
Use Cadenced ECUs, only show unused stuff for now, warn for unsupported packets
-rw-r--r--src/main.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index e4f2e7e..1866813 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,6 +30,7 @@ use std::collections::hash_map::Entry;
use std::vec::Vec;
use types::Value;
+use definitions::CadencedECUs;
fn packet_print(id: u16, bytes: &[u8]) -> String {
let mut ret: String = String::new();
@@ -79,7 +80,7 @@ fn main() {
);
trace!("Preparing an Interval to run the requests");
- let always_defs = futures::stream::iter_ok(raw_defs.iter().cycle());
+ let always_defs = futures::stream::iter_ok(CadencedECUs::new());
let every_100ms = Interval::new(Instant::now(), Duration::from_millis(100));
let zipped = every_100ms.zip(always_defs);
@@ -110,18 +111,26 @@ fn main() {
let curmap = current.get_mut().unwrap();
for entry in decoded {
let name = entry.get_name().to_owned();
+ if !name.contains(".unused_") {
+ continue;
+ }
let value = entry.get_value().unwrap();
match curmap.entry(name.clone()) {
Entry::Occupied(o) => if value != *o.get() {
- info!("{} changed {:?} -> {:?}", name, o.get(), value);
+ info!("{} changed {} -> {}", name, o.get(), value);
},
Entry::Vacant(_) => {
- info!("{} changed None -> {:?}", name, value);
+ info!("{} changed None -> {}", name, value);
}
};
curmap.insert(name, value);
}
}
+ } else {
+ warn!(
+ "Cannot locate Raw RCU Entry for {}",
+ packet_print(frame.0, &frame.1)
+ );
}
Ok(())