Format
[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",
8                         { // beginning can_message_definition_ vector
9                                 {std::make_shared<can_message_definition_t>(can_message_definition_t{"can0",0x3D9,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
10                                         { // beginning can_signals vector
11                                                 {std::make_shared<can_signal_t> (can_signal_t{
12                                                         "engine.speed",
13                                                         16,
14                                                         16,
15                                                         0.250000f,
16                                                         0.00000,
17                                                         0,
18                                                         0,
19                                                         frequency_clock_t(0.00000f),
20                                                         true,
21                                                         false,
22                                                         {
23                                                         },
24                                                         false,
25                                                         nullptr,
26                                                         nullptr,
27                                                         false
28                                                 })},
29                                                 {std::make_shared<can_signal_t> (can_signal_t{
30                                                         "fuel.level.low",
31                                                         55,
32                                                         1,
33                                                         1.00000f,
34                                                         0.00000,
35                                                         0,
36                                                         0,
37                                                         frequency_clock_t(0.00000f),
38                                                         true,
39                                                         false,
40                                                         {
41                                                         },
42                                                         false,
43                                                         decoder_t::booleanDecoder,
44                                                         nullptr,
45                                                         false
46                                                 })},
47                                                 {std::make_shared<can_signal_t> (can_signal_t{
48                                                         "fuel.level",
49                                                         8,
50                                                         8,
51                                                         0.392157f,
52                                                         0.00000,
53                                                         0,
54                                                         0,
55                                                         frequency_clock_t(0.00000f),
56                                                         true,
57                                                         false,
58                                                         {
59                                                         },
60                                                         false,
61                                                         nullptr,
62                                                         nullptr,
63                                                         false
64                                                 })}
65                                         } // end can_signals vector
66                                 })} // end can_message_definition entry
67 ,                               {std::make_shared<can_message_definition_t>(can_message_definition_t{"can0",0x3E9,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
68                                         { // beginning can_signals vector
69                                                 {std::make_shared<can_signal_t> (can_signal_t{
70                                                         "vehicle.average.speed",
71                                                         0,
72                                                         15,
73                                                         0.0156250f,
74                                                         0.00000,
75                                                         0,
76                                                         0,
77                                                         frequency_clock_t(0.00000f),
78                                                         true,
79                                                         false,
80                                                         {
81                                                         },
82                                                         false,
83                                                         nullptr,
84                                                         nullptr,
85                                                         false
86                                                 })}
87                                         } // end can_signals vector
88                                 })} // end can_message_definition entry
89 ,                               {std::make_shared<can_message_definition_t>(can_message_definition_t{"can0",0x4D1,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
90                                         { // beginning can_signals vector
91                                                 {std::make_shared<can_signal_t> (can_signal_t{
92                                                         "engine.oil.temp",
93                                                         16,
94                                                         8,
95                                                         1.00000f,
96                                                         0.00000,
97                                                         0,
98                                                         0,
99                                                         frequency_clock_t(0.00000f),
100                                                         true,
101                                                         false,
102                                                         {
103                                                         },
104                                                         false,
105                                                         nullptr,
106                                                         nullptr,
107                                                         false
108                                                 })},
109                                                 {std::make_shared<can_signal_t> (can_signal_t{
110                                                         "engine.oil.temp.high",
111                                                         7,
112                                                         1,
113                                                         1.00000f,
114                                                         0.00000,
115                                                         0,
116                                                         0,
117                                                         frequency_clock_t(0.00000f),
118                                                         true,
119                                                         false,
120                                                         {
121                                                         },
122                                                         false,
123                                                         decoder_t::booleanDecoder,
124                                                         nullptr,
125                                                         false
126                                                 })}
127                                         } // end can_signals vector
128                                 })} // end can_message_definition entry
129 ,                               {std::make_shared<can_message_definition_t>(can_message_definition_t{"can0",0x620,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
130                                         { // beginning can_signals vector
131                                                 {std::make_shared<can_signal_t> (can_signal_t{
132                                                         "doors.boot.open",
133                                                         56,
134                                                         1,
135                                                         1.00000f,
136                                                         0.00000,
137                                                         0,
138                                                         0,
139                                                         frequency_clock_t(0.00000f),
140                                                         true,
141                                                         false,
142                                                         {
143                                                         },
144                                                         false,
145                                                         decoder_t::booleanDecoder,
146                                                         nullptr,
147                                                         false
148                                                 })},
149                                                 {std::make_shared<can_signal_t> (can_signal_t{
150                                                         "doors.front_left.open",
151                                                         46,
152                                                         1,
153                                                         1.00000f,
154                                                         0.00000,
155                                                         0,
156                                                         0,
157                                                         frequency_clock_t(0.00000f),
158                                                         true,
159                                                         false,
160                                                         {
161                                                         },
162                                                         false,
163                                                         decoder_t::booleanDecoder,
164                                                         nullptr,
165                                                         false
166                                                 })},
167                                                 {std::make_shared<can_signal_t> (can_signal_t{
168                                                         "doors.front_right.open",
169                                                         47,
170                                                         1,
171                                                         1.00000f,
172                                                         0.00000,
173                                                         0,
174                                                         0,
175                                                         frequency_clock_t(0.00000f),
176                                                         true,
177                                                         false,
178                                                         {
179                                                         },
180                                                         false,
181                                                         decoder_t::booleanDecoder,
182                                                         nullptr,
183                                                         false
184                                                 })},
185                                                 {std::make_shared<can_signal_t> (can_signal_t{
186                                                         "doors.rear_left.open",
187                                                         54,
188                                                         1,
189                                                         1.00000f,
190                                                         0.00000,
191                                                         0,
192                                                         0,
193                                                         frequency_clock_t(0.00000f),
194                                                         true,
195                                                         false,
196                                                         {
197                                                         },
198                                                         false,
199                                                         decoder_t::booleanDecoder,
200                                                         nullptr,
201                                                         false
202                                                 })},
203                                                 {std::make_shared<can_signal_t> (can_signal_t{
204                                                         "doors.rear_right.open",
205                                                         53,
206                                                         4,
207                                                         1.00000f,
208                                                         0.00000,
209                                                         0,
210                                                         0,
211                                                         frequency_clock_t(0.00000f),
212                                                         true,
213                                                         false,
214                                                         {
215                                                         },
216                                                         false,
217                                                         decoder_t::booleanDecoder,
218                                                         nullptr,
219                                                         false
220                                                 })}
221                                         } // end can_signals vector
222                                 })} // end can_message_definition entry
223
224                 }, // end can_message_definition vector
225                         { // beginning diagnostic_messages_ vector
226                                 {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
227                                         4,
228                                         "engine.load",
229                                         0,
230                                         0,
231                                         UNIT::INVALID,
232                                         5.00000f,
233                                         decoder_t::decode_obd2_response,
234                                         nullptr,
235                                         true
236                                 })}
237 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
238                                         5,
239                                         "engine.coolant.temperature",
240                                         0,
241                                         0,
242                                         UNIT::INVALID,
243                                         1.00000f,
244                                         decoder_t::decode_obd2_response,
245                                         nullptr,
246                                         true
247                                 })}
248 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
249                                         10,
250                                         "fuel.pressure",
251                                         0,
252                                         0,
253                                         UNIT::INVALID,
254                                         1.00000f,
255                                         decoder_t::decode_obd2_response,
256                                         nullptr,
257                                         true
258                                 })}
259 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
260                                         11,
261                                         "intake.manifold.pressure",
262                                         0,
263                                         0,
264                                         UNIT::INVALID,
265                                         1.00000f,
266                                         decoder_t::decode_obd2_response,
267                                         nullptr,
268                                         true
269                                 })}
270 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
271                                         12,
272                                         "engine.speed",
273                                         0,
274                                         0,
275                                         UNIT::INVALID,
276                                         5.00000f,
277                                         decoder_t::decode_obd2_response,
278                                         nullptr,
279                                         true
280                                 })}
281 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
282                                         13,
283                                         "vehicle.speed",
284                                         0,
285                                         0,
286                                         UNIT::INVALID,
287                                         5.00000f,
288                                         decoder_t::decode_obd2_response,
289                                         nullptr,
290                                         true
291                                 })}
292 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
293                                         15,
294                                         "intake.air.temperature",
295                                         0,
296                                         0,
297                                         UNIT::INVALID,
298                                         1.00000f,
299                                         decoder_t::decode_obd2_response,
300                                         nullptr,
301                                         true
302                                 })}
303 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
304                                         16,
305                                         "mass.airflow",
306                                         0,
307                                         0,
308                                         UNIT::INVALID,
309                                         5.00000f,
310                                         decoder_t::decode_obd2_response,
311                                         nullptr,
312                                         true
313                                 })}
314 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
315                                         17,
316                                         "throttle.position",
317                                         0,
318                                         0,
319                                         UNIT::INVALID,
320                                         5.00000f,
321                                         decoder_t::decode_obd2_response,
322                                         nullptr,
323                                         true
324                                 })}
325 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
326                                         31,
327                                         "running.time",
328                                         0,
329                                         0,
330                                         UNIT::INVALID,
331                                         1.00000f,
332                                         decoder_t::decode_obd2_response,
333                                         nullptr,
334                                         true
335                                 })}
336 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
337                                         45,
338                                         "EGR.error",
339                                         0,
340                                         0,
341                                         UNIT::INVALID,
342                                         0.00000f,
343                                         decoder_t::decode_obd2_response,
344                                         nullptr,
345                                         true
346                                 })}
347 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
348                                         47,
349                                         "fuel.level",
350                                         0,
351                                         0,
352                                         UNIT::INVALID,
353                                         1.00000f,
354                                         decoder_t::decode_obd2_response,
355                                         nullptr,
356                                         true
357                                 })}
358 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
359                                         51,
360                                         "barometric.pressure",
361                                         0,
362                                         0,
363                                         UNIT::INVALID,
364                                         1.00000f,
365                                         decoder_t::decode_obd2_response,
366                                         nullptr,
367                                         true
368                                 })}
369 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
370                                         70,
371                                         "ambient.air.temperature",
372                                         0,
373                                         0,
374                                         UNIT::INVALID,
375                                         1.00000f,
376                                         decoder_t::decode_obd2_response,
377                                         nullptr,
378                                         true
379                                 })}
380 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
381                                         76,
382                                         "commanded.throttle.position",
383                                         0,
384                                         0,
385                                         UNIT::INVALID,
386                                         1.00000f,
387                                         decoder_t::decode_obd2_response,
388                                         nullptr,
389                                         true
390                                 })}
391 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
392                                         82,
393                                         "ethanol.fuel.percentage",
394                                         0,
395                                         0,
396                                         UNIT::INVALID,
397                                         1.00000f,
398                                         decoder_t::decode_obd2_response,
399                                         nullptr,
400                                         true
401                                 })}
402 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
403                                         90,
404                                         "accelerator.pedal.position",
405                                         0,
406                                         0,
407                                         UNIT::INVALID,
408                                         5.00000f,
409                                         decoder_t::decode_obd2_response,
410                                         nullptr,
411                                         true
412                                 })}
413 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
414                                         91,
415                                         "hybrid.battery-pack.remaining.life",
416                                         0,
417                                         0,
418                                         UNIT::INVALID,
419                                         5.00000f,
420                                         decoder_t::decode_obd2_response,
421                                         nullptr,
422                                         true
423                                 })}
424 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
425                                         92,
426                                         "engine.oil.temperature",
427                                         0,
428                                         0,
429                                         UNIT::INVALID,
430                                         1.00000f,
431                                         decoder_t::decode_obd2_response,
432                                         nullptr,
433                                         true
434                                 })}
435 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
436                                         94,
437                                         "engine.fuel.rate",
438                                         0,
439                                         0,
440                                         UNIT::INVALID,
441                                         1.00000f,
442                                         decoder_t::decode_obd2_response,
443                                         nullptr,
444                                         true
445                                 })}
446 ,                               {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
447                                         99,
448                                         "engine.torque",
449                                         0,
450                                         0,
451                                         UNIT::INVALID,
452                                         1.00000f,
453                                         decoder_t::decode_obd2_response,
454                                         nullptr,
455                                         true
456                                 })}
457                         } // end diagnostic_messages_ vector
458                 } // end can_message_set entry
459         } // end can_message_set vector
460 {}
461
462 const std::string configuration_t::get_diagnostic_bus() const
463 {
464         return "can0";
465 }
466
467