Skip to main content

sae_j1939_host/
lib.rs

1// Copyright (c) 2026 Karpagam Karthikeyan
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! # sae-j1939-host
5//!
6//! Host-side (`std`) transport and tooling for [`sae_j1939_rs`]: a Linux
7//! SocketCAN transport built on top of the `no_std` core.
8//!
9//! The core protocol logic lives in [`sae_j1939_rs`] and is re-exported here
10//! for convenience, so a host application needs only this one dependency.
11
12pub use sae_j1939_rs;
13
14/// The transport boundary: what an [`ecu::Ecu`] needs from a CAN bus.
15pub mod bus;
16
17/// Reading `candump` captures, and replaying them through the stack.
18///
19/// The way to check this crate against a real bus without needing one: capture
20/// once with `candump -l`, then replay offline as often as you like.
21/// Cross-platform — a capture is text.
22pub mod log;
23
24/// Reading signal definitions from a DBC file.
25///
26/// The industry-standard way to describe CAN signals, so the parameter database
27/// is yours rather than whatever the crate happened to hardcode. Cross-platform:
28/// a DBC file is text and carries no OS dependency.
29pub mod dbc;
30
31/// A running ECU: a bus and the protocol stack wired together.
32///
33/// Start here unless you need the pieces separately. Generic over
34/// [`bus::Bus`], so it is not tied to SocketCAN or to Linux.
35pub mod ecu;
36
37/// Linux SocketCAN transport (compiled only on `target_os = "linux"`).
38#[cfg(target_os = "linux")]
39pub mod transport;