1#![cfg_attr(not(feature = "std"), no_std)]
42
43#[cfg(any(feature = "alloc", feature = "kernel"))]
44extern crate alloc;
45
46#[cfg(feature = "kernel")]
51pub mod kernel_mock;
52
53#[cfg(feature = "kernel")]
54pub use kernel_mock as kernel;
55
56#[cfg(any(feature = "alloc", feature = "kernel"))]
58mod compat;
59
60mod byte_order;
61mod dbc;
62mod error;
63mod message;
64mod nodes;
65mod parse_options;
66mod parser;
67mod receivers;
68mod signal;
69mod version;
70
71pub use byte_order::ByteOrder;
72pub use dbc::{Dbc, Messages};
73pub use error::{Error, Result};
74pub use message::{Message, Signals};
75pub use nodes::Nodes;
76pub use parse_options::ParseOptions;
77pub use receivers::Receivers;
78pub use signal::Signal;
79pub use version::Version;
80
81#[cfg(any(feature = "alloc", feature = "kernel"))]
82pub use dbc::DbcBuilder;
83#[cfg(any(feature = "alloc", feature = "kernel"))]
84pub use message::MessageBuilder;
85#[cfg(any(feature = "alloc", feature = "kernel"))]
86pub use nodes::NodesBuilder;
87#[cfg(any(feature = "alloc", feature = "kernel"))]
88pub use receivers::ReceiversBuilder;
89#[cfg(any(feature = "alloc", feature = "kernel"))]
90pub use signal::SignalBuilder;
91#[cfg(any(feature = "alloc", feature = "kernel"))]
92pub use version::VersionBuilder;
93
94pub(crate) use parser::Parser;
95
96#[cfg(feature = "std")]
100pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
101
102pub(crate) const MAX_NODES: usize = 256;
107
108pub(crate) const VERSION: &str = "VERSION";
110pub(crate) const CM_: &str = "CM_";
111pub(crate) const NS_: &str = "NS_";
112pub(crate) const BS_: &str = "BS_";
113pub(crate) const BU_: &str = "BU_";
114pub(crate) const BO_: &str = "BO_";
115pub(crate) const SG_: &str = "SG_";
116pub(crate) const VAL_TABLE_: &str = "VAL_TABLE_";
117pub(crate) const BA_DEF_: &str = "BA_DEF_";
118pub(crate) const BA_DEF_DEF_: &str = "BA_DEF_DEF_";
119pub(crate) const BA_: &str = "BA_";
120pub(crate) const VAL_: &str = "VAL_";
121pub(crate) const SIG_GROUP_: &str = "SIG_GROUP_";
122pub(crate) const SIG_VALTYPE_: &str = "SIG_VALTYPE_";
123pub(crate) const EV_: &str = "EV_";
124pub(crate) const BO_TX_BU_: &str = "BO_TX_BU_";
125
126pub(crate) const VECTOR__INDEPENDENT_SIG_MSG: &str = "VECTOR__INDEPENDENT_SIG_MSG";
128pub(crate) const VECTOR__XXX: &str = "VECTOR__XXX";
129pub(crate) const BA_DEF_DEF_REL_: &str = "BA_DEF_DEF_REL_";
130pub(crate) const BA_DEF_SGTYPE_: &str = "BA_DEF_SGTYPE_";
131pub(crate) const SIGTYPE_VALTYPE_: &str = "SIGTYPE_VALTYPE_";
132pub(crate) const ENVVAR_DATA_: &str = "ENVVAR_DATA_";
133pub(crate) const SIG_TYPE_REF_: &str = "SIG_TYPE_REF_";
134pub(crate) const NS_DESC_: &str = "NS_DESC_";
135pub(crate) const BA_DEF_REL_: &str = "BA_DEF_REL_";
136pub(crate) const BA_SGTYPE_: &str = "BA_SGTYPE_";
137pub(crate) const SGTYPE_VAL_: &str = "SGTYPE_VAL_";
138pub(crate) const BU_SG_REL_: &str = "BU_SG_REL_";
139pub(crate) const BU_EV_REL_: &str = "BU_EV_REL_";
140pub(crate) const BU_BO_REL_: &str = "BU_BO_REL_";
141pub(crate) const SG_MUL_VAL_: &str = "SG_MUL_VAL_";
142pub(crate) const BA_REL_: &str = "BA_REL_";
143pub(crate) const CAT_DEF_: &str = "CAT_DEF_";
144pub(crate) const EV_DATA_: &str = "EV_DATA_";
145pub(crate) const CAT_: &str = "CAT_";
146pub(crate) const FILTER: &str = "FILTER";
147
148#[cfg_attr(not(feature = "std"), allow(dead_code))]
149const DBC_KEYWORDS: &[&str] = &[
150 VECTOR__INDEPENDENT_SIG_MSG,
151 VECTOR__XXX,
152 BA_DEF_DEF_REL_,
153 BA_DEF_SGTYPE_,
154 SIGTYPE_VALTYPE_,
155 ENVVAR_DATA_,
156 SIG_TYPE_REF_,
157 NS_DESC_,
158 BA_DEF_REL_,
159 BA_SGTYPE_,
160 SGTYPE_VAL_,
161 VAL_TABLE_,
162 SIG_GROUP_,
163 SIG_VALTYPE_,
164 BO_TX_BU_,
165 BU_SG_REL_,
166 BU_EV_REL_,
167 BU_BO_REL_,
168 SG_MUL_VAL_,
169 BA_DEF_DEF_,
170 BA_DEF_,
171 BA_REL_,
172 CAT_DEF_,
173 EV_DATA_,
174 BA_,
175 VAL_,
176 CM_,
177 CAT_,
178 NS_,
179 BS_,
180 BU_,
181 BO_,
182 SG_,
183 EV_,
184 VERSION,
185 FILTER,
186];