dbc-data

A derive-macro which produces code to access signals within CAN
messages, as described by a .dbc file. The generated code has
very few dependencies: just core primitives and [u8] slices, and
is #[no_std] compatible.
Example
Given a .dbc file containing:
BO_ 1023 SomeMessage: 4 Ecu1
SG_ Unsigned16 : 16|16@0+ (1,0) [0|0] "" Vector__XXX
SG_ Unsigned8 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ Signed8 : 0|8@1- (1,0) [0|0] "" Vector__XXX
The following code can be written to access the fields of the message:
pub use *;
As .dbc files may contain multiple messages, each of these can be
brought into scope by referencing their name as a type (e.g. SomeMessage
as shown above) and this determines what code is generated. Messages
not referenced will not generate any code.
For cases where only certain signals within a message are needed, the
#[dbc_signals] attribute lets you specify which ones are used.
See the test cases in this crate for examples of usage.
Functionality
-
decode signals from PDU
-
encode signals into PDU
-
generate dispatcher for decoding based on ID
-
support multiplexed signals
-
consider scoping generated types to a module