aboutsummaryrefslogtreecommitdiffstats
path: root/src/canutil/read.h
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 13:57:37 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 13:57:37 -0500
commite3bb578a0b11a25b0ae4c805fb7b98b724103b6f (patch)
treeaf3993d4b3c0bfc3d605e090d746f142970984ee /src/canutil/read.h
parent50715d3d8783dd081a403c1e580b34177ffa57bf (diff)
Test all canutil functions and document in README.
Diffstat (limited to 'src/canutil/read.h')
-rw-r--r--src/canutil/read.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/canutil/read.h b/src/canutil/read.h
index 028b03a6..865bb278 100644
--- a/src/canutil/read.h
+++ b/src/canutil/read.h
@@ -10,20 +10,28 @@ extern "C" {
/* Public: Parse a CAN signal from a message and apply required transformation.
*
- * 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.
+ * data - the payload containing the signal.
+ * bit_offset - the starting bit for the signal.
+ * bit_size - the width of the signal.
+ * factor - the transformation factor for the signal value, applied after
+ * pulling out the bit field. Use 1.0 for no factor.
+ * offset - the transformation offset for the signal value, applied after
+ * pulling out the bit field. Use 0 for no offset.
*
- * Returns the final, transformed value of the signal.
+ * Returns the decoded and transformed value of the signal.
*/
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.
+ * data - the payload containing the signal.
+ * bit_offset - the starting bit for the signal.
+ * bit_size - the width of the signal.
+ * factor - the transformation factor for the signal value, applied after
+ * pulling out the bit field. Use 1.0 for no factor.
+ * offset - the transformation offset for the signal value, applied after
+ * pulling out the bit field. Use 0 for no offset.
*
* Returns false if the value was 0, otherwise true.
*/