Conversation
l implementation. For development details look at the ECUEmulator Repo(48081e45)
miDeb
left a comment
There was a problem hiding this comment.
Looks good, just a few questions
| - uses: actions/checkout@v4 | ||
| - name: Build | ||
| working-directory: liquidcan_rust | ||
| run: cargo build --verbose |
There was a problem hiding this comment.
How do you feel about also running clippy?
| use crate::payloads; | ||
| use crate::CanMessageFrame; | ||
|
|
||
| fn test_round_trip(msg: CanMessage) { |
There was a problem hiding this comment.
I think we should add some tests for decoding failures, not just round-trips, to check our error-handling
| par_count: 5, | ||
| firmware_hash: 1234, | ||
| liquid_hash: 5678, | ||
| device_name: [0xAA; 53], |
There was a problem hiding this comment.
I guess it's irrelevant for this test, but this would not be a valid payload due to 0xaa not being valid ascii and the string not being null terminated. Would that be handled at a higher level? What do we do if we encounter an invalid message?
| pub struct NodeInfoResPayload { | ||
| pub tel_count: u8, // Number of telemetryValues on this node | ||
| pub par_count: u8, // Number of parameters on this node | ||
| pub firmware_hash: u32, // Hash of the firmware version |
There was a problem hiding this comment.
Do we assume rust is only going to run on little-endian machines? Otherwise, might have to use something like https://docs.rs/zerocopy/latest/zerocopy/byteorder/index.html
Added the rust liquidCAN protocol implementation. For development details look at the ECUEmulator Repo (commit 48081e45)