A Rust parser for CAN DBC files using Pest grammar, enabling structured access to CAN network definitions.
can-dbc is a Rust library that parses CAN DBC (Database CAN) files, which define the messages and signals transmitted over a Controller Area Network (CAN) bus. It provides a structured representation of CAN network specifications, essential for automotive, industrial, and embedded systems development. The library uses the Pest parsing library for robust grammar definition and supports generating Rust structs from DBC definitions.
Rust developers working on automotive, industrial automation, or embedded systems projects that require interacting with CAN bus networks, such as those building diagnostic tools, simulators, or firmware for ECUs.
Developers choose can-dbc for its correctness and usability, offering a reliable foundation for CAN-related tooling in Rust with comprehensive DBC specification support. It accommodates real-world file variations and enables type-safe CAN frame handling through Rust code generation.
Rust dbc parser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses the Pest parsing library for a maintainable and accurate grammar definition, ensuring reliable parsing of DBC files as highlighted in the Key Features.
Implements most DBC specification parts including messages, signals, nodes, and attributes, with a detailed checklist in the README showing extensive coverage.
Enables generating Rust structs from DBC definitions, facilitating compile-time checks for CAN frame handling, as demonstrated in the usage example.
Accommodates minor deviations like multispace separators and flexible VAL_ suffixes, making it adaptable to non-standard DBC files encountered in practice.
Missing some DBC parts such as 'sigtype_attr_list' and deprecated categories, which could hinder use in projects requiring full standard compliance.
Exclusively tied to Rust, limiting cross-language compatibility and requiring Rust expertise, which may not suit mixed-language or non-Rust teams.
For proper CAN frame reading/writing, the README recommends using dbc-codegen, meaning can-dbc alone isn't a complete solution and adds integration complexity.