#include "application.hpp"
#include "../can/can-decoder.hpp"
+#include "../can/can-encoder.hpp"
application_t::application_t()
: can_bus_manager_{utils::config_parser_t{"/etc/dev-mapping.conf"}}
, can_message_set_{
- {std::make_shared<can_message_set_t>(can_message_set_t{0,"example",
+ {std::make_shared<can_message_set_t>(can_message_set_t{0,"AGL Virtual Car",
{ // beginning can_message_definition_ vector
- {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x3D9,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+ {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "ls",
+ 0x30,
+ false,
+ can_message_format_t::EXTENDED,
+ frequency_clock_t(5.00000f),
+ true,
+ { // beginning can_signals vector
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "hvac.fan.speed",
+ 32,
+ 8,
+ 23.5294f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ nullptr,
+ nullptr,
+ false
+ })},
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "hvac.temperature.left",
+ 0,
+ 8,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ true,
+ nullptr,
+ nullptr,
+ false
+ })},
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "hvac.temperature.right",
+ 8,
+ 8,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ true,
+ nullptr,
+ nullptr,
+ false
+ })},
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "hvac.temperature.average",
+ 16,
+ 8,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ true,
+ nullptr,
+ nullptr,
+ false
+ })}
+ } // end can_signals vector
+ })} // end can_message_definition entry
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x3D9,
+ true,
+ can_message_format_t::STANDARD,
+ frequency_clock_t(5.00000f),
+ true,
{ // beginning can_signals vector
{std::make_shared<can_signal_t> (can_signal_t{
"engine.speed",
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
})}
} // end can_signals vector
})} // end can_message_definition entry
-, {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x3E9,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x3E9,
+ false,
+ can_message_format_t::EXTENDED,
+ frequency_clock_t(5.00000f),
+ true,
{ // beginning can_signals vector
{std::make_shared<can_signal_t> (can_signal_t{
"vehicle.average.speed",
})}
} // end can_signals vector
})} // end can_message_definition entry
-, {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x4D1,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x4D1,
+ false,
+ can_message_format_t::STANDARD,
+ frequency_clock_t(5.00000f),
+ true,
{ // beginning can_signals vector
{std::make_shared<can_signal_t> (can_signal_t{
"engine.oil.temp",
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
+ nullptr,
+ false
+ })}
+ } // end can_signals vector
+ })} // end can_message_definition entry
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x5D1,
+ false,
+ can_message_format_t::STANDARD,
+ frequency_clock_t(5.00000f),
+ true,
+ { // beginning can_signals vector
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "accelerator.pedal.position",
+ 16,
+ 8,
+ 0.500000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ nullptr,
+ nullptr,
+ false
+ })},
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "steering.wheel.angle",
+ 4,
+ 12,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ nullptr,
+ nullptr,
+ false
+ })}
+ } // end can_signals vector
+ })} // end can_message_definition entry
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x5D2,
+ false,
+ can_message_format_t::STANDARD,
+ frequency_clock_t(5.00000f),
+ true,
+ { // beginning can_signals vector
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "transmission.gearinfo",
+ 20,
+ 4,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ nullptr,
+ nullptr,
+ false
+ })},
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "transmission.mode",
+ 16,
+ 4,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ nullptr,
+ nullptr,
+ false
+ })}
+ } // end can_signals vector
+ })} // end can_message_definition entry
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x5D3,
+ false,
+ can_message_format_t::STANDARD,
+ frequency_clock_t(5.00000f),
+ true,
+ { // beginning can_signals vector
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "turnsignal.status",
+ 26,
+ 3,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ nullptr,
+ nullptr,
+ false
+ })},
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "lightstatus.brake",
+ 7,
+ 1,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ decoder_t::decode_boolean,
+ nullptr,
+ false
+ })},
+ {std::make_shared<can_signal_t> (can_signal_t{
+ "parking.brake.status",
+ 8,
+ 1,
+ 1.00000f,
+ 0.00000,
+ 0,
+ 0,
+ frequency_clock_t(0.00000f),
+ true,
+ false,
+ {
+ },
+ false,
+ decoder_t::decode_boolean,
nullptr,
false
})}
} // end can_signals vector
})} // end can_message_definition entry
-, {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x620,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x620,
+ false,
+ can_message_format_t::STANDARD,
+ frequency_clock_t(5.00000f),
+ true,
{ // beginning can_signals vector
{std::make_shared<can_signal_t> (can_signal_t{
"doors.boot.open",
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})}
} // end can_signals vector
})} // end can_message_definition entry
-, {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x799,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+, {std::make_shared<can_message_definition_t>(can_message_definition_t{
+ "hs",
+ 0x799,
+ false,
+ can_message_format_t::STANDARD,
+ frequency_clock_t(5.00000f),
+ true,
{ // beginning can_signals vector
{std::make_shared<can_signal_t> (can_signal_t{
"windows.front_left.open",
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})},
{
},
false,
- decoder_t::booleanDecoder,
+ decoder_t::decode_boolean,
nullptr,
false
})}
5.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
5,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
10,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
11,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
12,
5.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
13,
5.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
15,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
16,
5.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
17,
5.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
31,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
45,
0.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
47,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
51,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
70,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
76,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
82,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
90,
5.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
91,
5.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
92,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
94,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
, {std::make_shared<diagnostic_message_t>(diagnostic_message_t{
99,
1.00000f,
decoder_t::decode_obd2_response,
nullptr,
- true
+ true,
+ false
})}
} // end diagnostic_messages_ vector
std::vector<std::shared_ptr<diagnostic_message_t> >& diagnostic_messages = cms->get_diagnostic_messages();
for(auto& dm : diagnostic_messages)
{
- dm->set_parent(cms.get());
+ dm->set_parent(cms);
}
}
}