Skip to content

Latest commit

 

History

105 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autors - The Ultimate Automobile Library

autors is a modular Rust workspace for automotive calibration, measurement, diagnostics, bus access, ECU communication, flashing, and symbol processing. It brings common engineering file formats and live-vehicle protocols into one coherent, strongly typed library family.

The workspace is designed for applications that need to move smoothly between description data, binary images, measurement files, bus hardware, protocol clients, and foreign-language integrations without rebuilding the same infrastructure for every tool.

Why autors?

  • End-to-end automotive workflows. Read A2L, CDF, DCM, DBC, LDF, ASC, BLF, LTRC, MDF, ODX, ELF, MAP, Intel HEX, Motorola S-record, VBF, TI-TXT, UF2, and raw binary data, then connect those descriptions to calibration, diagnostics, measurement, or flashing.
  • Modular by design. Use one focused crate or compose the complete stack. File-format crates remain independent of hardware and protocol layers.
  • Async core with synchronous facades. Communication crates implement their state machines once and expose both async APIs and optional blocking wrappers.
  • Cross-platform foundations. Linux SocketCAN is available out of the box, while native CAN and LIN adapters are selected with explicit vendor features.
  • Typed, editable models. Parsers produce domain objects that applications can inspect, modify, validate, and write back.
  • Deterministic and testable I/O. Ordered collections, explicit byte order, pure codecs, injectable transports, and cooperative polling make behavior predictable in tools and tests.
  • Native integration. A stable C ABI, generated C header, C example, and C# P/Invoke example make the A2L and calibration-value APIs accessible outside Rust.

Library map

Foundations

Crate Purpose
autors-util Safe helper algorithms, binary/value formatting, memory ranges, time, and logging.
autors-native Dynamic-library loading and native Seed & Key integration.
autors-runtime Shared runtime primitives and the blocking bridge used by I/O crates.

Description and data formats

Crate Purpose
autors-a2l A2L / ASAM MCD-2 MC object model, parser, and writer.
autors-cdf ASAM CDF calibration-data XML model and I/O.
autors-dcm DCM, MATLAB .m, and CANape PAR calibration conservation files.
autors-datafile Sparse image editing, undo/redo, processing, and conversion for Intel HEX, S-record, VBF, TI-TXT, UF2, HEX ASCII, mixed records, and raw BIN.
autors-dbc Editable CAN DBC databases and signal decoding.
autors-ldf LIN Description Files, payload codecs, and diagnostic helpers.
autors-asc Vector ASC trace reading and writing for classic CAN and CAN FD.
autors-blf Vector BLF log reading and writing for CAN, CAN FD, and LIN frames.
autors-ltrc PEAK PLIN-View Pro LTRC 1.0-1.2 LIN trace reading.
autors-mdf ASAM MDF 3.x and 4.x measurement files.
autors-odx ODX diagnostic data, flash descriptions, multi-file sets, and PDX packages.

Values, formulas, and symbols

Crate Purpose
autors-formula A2L formulas, table/rational conversions, and checksum algorithms.
autors-values Runtime calibration values, ECU memory I/O, and CDF import/export.
autors-symbols Shared symbol matching and A2L address-update workflow.
autors-elf ELF and DWARF parsing for symbols, types, and target data.
autors-map Linker MAP parsing and A2L synchronization candidates.

Bus, transport, and protocols

Crate Purpose
autors-can CAN/CAN FD abstraction, frames, SocketCAN, and optional vendor adapters.
autors-lin LIN devices, frames, checksums, configuration, and vendor adapters.
autors-scheduler DBC/LDF-driven CAN and LIN remaining-bus simulation with runtime selection and transmission hooks.
autors-isotp ISO-TP over CAN and ISO 17987-2 diagnostic transport over LIN.
autors-comm Protocol-independent master state, DAQ lists, buffers, and polling.
autors-ccp CCP master plus typed A2L IF_DATA support.
autors-xcp XCP master for CAN, Ethernet, and SxI plus typed A2L IF_DATA.
autors-diag UDS, KWP2000, DoIP, pcapng DoIP extraction, and CAN/LIN diagnostic adapters.
autors-prm INCA ProF-style PRM/CNF flash-script parsing and execution.

Integration

Crate Purpose
autors-cli CANoe-inspired Ratatui workbench with dynamic all-crate discovery, native engineering-file inspectors, A2L calibration/DAQ-to-MDF and ELF/MAP synchronization, Vector/Kvaser/PEAK CAN/LIN scheduling, ASC/LTRC trace recording/playback, live UDS/ISO-TP/CCP/XCP, DoIP discovery/routing, ODX-driven diagnostics, and PRM preflight.
autors-ffi Panic-safe C ABI for A2L projects, measurements, characteristics, and conversions.

Example applications and plugins

  • autors-security-flasher is a Slint desktop example that discovers configurations, connects to CAN hardware or a virtual ECU, and executes a plugin-defined UDS flashing flow.
  • autors-security-flasher-sdk defines the versioned C ABI shared by the flasher and its plugins.
  • examplecar-fileloader demonstrates an image-loader plugin for HEX, S-record, and BIN files.
  • examplecar-flow demonstrates a configuration-driven UDS programming sequence.
  • examplecar-seedkey demonstrates the native GenerateKeyEx boundary with non-production logic.

Getting started

Install a current stable Rust toolchain, clone the repository, and work from the workspace root:

cargo check --workspace
cargo test --workspace
cargo doc --workspace --no-deps

Workspace packages are currently path-based and are not published. A crate in the same checkout can depend on only the component it needs:

[dependencies]
autors-a2l = { path = "crates/autors-a2l" }
autors-values = { path = "crates/autors-values" }

For example, parsing and writing an A2L file is centered on Project:

use autors_a2l::Project;

fn main() -> autors_a2l::Result<()> {
    let project = Project::parse_file("example.a2l")?;
    println!("modules: {}", project.modules().count());
    project.save("example-copy.a2l")?;
    Ok(())
}

Runtime and feature model

The communication stack uses an async core. Its default feature set enables Tokio-backed runtime services and synchronous wrappers:

  • runtime-tokio uses Tokio for timers and blocking-task dispatch.
  • blocking exposes synchronous facade modules backed by the same async state machines.
  • --no-default-features uses the standard-library runtime fallback and omits the blocking facade unless explicitly requested.

The bus crates keep native dependencies optional. autors-can enables Linux SocketCAN by default and offers 17 vendor-* adapter features; autors-lin offers Kvaser, PEAK, and Vector adapters. Use all-vendors only when an application intentionally wants every adapter compiled in.

Communication is cooperatively driven: devices and protocol masters do not silently start receive threads. Applications call poll, poll_once, or CommKernel::poll_clients; the explicit CAN dispatch helper is available when a background dispatcher is desired.

Typical composition

A calibration or flashing tool can combine the crates without collapsing their boundaries:

  1. Load ECU metadata with autors-a2l or autors-odx.
  2. Load program data with autors-datafile and symbols with autors-elf or autors-map.
  3. Select CAN or LIN hardware through the bus abstraction.
  4. Add ISO-TP, UDS, CCP, or XCP according to the ECU workflow.
  5. Convert raw memory through autors-formula and autors-values.
  6. Record or exchange data through ASC, BLF, LTRC, MDF, CDF, DCM, or the C ABI.

Repository status and license

The workspace is currently version 0.1.0, marked publish = false, and is under active development. The entire project, including all workspace crates, the Security Flasher example, its SDK, and the example plugins, is licensed under the Apache License 2.0.

About

The Ultimate Automobile Library

Resources

Stars

42 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages