#can #can-bus #network #sae-j1939

no-std j1939

SAE J1939 is a set of standards that define how ECUs communicate via the CAN bus in heavy-duty vehicles

6 releases

new 0.1.18 Feb 19, 2024
0.1.17 Feb 11, 2024

#181 in Embedded development

Download history 102/week @ 2024-02-05 212/week @ 2024-02-12

314 downloads per month

GPL-3.0 license

1.5K SLoC



A Rust crate for the SAE J1939 automotive protocol.

Getting Started

Build a J1939 frame with PGN 'address claimed'.

let id = j1939:IdBuilder::from_pgn(j1939::PGN::AddressClaimed)

let frame = j1939:FrameBuilder::new(id)

Note that this just an example and not the actual 'address claimed' frame as specified by the SAE J1939 standard.

Some common PGNs have defined data structures. For example the Time/Date PGN is fully implemented.

let timedate = j1939::spn::TimeDate {
    year: 2024,
    month: 4,
    day: 20,
    hour: 10,
    minute: 1,
    second: 58,

let id = j1939::IdBuilder::from_pgn(j1939::PGN::TimeDate)

let frame = j1939::FrameBuilder::new(id)


$ cargo run --example j1939decode 0x0CB34A29

This runs a J1939 ID decoder on the ID '0x0CB34A29'. Each of the J1939 aid properties can be accessed with this crate.


This crate supports no_std. By default the crate creates no_std targets which means you can use the J1939 crate on embedded systems that do not support dynamic allocation.


All feedback welcome. Feel free to file bugs, requests for documentation and any other feedback to the [issue tracker][issues].


J1939 is distributed under the terms of GPL-3.0.

See LICENSE for details.

No runtime deps