-
-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathdbcc.1
161 lines (122 loc) · 4.07 KB
/
dbcc.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.\" Manpage for dbcc
.\" Contact [email protected] to correct errors or typos.
.TH dbcc 1 "10 Aug 2021" "1.0.3" "dbcc man page"
.SH NAME
dbcc \- Compile DBC files into C code
.SH SYNOPSIS
dbcc [-] [-h] [-V] [-v] [-g] [-t] [-x] [-j] [-C] [-N] [-D] [-o dir] [-n version] file*
.SH DESCRIPTION
Given a DBC file containing descriptions of CAN messages this program will parse
that file and generate C functions that can serialize and deserialize those
messages. Optionally it can produce XML, JSON, or a CSV file, instead of C.
.B **CAN FD IS CURRENTLY NOT SUPPORTED**.
.SH OPTIONS
.TP
.B -
Stop processing command line arguments
.TP
.B -h
Print a help message to stderr(3) and exit the program unsuccessfully.
.TP
.B -V
Print the version information in semver format, well, semver plus a 'v'
prefix.
.TP
.B -v
Increase the verbosity level of the program.
.TP
.B -g
Print out the grammar used to parse the DBC files, the DBC format is whitespace
sensitive so it looks a lot uglier than it should be if the DBC format has been
designed correctly.
.TP
.B -t
Add timestamps to the generated files.
.TP
.B -x
Produce an XML file instead of a C code and header file.
.TP
.B -j
Produce a JSON file instead of a C code and header file.
.TP
.B -C
Produce a CSV file instead of a C code and header file.
.TP
.B -N
When generating C code, do not include the CAN ID within the name
of generated code.
.TP
.B -b
Convert output to BSM (beSTORM) instead of C and header file
.TP
.B -o dir
Set the output directory
.TP
.B -p
Generate only code to print out CAN messages. Only effect C code generation, if
neither '-p', '-k' or '-u' are specified all code is generated. This option can
be specified along with any of the other code limiting options.
.TP
.B -k
Generate only code to pack CAN messages. Only effect C code generation, if
neither '-p', '-k' or '-u' are specified all code is generated. This option can
be specified along with any of the other code limiting options.
.TP
.B -u
Generate only code to unpack CAN messages. Only effect C code generation, if
neither '-p', '-k' or '-u' are specified all code is generated. This option can
be specified along with any of the other code limiting options.
.TP
.B -s
Disable asserts in generated code. Bad on you for doing this.
.TP
.B -D
This option only affects C code generation.
In lieu of generics, you can make all of the encode/decode functions use double
width floating point types instead of the smallest typed needed for that
signal.
.TP
.B -n version
Specify the output version to use. When not specified, the latest will be used.
.TP
.B file
A DBC file to process
.SH EXAMPLES
.B
./dbcc file.dbc
This will run the program on a DBC file called
.I file.dbc
and make two files, one called
.I file.c
and another called
.I file.h
.SH EXIT STATUS
This command returns zero on success and non zero on failure.
.SH SEE ALSO
For more information, see
.B https://github.com/howerj/dbcc
which contains the original program source, and
.B https://github.com/orangeduck/mpc
for the parser combinator used in this program.
For information about the DBC files for CAN use
.B http://vector.com/vi_candb_en.html
And for what CAN is
.B https://en.wikipedia.org/wiki/CAN_bus
.SH BUGS
The program is in alpha status and thus is unlikely to work or be complete.
This program may produce invalid C, which may be accepted by your compiler
depending on how liberal it is with characters outside of the
range allowed by C in comments. The units string of a CAN DBC file can contain
Unicode characters, which will be put into a comment in the generated C code.
As a work around, use iconv(1) on any input DBC that has non-ASCII
characters in it, or is not in ASCII encoded, like so:
.B iconv -t -c utf8.dbc > ascii.dbc
For any bugs, contact the author.
.SH AUTHOR
Richard James Howe ([email protected])
.SH COPYRIGHT
The dbcc program is licensed under the MIT license, Copyright (c) 2016,2019 Richard
Howe.
The mpc parser combinator library belongs to Daniel Holden
([email protected]) licensed under BSD3, Copyright (c) 2013. This was
used in this project to do the actual parsing.