summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-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(())