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;
69#[cfg(any(feature = "alloc", feature = "kernel"))]
70mod value_descriptions;
71mod version;
72
73pub use byte_order::ByteOrder;
74#[cfg(any(feature = "alloc", feature = "kernel"))]
75pub use dbc::ValueDescriptionsList;
76pub use dbc::{Dbc, MessageList};
77pub use error::{Error, Result};
78pub use message::{Message, Signals};
79pub use nodes::Nodes;
80pub use parse_options::ParseOptions;
81pub use receivers::Receivers;
82pub use signal::Signal;
83#[cfg(any(feature = "alloc", feature = "kernel"))]
84pub use value_descriptions::{ValueDescriptions, ValueDescriptionsBuilder};
85pub use version::Version;
86
87#[cfg(any(feature = "alloc", feature = "kernel"))]
88pub use dbc::DbcBuilder;
89#[cfg(any(feature = "alloc", feature = "kernel"))]
90pub use message::MessageBuilder;
91#[cfg(any(feature = "alloc", feature = "kernel"))]
92pub use nodes::NodesBuilder;
93#[cfg(any(feature = "alloc", feature = "kernel"))]
94pub use receivers::ReceiversBuilder;
95#[cfg(any(feature = "alloc", feature = "kernel"))]
96pub use signal::SignalBuilder;
97#[cfg(any(feature = "alloc", feature = "kernel"))]
98pub use version::VersionBuilder;
99
100pub(crate) use parser::Parser;
101
102#[cfg(feature = "std")]
106pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
107
108pub(crate) const MAX_NODES: usize = 256;
113
114pub(crate) const VERSION: &str = "VERSION";
116pub(crate) const CM_: &str = "CM_";
117pub(crate) const NS_: &str = "NS_";
118pub(crate) const BS_: &str = "BS_";
119pub(crate) const BU_: &str = "BU_";
120pub(crate) const BO_: &str = "BO_";
121pub(crate) const SG_: &str = "SG_";
122pub(crate) const VAL_TABLE_: &str = "VAL_TABLE_";
123pub(crate) const BA_DEF_: &str = "BA_DEF_";
124pub(crate) const BA_DEF_DEF_: &str = "BA_DEF_DEF_";
125pub(crate) const BA_: &str = "BA_";
126pub(crate) const VAL_: &str = "VAL_";
127pub(crate) const SIG_GROUP_: &str = "SIG_GROUP_";
128pub(crate) const SIG_VALTYPE_: &str = "SIG_VALTYPE_";
129pub(crate) const EV_: &str = "EV_";
130pub(crate) const BO_TX_BU_: &str = "BO_TX_BU_";
131
132pub(crate) const VECTOR__INDEPENDENT_SIG_MSG: &str = "VECTOR__INDEPENDENT_SIG_MSG";
134pub(crate) const VECTOR__XXX: &str = "VECTOR__XXX";
135pub(crate) const BA_DEF_DEF_REL_: &str = "BA_DEF_DEF_REL_";
136pub(crate) const BA_DEF_SGTYPE_: &str = "BA_DEF_SGTYPE_";
137pub(crate) const SIGTYPE_VALTYPE_: &str = "SIGTYPE_VALTYPE_";
138pub(crate) const ENVVAR_DATA_: &str = "ENVVAR_DATA_";
139pub(crate) const SIG_TYPE_REF_: &str = "SIG_TYPE_REF_";
140pub(crate) const NS_DESC_: &str = "NS_DESC_";
141pub(crate) const BA_DEF_REL_: &str = "BA_DEF_REL_";
142pub(crate) const BA_SGTYPE_: &str = "BA_SGTYPE_";
143pub(crate) const SGTYPE_VAL_: &str = "SGTYPE_VAL_";
144pub(crate) const BU_SG_REL_: &str = "BU_SG_REL_";
145pub(crate) const BU_EV_REL_: &str = "BU_EV_REL_";
146pub(crate) const BU_BO_REL_: &str = "BU_BO_REL_";
147pub(crate) const SG_MUL_VAL_: &str = "SG_MUL_VAL_";
148pub(crate) const BA_REL_: &str = "BA_REL_";
149pub(crate) const CAT_DEF_: &str = "CAT_DEF_";
150pub(crate) const EV_DATA_: &str = "EV_DATA_";
151pub(crate) const CAT_: &str = "CAT_";
152pub(crate) const FILTER: &str = "FILTER";
153
154#[cfg_attr(not(feature = "std"), allow(dead_code))]
155const DBC_KEYWORDS: &[&str] = &[
156 VECTOR__INDEPENDENT_SIG_MSG,
157 VECTOR__XXX,
158 BA_DEF_DEF_REL_,
159 BA_DEF_SGTYPE_,
160 SIGTYPE_VALTYPE_,
161 ENVVAR_DATA_,
162 SIG_TYPE_REF_,
163 NS_DESC_,
164 BA_DEF_REL_,
165 BA_SGTYPE_,
166 SGTYPE_VAL_,
167 VAL_TABLE_,
168 SIG_GROUP_,
169 SIG_VALTYPE_,
170 BO_TX_BU_,
171 BU_SG_REL_,
172 BU_EV_REL_,
173 BU_BO_REL_,
174 SG_MUL_VAL_,
175 BA_DEF_DEF_,
176 BA_DEF_,
177 BA_REL_,
178 CAT_DEF_,
179 EV_DATA_,
180 BA_,
181 VAL_,
182 CM_,
183 CAT_,
184 NS_,
185 BS_,
186 BU_,
187 BO_,
188 SG_,
189 EV_,
190 VERSION,
191 FILTER,
192];