aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/canutil/read.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/canutil/read.h b/src/canutil/read.h
index 3742d6d1..028b03a6 100644
--- a/src/canutil/read.h
+++ b/src/canutil/read.h
@@ -19,6 +19,14 @@ extern "C" {
float bitfield_parse_float(uint64_t data, uint8_t bit_offset, uint8_t bit_size,
float factor, float offset);
+/* Public: Parse a CAN signal from a message and interpret it as a boolean.
+ *
+ * signal - The details of the signal to decode and forward.
+ * data - The raw bytes of the CAN message that contains the signal, assumed
+ * to be in big-endian byte order from CAN.
+ *
+ * Returns false if the value was 0, otherwise true.
+ */
bool bitfield_parse_bool(uint64_t data, uint8_t bit_offset, uint8_t bit_size,
float factor, float offset);