Add a way to get the error to the bounds to NoncausalTimestampFilter
Now that we can compute the worst case offset, we want to be able to use
that worst case when enforcing bounds. Expose it in a function, and add
a test.
Change-Id: Ibc1ff97ce2353f564a59eb7794a3739ab07f2495
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/boot_timestamp.h b/aos/events/logging/boot_timestamp.h
index 0d68045..bd9b357 100644
--- a/aos/events/logging/boot_timestamp.h
+++ b/aos/events/logging/boot_timestamp.h
@@ -101,6 +101,11 @@
BootTimestamp operator+(BootDuration d) const {
return {boot, time + d.duration};
}
+
+ BootDuration operator-(BootTimestamp t) const {
+ CHECK_EQ(t.boot, boot);
+ return {boot, time - t.time};
+ }
};
// Structure to hold both a boot and queue index. Queue indices reset after