From c2061ae62cf670cdb6fb6ac9c966f3ec74ffc916 Mon Sep 17 00:00:00 2001 From: Harrison Eckert <65581761+harrison-e@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:15:39 -0500 Subject: [PATCH] Added support to decode IEEE754 32-bit floats over CAN (#216) * Added ieee754-f32 field to CANPoint spec in cangen/README * Fixed format field description in cangen/README --- cangen/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cangen/README.md b/cangen/README.md index e0c41965..8231c452 100644 --- a/cangen/README.md +++ b/cangen/README.md @@ -107,8 +107,9 @@ Within the `points` member of a NetField object, there is a list of Point object - `size`, an integer representing the size to be read in bits - `signed` (optional), boolean representing whether or not the number is signed in two's complement form (`false` by default) - `endianness` (optional), string representing the byte endianness of the bits being read, either `"big"` or `"little"` (`"big"` by default) -- `format` (optional, not recommended), string representing the final type of the data (`"f32"` by default) +- `format` (optional), string representing the format of the bits (e.g. `divide100`) (blank by default) - `default_value` (optional, only for Encodable Messages), float representing the default value to be sent before a command is received or when an empty command is received. This is ignored when decoding the Point (`0` by default) +- `ieee754_f32` (optional), boolean indicating if the bits in the Point should be interpreted as an IEEE754 32-bit float. **Be sure to endian swap the float before sending!!** (`false` by default) #### Sim Within the `sim` member of a NetField object, there is a single sim object. This object is one of two types, either `sweep` or `enum`. However these types are implied, not written in the JSON, just use them correctly!