Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to decode IEEE754 32-bit floats over CAN #216

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cangen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ Within the `points` member of a NetField object, there is a list of Point object
- `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)
harrison-e marked this conversation as resolved.
Show resolved Hide resolved
- `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 (`false` by default)
harrison-e marked this conversation as resolved.
Show resolved Hide resolved

#### 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!
Expand Down
3 changes: 2 additions & 1 deletion cangen/can-messages/bms.json
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,8 @@
"unit": "",
"points": [
{
"size": 32
"size": 32,
"ieee754_f32": true
harrison-e marked this conversation as resolved.
Show resolved Hide resolved
}
]
}
Expand Down
Loading