Skip to content

LiquidCAN Rust Implementation from ECUEmulator#6

Open
raffael0 wants to merge 3 commits intomainfrom
rust-implementation
Open

LiquidCAN Rust Implementation from ECUEmulator#6
raffael0 wants to merge 3 commits intomainfrom
rust-implementation

Conversation

@raffael0
Copy link
Member

Added the rust liquidCAN protocol implementation. For development details look at the ECUEmulator Repo (commit 48081e45)

l implementation. For development details look at the ECUEmulator Repo(48081e45)
@raffael0 raffael0 requested a review from miDeb February 13, 2026 12:28
Copy link
Member

@miDeb miDeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few questions

- uses: actions/checkout@v4
- name: Build
working-directory: liquidcan_rust
run: cargo build --verbose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about also running clippy?

use crate::payloads;
use crate::CanMessageFrame;

fn test_round_trip(msg: CanMessage) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants