can_tools
Utilities for parsing and working with automotive CAN data in Rust.
Features
- DBC parser – load
.dbc
databases into structured types. - ASC parser – read
.asc
traces and build an in-memoryCanLog
. - Decoupled model:
CanFrame
: timing + channel + direction + pointer toMessageLog
.MessageLog
: id, name, payload, comment, list of signal indices.SignalLog
: aggregated time-series for a decoded signal (values: Vec<[timestamp, value]>
).
- Helpers –
resolve_message_signals
andSignalLog::value_text_at(ts)
. - Normalizes units by stripping the
"Unit_"
prefix when present.
Quickstart
use ;
Design notes
CanFrame
is intentionally small: sorting and paging remain fast.- Message and Signal data are centralized to avoid duplication and to make charting efficient.
SignalLog.values
uses pairs[timestamp, value]
in seconds.SignalLog.value_text_at(ts)
uses the signal's ownfactor/offset
to reverse-map the raw integer and look up its text viavalue_table
.
License
MIT