1 #include "application.hpp"
2 #include "../can/can-decoder.hpp"
4 application_t::application_t()
5 : can_bus_manager_{utils::config_parser_t{"/etc/dev-mapping.conf"}}
7 {std::make_shared<can_message_set_t>(can_message_set_t{0,"example",
8 { // beginning can_message_definition_ vector
10 }, // end can_message_definition vector
11 { // beginning diagnostic_messages_ vector
12 {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
19 decoder_t::decode_obd2_response,
24 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
26 "engine.coolant.temperature",
31 decoder_t::decode_obd2_response,
36 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
43 decoder_t::decode_obd2_response,
48 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
50 "intake.manifold.pressure",
55 decoder_t::decode_obd2_response,
60 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
67 decoder_t::decode_obd2_response,
72 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
79 decoder_t::decode_obd2_response,
84 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
86 "intake.air.temperature",
91 decoder_t::decode_obd2_response,
96 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
103 decoder_t::decode_obd2_response,
108 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
115 decoder_t::decode_obd2_response,
120 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
127 decoder_t::decode_obd2_response,
132 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
139 decoder_t::decode_obd2_response,
144 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
151 decoder_t::decode_obd2_response,
156 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
158 "barometric.pressure",
163 decoder_t::decode_obd2_response,
168 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
170 "ambient.air.temperature",
175 decoder_t::decode_obd2_response,
180 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
182 "commanded.throttle.position",
187 decoder_t::decode_obd2_response,
192 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
194 "ethanol.fuel.percentage",
199 decoder_t::decode_obd2_response,
204 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
206 "accelerator.pedal.position",
211 decoder_t::decode_obd2_response,
216 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
218 "hybrid.battery-pack.remaining.life",
223 decoder_t::decode_obd2_response,
228 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
230 "engine.oil.temperature",
235 decoder_t::decode_obd2_response,
240 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
247 decoder_t::decode_obd2_response,
252 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
259 decoder_t::decode_obd2_response,
265 } // end diagnostic_messages_ vector
266 })} // end can_message_set entry
267 } // end can_message_set vector
269 for(auto& cms: can_message_set_)
271 std::vector<std::shared_ptr<can_message_definition_t> >& can_messages_definition = cms->get_can_message_definition();
272 for(auto& cmd : can_messages_definition)
274 cmd->set_parent(cms.get());
275 std::vector<std::shared_ptr<can_signal_t> >& can_signals = cmd->get_can_signals();
276 for(auto& sig: can_signals)
278 sig->set_parent(cmd.get());
282 std::vector<std::shared_ptr<diagnostic_message_t> >& diagnostic_messages = cms->get_diagnostic_messages();
283 for(auto& dm : diagnostic_messages)
285 dm->set_parent(cms.get());
290 const std::string application_t::get_diagnostic_bus() const