korri-n2k 0.7.1

no_std-first NMEA 2000 protocol stack for embedded and Linux systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! In-memory representation of an SAE J1939 / NMEA 2000 CAN frame.
use crate::protocol::transport::can_id::CanId;

#[derive(Copy, Clone, Debug, PartialEq, Eq)]
/// Raw NMEA 2000 frame as read from the CAN bus.
pub struct CanFrame {
    /// Full 29-bit CAN identifier stored inside a `u32`.
    pub id: CanId,
    /// Payload buffer. Classic CAN frames always provide eight bytes.
    pub data: [u8; 8],
    /// Number of valid payload bytes (Data Length Code, 0 to 8).
    pub len: usize,
}