You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-20Lines changed: 26 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -9,20 +9,21 @@ Table of Contents
9
9
10
10
-[C++ CAN Parser](#c-can-parser)
11
11
-[Table of Contents](#table-of-contents)
12
-
-[Compile and include the library](#compile-and-include-the-library)
13
-
-[The public headers](#the-public-headers)
14
-
-[Compilation](#compilation)
15
-
-[Parsing a CAN database](#parsing-a-can-database)
16
-
-[The API](#the-api)
17
-
-[`CANSignal`](#cansignal)
18
-
-[`CANFrame`](#canframe)
19
-
-[`CANDatabase`](#candatabase)
20
-
-[can-parse](#can-parse)
21
-
-[Supported standards:](#supported-standards)
12
+
-[Compile and include the library](#compile-and-include-the-library)
13
+
-[The public headers](#the-public-headers)
14
+
-[Compilation](#compilation)
15
+
-[Parsing a CAN database](#parsing-a-can-database)
16
+
-[How to use the database](#how-to-use-the-database)
17
+
-[`CANSignal`](#cansignal)
18
+
-[`CANFrame`](#canframe)
19
+
-[`CANDatabase`](#candatabase)
20
+
-[can-parse](#can-parse)
21
+
-[Supported standards](#supported-standards)
22
22
23
-
## Compile and include the library
23
+
Compile and include the library
24
+
===============================
24
25
25
-
###The public headers
26
+
## The public headers
26
27
27
28
You need to put the public headers in an appropriate place:
28
29
@@ -33,7 +34,7 @@ your_project/
33
34
|_ cpp-can-parser/ # <-- Put here the public headers
34
35
```
35
36
36
-
###Compilation
37
+
## Compilation
37
38
38
39
cpp-can-parser is not a header-only library. I recommand CMake to include the library into your project:
39
40
@@ -59,7 +60,8 @@ cpp-can-parser is not provided with an already existing Makefile. You will still
59
60
LD_FLAGS=-Lpath/to/the/library -lcpp-can-parser
60
61
```
61
62
62
-
## Parsing a CAN database
63
+
Parsing a CAN database
64
+
======================
63
65
64
66
The main feature of the library is the possibility of parsing a file representing the CAN database. There are several popular file formats and the list of the currently ones is available at the end of this README.
65
67
@@ -89,7 +91,8 @@ One can see that `CANDatabase::fromFile()` can throw a CANDatabaseException. Thi
89
91
If the data that you are using does not come from a file, it is also possible to use `CANDatabase::fromString("...")` which behaves just like its counterpart.
90
92
91
93
92
-
## The API
94
+
How to use the database
95
+
=======================
93
96
94
97
The library exposes three main kind of objects:
95
98
* `CANDatabase` : represents the whole database. It gatherse all the informations of the database such as the frames and their signals, but you can also find the filename from which the database was created (if applicable).
@@ -98,7 +101,7 @@ The library exposes three main kind of objects:
98
101
99
102
All those classes try to behave the closest possible to STL containers. They notably implement all the required iterators methods so **they can be used in range-based for loops**
100
103
101
-
### `CANSignal`
104
+
## `CANSignal`
102
105
103
106
Here are the most important properties of a `CANSignal` instance:
104
107
@@ -114,7 +117,7 @@ Here are the most important properties of a `CANSignal` instance:
114
117
115
118
Sometimes the database also includes "enumerations", ie for given signals we associate string literals to values (example: 0 = Nothing, 1 = State 1, 2 = State 2). `choices()` allows to iterate through the signal's enumeration (if any).
116
119
117
-
### `CANFrame`
120
+
## `CANFrame`
118
121
119
122
Here are the most important properties of a `CANFrame` instance:
120
123
@@ -136,7 +139,7 @@ for(const auto& sig : frame) {
136
139
}
137
140
```
138
141
139
-
###`CANDatabase`
142
+
## `CANDatabase`
140
143
141
144
Here are the most important properties of a `CANDatabase` instance:
142
145
@@ -155,7 +158,8 @@ for(const auto& frame : db) {
155
158
}
156
159
```
157
160
158
-
## can-parse
161
+
can-parse
162
+
=========
159
163
160
164
`can-parse` is a utility program that allows you to parse the content of a CAN database which is then output to the standard output.
161
165
@@ -196,5 +200,7 @@ To compile, just use the following instructions:
196
200
197
201
There you got yourself a very nice installation of `can-parse` :) !
0 commit comments