From 371186e872df3518bb5a2894f487ec02a42c771a Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 12 May 2020 13:51:09 +0200 Subject: add a -cm filter --- src/filters/log.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/filters/log.rs') diff --git a/src/filters/log.rs b/src/filters/log.rs index b9843e9..79513d5 100644 --- a/src/filters/log.rs +++ b/src/filters/log.rs @@ -186,6 +186,20 @@ pub fn log_before(when: DateTime) -> Box { log_time(None, Some(when)) } +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +struct CmFilter; + +impl Filter for CmFilter { + fn filter(&self, log: &LogResult) -> bool { + log.is_cm + } +} + +/// A filter that only includes logs that had the Challenge Mote turned on. +pub fn challenge_mote() -> Box { + Box::new(CmFilter) +} + #[cfg(test)] mod tests { use super::*; -- cgit v1.2.3