1 #include "configuration.hpp"
2 #include "../can/can-decoder.hpp"
4 configuration_t::configuration_t()
5 : can_bus_manager_{utils::config_parser_t{"/etc/dev-mapping.conf"}}
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{
19 frequency_clock_t(0.00000f),
29 {std::make_shared<can_signal_t> (can_signal_t{
37 frequency_clock_t(0.00000f),
43 decoder_t::booleanDecoder,
47 {std::make_shared<can_signal_t> (can_signal_t{
55 frequency_clock_t(0.00000f),
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",
77 frequency_clock_t(0.00000f),
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{
99 frequency_clock_t(0.00000f),
109 {std::make_shared<can_signal_t> (can_signal_t{
110 "engine.oil.temp.high",
117 frequency_clock_t(0.00000f),
123 decoder_t::booleanDecoder,
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{
139 frequency_clock_t(0.00000f),
145 decoder_t::booleanDecoder,
149 {std::make_shared<can_signal_t> (can_signal_t{
150 "doors.front_left.open",
157 frequency_clock_t(0.00000f),
163 decoder_t::booleanDecoder,
167 {std::make_shared<can_signal_t> (can_signal_t{
168 "doors.front_right.open",
175 frequency_clock_t(0.00000f),
181 decoder_t::booleanDecoder,
185 {std::make_shared<can_signal_t> (can_signal_t{
186 "doors.rear_left.open",
193 frequency_clock_t(0.00000f),
199 decoder_t::booleanDecoder,
203 {std::make_shared<can_signal_t> (can_signal_t{
204 "doors.rear_right.open",
211 frequency_clock_t(0.00000f),
217 decoder_t::booleanDecoder,
221 } // end can_signals vector
222 })} // end can_message_definition entry
224 }, // end can_message_definition vector
225 { // beginning diagnostic_messages_ vector
226 {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
233 decoder_t::decode_obd2_response,
237 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
239 "engine.coolant.temperature",
244 decoder_t::decode_obd2_response,
248 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
255 decoder_t::decode_obd2_response,
259 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
261 "intake.manifold.pressure",
266 decoder_t::decode_obd2_response,
270 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
277 decoder_t::decode_obd2_response,
281 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
288 decoder_t::decode_obd2_response,
292 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
294 "intake.air.temperature",
299 decoder_t::decode_obd2_response,
303 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
310 decoder_t::decode_obd2_response,
314 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
321 decoder_t::decode_obd2_response,
325 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
332 decoder_t::decode_obd2_response,
336 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
343 decoder_t::decode_obd2_response,
347 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
354 decoder_t::decode_obd2_response,
358 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
360 "barometric.pressure",
365 decoder_t::decode_obd2_response,
369 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
371 "ambient.air.temperature",
376 decoder_t::decode_obd2_response,
380 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
382 "commanded.throttle.position",
387 decoder_t::decode_obd2_response,
391 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
393 "ethanol.fuel.percentage",
398 decoder_t::decode_obd2_response,
402 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
404 "accelerator.pedal.position",
409 decoder_t::decode_obd2_response,
413 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
415 "hybrid.battery-pack.remaining.life",
420 decoder_t::decode_obd2_response,
424 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
426 "engine.oil.temperature",
431 decoder_t::decode_obd2_response,
435 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
442 decoder_t::decode_obd2_response,
446 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
453 decoder_t::decode_obd2_response,
458 } // end diagnostic_messages_ vector
459 } // end can_message_set entry
460 } // end can_message_set vector
463 const std::string configuration_t::get_diagnostic_bus() const