summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 12:14:29 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 12:14:29 -0500
commit50715d3d8783dd081a403c1e580b34177ffa57bf (patch)
tree6cd32bcc3bb0738c1e7d6d8a19ae442305307da1 /src
parentf29f8a4cefbdc798c4a9aba495da7d2c0a81774c (diff)
Test parsing boolean.
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);