Crate dbc_rs

Crate dbc_rs 

Source
Expand description

§dbc-rs

A no_std compatible Rust library for parsing and working with DBC (CAN database) files.

§Features

  • no_std compatible: Works in embedded environments without the standard library
  • Minimal dependencies: Only heapless when using heapless feature (zero dependencies with alloc/std)
  • Memory efficient: Uses Vec (via alloc) for dynamic collections
  • Type-safe: Strong typing for all DBC elements

§Usage

use dbc_rs::Dbc;

let dbc_content = r#"VERSION "1.0"

BU_: ECM TCM

BO_ 256 EngineData : 8 ECM
 SG_ RPM : 0|16@0+ (0.25,0) [0|8000] "rpm" TCM
"#;

let dbc = Dbc::parse(dbc_content)?;

Macros§

builder_setter
Generates a scalar field setter method.
builder_string_setter
Generates a string field setter method.
required_field
Extracts and validates a required Option<T> field.

Structs§

BitTiming
Represents the bit timing section from a DBC file.
BitTimingBuilder
Builders Builder for creating BitTiming programmatically.
Dbc
Represents a complete DBC (CAN database) file.
DbcBuilder
Builder for constructing Dbc instances programmatically.
DecodedSignal
A decoded signal from a CAN message.
ExtendedMultiplexing
Extended Multiplexing definition (SG_MUL_VAL_)
ExtendedMultiplexingBuilder
Builder for creating ExtendedMultiplexing programmatically.
FastDbc
High-performance DBC wrapper with O(1) message lookup.
Message
Represents a CAN message in a DBC file.
MessageBuilder
Builder for creating CAN messages programmatically.
Node
Represents a single node (ECU) with its name and optional comment.
Nodes
Represents a collection of node (ECU) names from a DBC file.
NodesBuilder
Builder for creating Nodes programmatically.
ReceiversBuilder
Builder for creating Receivers programmatically.
Signal
Represents a CAN signal within a message.
SignalBuilder
Builder for creating CAN signals programmatically.
Signals
Encapsulates the signals array for a message
ValueDescriptions
Value descriptions for a signal.
ValueDescriptionsBuilder
Builder for creating ValueDescriptions programmatically.
Version
Represents a version string from a DBC file.
VersionBuilder
Builder for creating Version programmatically.

Enums§

ByteOrder
Byte order (endianness) for signal encoding in CAN messages.
Error
Error type for DBC operations.
Receivers
Represents the receiver nodes for a signal in a DBC file.

Constants§

MAX_EXTENDED_MULTIPLEXING
MAX_MESSAGES
MAX_NAME_SIZE
MAX_NODES
MAX_SIGNALS_PER_MESSAGE
MAX_VALUE_DESCRIPTIONS
PKG_VERSION
The version of this crate as specified in Cargo.toml.

Type Aliases§

Result
Result type alias for operations that can return an Error.