Massive use of shared_ptr about signal and diag message. WIP
[apps/agl-service-can-low-level.git] / CAN-binder / low-can-binding / binding / configuration-generated.cpp
1 #include "configuration.hpp"
2 #include "../can/can-decoder.hpp"
3
4 configuration_t::configuration_t()
5         :can_bus_manager_{utils::config_parser_t{"/etc/dev-mapping.conf"}}
6         , can_message_set_{
7                 can_message_set_t{0, "example", 0, 1, 5, 0, 20, {
8                         {std::make_shared<can_message_definition_t>(can_message_definition_t{"can0", 0x620, can_message_format_t::STANDARD, frequency_clock_t(0.00000f), true,
9                                 {
10                                         {std::make_shared<can_signal_t>(
11                                         can_signal_t{
12                                                 "doors.coffer.open",
13                                                 56,
14                                                 1,
15                                                 1.00000f,
16                                                 0, 
17                                                 0,
18                                                 0,
19                                                 frequency_clock_t(0.00000f),
20                                                 false,
21                                                 false,
22                                                 {},
23                                                 false,
24                                                 decoder_t::booleanDecoder,
25                                                 nullptr,
26                                                 false
27                                         })},
28                                 {std::make_shared<can_signal_t> (
29                                 can_signal_t{
30                                         "doors.driver.open",
31                                         46,
32                                         1,
33                                         1.00000f,
34                                         0, 
35                                         0,
36                                         0,
37                                         frequency_clock_t(0.00000f),
38                                         false,
39                                         false,
40                                         {},
41                                         false,
42                                         decoder_t::booleanDecoder,
43                                         nullptr,
44                                         false
45                                 })},
46                                 {std::make_shared<can_signal_t> (
47                                 can_signal_t{
48                                         "doors.passenger.open",
49                                         47,
50                                         1,
51                                         1.00000f,
52                                         0, 
53                                         0,
54                                         0,
55                                         frequency_clock_t(0.00000f),
56                                         false,
57                                         false,
58                                         {},
59                                         false,
60                                         decoder_t::booleanDecoder,
61                                         nullptr,
62                                         false
63                                 })},
64                                 {std::make_shared<can_signal_t> (
65                                 can_signal_t{
66                                         "doors.rearleft.open",
67                                         54,
68                                         1,
69                                         1.00000f, 
70                                         0, 
71                                         0,
72                                         0,
73                                         frequency_clock_t(0.00000f),
74                                         false,
75                                         false,
76                                         {},
77                                         false,
78                                         decoder_t::booleanDecoder,
79                                         nullptr,
80                                         false
81                                 })},
82                                 {std::make_shared<can_signal_t> (
83                                 can_signal_t{
84                                         "doors.rearright.open",
85                                         55,
86                                         4,
87                                         1.00000f, 
88                                         0, 
89                                         0,
90                                         0,
91                                         frequency_clock_t(0.00000f),
92                                         false,
93                                         false,
94                                         {},
95                                         false,
96                                         decoder_t::booleanDecoder,
97                                         nullptr,
98                                         false
99                                 })}
100                                 }
101                         })}
102                 }}
103         }
104         , diagnostic_messages_
105         {
106                 {
107                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
108                                 4,
109                                 "engine.load",
110                                 0,
111                                 0,
112                                 UNIT::INVALID,
113                                 5.00000f,
114                                 decoder_t::decode_obd2_response,
115                                 nullptr,
116                                 true
117                         })},
118                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
119                                 5,
120                                 "engine.coolant.temperature",
121                                 0,
122                                 0,
123                                 UNIT::INVALID,
124                                 1.00000f,
125                                 decoder_t::decode_obd2_response,
126                                 nullptr,
127                                 true
128                         })},
129                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
130                                 10,
131                                 "fuel.pressure",
132                                 0,
133                                 0,
134                                 UNIT::INVALID,
135                                 1.00000f,
136                                 decoder_t::decode_obd2_response,
137                                 nullptr,
138                                 true
139                         })},
140                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
141                                 11,
142                                 "intake.manifold.pressure",
143                                 0,
144                                 0,
145                                 UNIT::INVALID,
146                                 1.00000f,
147                                 decoder_t::decode_obd2_response,
148                                 nullptr,
149                                 true
150                         })},
151                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
152                                 12,
153                                 "engine.speed",
154                                 0,
155                                 0,
156                                 UNIT::INVALID,
157                                 5.00000f,
158                                 decoder_t::decode_obd2_response,
159                                 nullptr,
160                                 true
161                         })},
162                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
163                                 13,
164                                 "vehicle.speed",
165                                 0,
166                                 0,
167                                 UNIT::INVALID,
168                                 5.00000f,
169                                 decoder_t::decode_obd2_response,
170                                 nullptr,
171                                 true
172                         })},
173                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
174                                 15,
175                                 "intake.air.temperature",
176                                 0,
177                                 0,
178                                 UNIT::INVALID,
179                                 1.00000f,
180                                 decoder_t::decode_obd2_response,
181                                 nullptr,
182                                 true
183                         })},
184                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
185                                 16,
186                                 "mass.airflow",
187                                 0,
188                                 0,
189                                 UNIT::INVALID,
190                                 5.00000f,
191                                 decoder_t::decode_obd2_response,
192                                 nullptr,
193                                 true
194                         })},
195                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
196                                 17,
197                                 "throttle.position",
198                                 0,
199                                 0,
200                                 UNIT::INVALID,
201                                 5.00000f,
202                                 decoder_t::decode_obd2_response,
203                                 nullptr,
204                                 true
205                         })},
206                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
207                                 31,
208                                 "running.time",
209                                 0,
210                                 0,
211                                 UNIT::INVALID,
212                                 1.00000f,
213                                 decoder_t::decode_obd2_response,
214                                 nullptr,
215                                 true
216                         })},
217                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
218                                 45,
219                                 "EGR.error",
220                                 0,
221                                 0,
222                                 UNIT::INVALID,
223                                 0.00000f,
224                                 decoder_t::decode_obd2_response,
225                                 nullptr,
226                                 true
227                         })},
228                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
229                                 47,
230                                 "fuel.level",
231                                 0,
232                                 0,
233                                 UNIT::INVALID,
234                                 1.00000f,
235                                 decoder_t::decode_obd2_response,
236                                 nullptr,
237                                 true
238                         })},
239                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
240                                 51,
241                                 "barometric.pressure",
242                                 0,
243                                 0,
244                                 UNIT::INVALID,
245                                 1.00000f,
246                                 decoder_t::decode_obd2_response,
247                                 nullptr,
248                                 true
249                         })},
250                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
251                                 76,
252                                 "commanded.throttle.position",
253                                 0,
254                                 0,
255                                 UNIT::INVALID,
256                                 1.00000f,
257                                 decoder_t::decode_obd2_response,
258                                 nullptr,
259                                 true
260                         })},
261                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
262                                 82,
263                                 "ethanol.fuel.percentage",
264                                 0,
265                                 0,
266                                 UNIT::INVALID,
267                                 1.00000f,
268                                 decoder_t::decode_obd2_response,
269                                 nullptr,
270                                 true
271                         })},
272                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
273                                 90,
274                                 "accelerator.pedal.position",
275                                 0,
276                                 0,
277                                 UNIT::INVALID,
278                                 5.00000f,
279                                 decoder_t::decode_obd2_response,
280                                 nullptr,
281                                 true
282                         })},
283                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
284                                 91,
285                                 "hybrid.battery-pack.remaining.life",
286                                 0,
287                                 0,
288                                 UNIT::INVALID,
289                                 5.00000f,
290                                 decoder_t::decode_obd2_response,
291                                 nullptr,
292                                 true
293                         })},
294                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
295                                 92,
296                                 "engine.oil.temperature",
297                                 0,
298                                 0,
299                                 UNIT::INVALID,
300                                 1.00000f,
301                                 decoder_t::decode_obd2_response,
302                                 nullptr,
303                                 true
304                         })},
305                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
306                                 94,
307                                 "engine.fuel.rate",
308                                 0,
309                                 0,
310                                 UNIT::INVALID,
311                                 1.00000f,
312                                 decoder_t::decode_obd2_response,
313                                 nullptr,
314                                 true
315                         })},
316                         {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
317                                 99,
318                                 "engine.torque",
319                                 0,
320                                 0,
321                                 UNIT::INVALID,
322                                 1.00000f,
323                                 decoder_t::decode_obd2_response,
324                                 nullptr,
325                                 true
326                         })}
327                 }
328         }
329 {}
330
331 const std::string configuration_t::get_diagnostic_bus() const
332 {
333         return "can0";
334 }