diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/toyota/configuration-generated.cpp | 282 | ||||
-rw-r--r-- | examples/toyota/signals.json | 169 |
2 files changed, 451 insertions, 0 deletions
diff --git a/examples/toyota/configuration-generated.cpp b/examples/toyota/configuration-generated.cpp new file mode 100644 index 00000000..fe8b56d1 --- /dev/null +++ b/examples/toyota/configuration-generated.cpp @@ -0,0 +1,282 @@ +#include "configuration.hpp" +#include "can/can-decoder.hpp" + +configuration_t::configuration_t() + : can_message_set_{{0, "example", 0, 2, 2, 0, 19}} + , can_message_definition_ + { + { + can_message_definition_t(0, "vcan0", 0x442, can_message_format_t::STANDARD, frequency_clock_t(0.00000f), true), + can_message_definition_t(0, "vcan0", 0x620, can_message_format_t::STANDARD, frequency_clock_t(0.00000f), true) + } + } + , can_signals_ + { + { + { + 0, + 0, + "doors.passenger.open", + 0, + 4, + 0.00000f, + 0, + 0, + 0, + frequency_clock_t(0.00000f), + true, + false, + { + }, + false, + decoder_t::booleanDecoder, + nullptr, + false + } + }, + { + { + 0, + 1, + "doors.driver.open", + 0, + 4, + 0.00000f, + 0, + 0, + 0, + frequency_clock_t(0.00000f), + true, + false, + { + }, + false, + decoder_t::booleanDecoder, + nullptr, + false + } + } + } + , diagnostic_messages_ + { + { + { + 4, + "engine.load", + 0, + 0, + UNIT::INVALID, + 5.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 5, + "engine.coolant.temperature", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 10, + "fuel.pressure", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 11, + "intake.manifold.pressure", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 12, + "engine.speed", + 0, + 0, + UNIT::INVALID, + 5.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 13, + "vehicle.speed", + 0, + 0, + UNIT::INVALID, + 5.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 15, + "intake.air.temperature", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 16, + "mass.airflow", + 0, + 0, + UNIT::INVALID, + 5.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 17, + "throttle.position", + 0, + 0, + UNIT::INVALID, + 5.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 31, + "running.time", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 45, + "EGR.error", + 0, + 0, + UNIT::INVALID, + 0.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 47, + "fuel.level", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 51, + "barometric.pressure", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 76, + "commanded.throttle.position", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 82, + "ethanol.fuel.percentage", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 90, + "accelerator.pedal.position", + 0, + 0, + UNIT::INVALID, + 5.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 91, + "hybrid.battery-pack.remaining.life", + 0, + 0, + UNIT::INVALID, + 5.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 92, + "engine.oil.temperature", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + }, + { + 99, + "engine.torque", + 0, + 0, + UNIT::INVALID, + 1.00000f, + decoder_t::decode_obd2_response, + nullptr, + true + } + } + } +{ +} + +const std::string configuration_t::get_diagnostic_bus() const +{ + return "vcan0"; +} + + diff --git a/examples/toyota/signals.json b/examples/toyota/signals.json new file mode 100644 index 00000000..037b4d72 --- /dev/null +++ b/examples/toyota/signals.json @@ -0,0 +1,169 @@ +{ "name": "example", + "extra_sources": [], + "initializers": [], + "loopers": [], + "buses": {}, + "commands": [], + "messages": { + "0x620": { + "bus": "vcan0", + "signals": { + "doors.driver.open": { + "generic_name": "doors.driver.open", + "bit_position": 0, + "bit_size": 4, + "factor": 0, + "offset": 0, + "decoder": "decoder_t::booleanDecoder"} + } + }, + "0x442": { + "bus": "vcan0", + "signals": { + "doors.passenger.open": { + "generic_name": "doors.passenger.open", + "bit_position": 0, + "bit_size": 4, + "factor": 0, + "offset": 0, + "decoder": "decoder_t::booleanDecoder"} + } + } + }, + "diagnostic_messages": [ + { + "bus": "vcan0", + "pid": 4, + "name": "engine.load", + "frequency": 5, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 5, + "name": "engine.coolant.temperature", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 10, + "name": "fuel.pressure", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 11, + "name": "intake.manifold.pressure", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 12, + "name": "engine.speed", + "frequency": 5, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 13, + "name": "vehicle.speed", + "frequency": 5, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 15, + "name": "intake.air.temperature", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 16, + "name": "mass.airflow", + "frequency": 5, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 17, + "name": "throttle.position", + "frequency": 5, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 31, + "name": "running.time", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 45, + "name": "EGR.error", + "frequency": 0, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 47, + "name": "fuel.level", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 51, + "name": "barometric.pressure", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 76, + "name": "commanded.throttle.position", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 82, + "name": "ethanol.fuel.percentage", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 90, + "name": "accelerator.pedal.position", + "frequency": 5, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 91, + "name": "hybrid.battery-pack.remaining.life", + "frequency": 5, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 92, + "name": "engine.oil.temperature", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + }, + { + "bus": "vcan0", + "pid": 99, + "name": "engine.torque", + "frequency": 1, + "decoder": "decoder_t::decode_obd2_response" + } + + ] +} |