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,
23 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
25 "engine.coolant.temperature",
30 decoder_t::decode_obd2_response,
34 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
41 decoder_t::decode_obd2_response,
45 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
47 "intake.manifold.pressure",
52 decoder_t::decode_obd2_response,
56 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
63 decoder_t::decode_obd2_response,
67 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
74 decoder_t::decode_obd2_response,
78 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
80 "intake.air.temperature",
85 decoder_t::decode_obd2_response,
89 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
96 decoder_t::decode_obd2_response,
100 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
107 decoder_t::decode_obd2_response,
111 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
118 decoder_t::decode_obd2_response,
122 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
129 decoder_t::decode_obd2_response,
133 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
140 decoder_t::decode_obd2_response,
144 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
146 "barometric.pressure",
151 decoder_t::decode_obd2_response,
155 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
157 "ambient.air.temperature",
162 decoder_t::decode_obd2_response,
166 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
168 "commanded.throttle.position",
173 decoder_t::decode_obd2_response,
177 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
179 "ethanol.fuel.percentage",
184 decoder_t::decode_obd2_response,
188 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
190 "accelerator.pedal.position",
195 decoder_t::decode_obd2_response,
199 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
201 "hybrid.battery-pack.remaining.life",
206 decoder_t::decode_obd2_response,
210 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
212 "engine.oil.temperature",
217 decoder_t::decode_obd2_response,
221 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
228 decoder_t::decode_obd2_response,
232 , {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
239 decoder_t::decode_obd2_response,
244 } // end diagnostic_messages_ vector
245 })} // end can_message_set entry
246 } // end can_message_set vector
248 for(auto& cms: can_message_set_)
250 std::vector<std::shared_ptr<can_message_definition_t> >& can_messages_definition = cms->get_can_message_definition();
251 for(auto& cmd : can_messages_definition)
253 cmd->set_parent(cms.get());
254 std::vector<std::shared_ptr<can_signal_t> >& can_signals = cmd->get_can_signals();
255 for(auto& sig: can_signals)
257 sig->set_parent(cmd.get());
261 std::vector<std::shared_ptr<diagnostic_message_t> >& diagnostic_messages = cms->get_diagnostic_messages();
262 for(auto& dm : diagnostic_messages)
264 dm->set_parent(cms.get());
269 const std::string application_t::get_diagnostic_bus() const