From 5178fbebb1b2aa6a25c50259f2545e97502c4248 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 19 Nov 2019 12:44:05 +0100 Subject: examples: Update using new Generator New generator including new signals capabilities: - sign - big_endian frame - default length Bug-AGL: SPEC-2988 Change-Id: Icf2e4dd7ef880a73527103c90a8063cf3d042e41 Signed-off-by: Romain Forlot --- examples/OBD2/application-generated.cpp | 2 +- examples/agl-vcar/application-generated.cpp | 12 +- examples/agl-vcar/signals.json | 2 - examples/basic/application-generated.cpp | 101 ++- examples/engine/application-generated.cpp | 38 +- examples/hvac/application-generated.cpp | 24 +- examples/j1939/application-generated.cpp | 1010 ---------------------- examples/j1939/j1939-simple.cpp | 1050 +++++++++++++++++++++++ examples/j1939/j1939_parse.json | 6 - examples/tests/application-generated.cpp | 363 ++++---- examples/toyota/auris/application-generated.cpp | 87 +- 11 files changed, 1443 insertions(+), 1252 deletions(-) delete mode 100644 examples/j1939/application-generated.cpp create mode 100644 examples/j1939/j1939-simple.cpp diff --git a/examples/OBD2/application-generated.cpp b/examples/OBD2/application-generated.cpp index 5bed7599..f5788d9b 100644 --- a/examples/OBD2/application-generated.cpp +++ b/examples/OBD2/application-generated.cpp @@ -269,7 +269,7 @@ application_t::application_t() { for(std::shared_ptr cms: message_set_) { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); + std::vector> messages_definition = cms->get_messages_definition(); for(std::shared_ptr cmd : messages_definition) { cmd->set_parent(cms); diff --git a/examples/agl-vcar/application-generated.cpp b/examples/agl-vcar/application-generated.cpp index baf05098..966755ef 100644 --- a/examples/agl-vcar/application-generated.cpp +++ b/examples/agl-vcar/application-generated.cpp @@ -499,7 +499,7 @@ application_t::application_t() })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x3D9,"", 8, 2048, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x3D9,"",8,128,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.speed",// generic_name @@ -569,7 +569,7 @@ application_t::application_t() })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x3E9,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x3E9,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "vehicle.average.speed",// generic_name @@ -595,7 +595,7 @@ application_t::application_t() })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x4D1,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x4D1,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.oil.temp",// generic_name @@ -643,7 +643,7 @@ application_t::application_t() })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x620,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x620,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "doors.boot.open",// generic_name @@ -757,7 +757,7 @@ application_t::application_t() })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x799,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x799,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "windows.front_left.open",// generic_name @@ -1111,7 +1111,7 @@ application_t::application_t() { for(std::shared_ptr cms: message_set_) { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); + std::vector> messages_definition = cms->get_messages_definition(); for(std::shared_ptr cmd : messages_definition) { cmd->set_parent(cms); diff --git a/examples/agl-vcar/signals.json b/examples/agl-vcar/signals.json index 706f8d46..2a4f5187 100644 --- a/examples/agl-vcar/signals.json +++ b/examples/agl-vcar/signals.json @@ -9,7 +9,6 @@ "0x620": { "bus": "hs", "is_fd" : false, - "is_extended": false, "is_j1939" : false, "length" : 8, "signals": { @@ -58,7 +57,6 @@ "0x799": { "bus": "hs", "is_fd" : false, - "is_extended": false, "is_j1939" : false, "length" : 8, "signals": { diff --git a/examples/basic/application-generated.cpp b/examples/basic/application-generated.cpp index bf321067..97482f65 100644 --- a/examples/basic/application-generated.cpp +++ b/examples/basic/application-generated.cpp @@ -2,6 +2,28 @@ #include "../can/can-decoder.hpp" #include "../can/can-encoder.hpp" +#include "can/canread.h" + +using openxc::can::read::publishNumericalMessage; + +void handleSteeringWheelMessage(CanMessage* message, + CanSignal* signals, int signalCount, Pipeline* pipeline) { + publishNumericalMessage("latitude", 42.0, pipeline); +} + +openxc_DynamicField handleInverted(CanSignal* signal, CanSignal* signals, + int signalCount, float value, bool* send) { + return openxc::payload::wrapNumber(value * -1); +} + +void initializeMyStuff() { } + +void initializeOtherStuff() { } + +void myLooper() { + // this function will be called once, each time through the main loop, after + // all CAN message processing has been completed +} // >>>>> handlers.cpp >>>>> #include "can/canread.h" @@ -34,7 +56,7 @@ application_t::application_t() , message_set_{ {std::make_shared(message_set_t{0,"example", { // beginning message_definition_ vector - {std::make_shared(message_definition_t{"hs", 0x128,"ECM_z_5D2", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, + {std::make_shared(message_definition_t{"hs",0x128,"ECM_z_5D2",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine_speed",// generic_name @@ -54,8 +76,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -82,8 +105,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -100,12 +124,13 @@ application_t::application_t() { },// states false,// writable - handleUnsignedSteeringWheelAngle,// decoder + decoder_t::v1_to_v2_gnedSteeringWheelAngle,// decoder nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -122,12 +147,13 @@ application_t::application_t() { },// states false,// writable - ignoreDecoder,// decoder + decoder_t::v1_to_v2_der,// decoder nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -144,12 +170,13 @@ application_t::application_t() { },// states false,// writable - ignoreDecoder,// decoder + decoder_t::v1_to_v2_der,// decoder nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector @@ -164,7 +191,7 @@ application_t::application_t() 0, UNIT::INVALID, 1.00000f, - handleObd2Pid, + decoder_t::v1_to_v2_Pid, nullptr, true, false @@ -188,7 +215,7 @@ application_t::application_t() 0, UNIT::INVALID, 1.00000f, - handleMyDiagRequest, + decoder_t::v1_to_v2_agRequest, nullptr, true, false @@ -200,7 +227,7 @@ application_t::application_t() { for(std::shared_ptr cms: message_set_) { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); + std::vector> messages_definition = cms->get_messages_definition(); for(std::shared_ptr cmd : messages_definition) { cmd->set_parent(cms); @@ -225,3 +252,43 @@ const std::string application_t::get_diagnostic_bus() const } +openxc_DynamicField decoder_t::v1_to_v2_gnedSteeringWheelAngle(signal_t& signal, std::shared_ptr message, bool* send){ + float value = decoder_t::parse_signal_bitfield(signal, message); + openxc_DynamicField ret = decoder_t::gnedSteeringWheelAngle(signal, value, send); + if ((signal.get_last_value() == value && !signal.get_send_same()) || !*send ){ + *send = false; + } + signal.set_last_value(value); + return ret; +} + +openxc_DynamicField decoder_t::v1_to_v2_der(signal_t& signal, std::shared_ptr message, bool* send){ + float value = decoder_t::parse_signal_bitfield(signal, message); + openxc_DynamicField ret = decoder_t::der(signal, value, send); + if ((signal.get_last_value() == value && !signal.get_send_same()) || !*send ){ + *send = false; + } + signal.set_last_value(value); + return ret; +} + +openxc_DynamicField decoder_t::v1_to_v2_Pid(signal_t& signal, std::shared_ptr message, bool* send){ + float value = decoder_t::parse_signal_bitfield(signal, message); + openxc_DynamicField ret = decoder_t::Pid(signal, value, send); + if ((signal.get_last_value() == value && !signal.get_send_same()) || !*send ){ + *send = false; + } + signal.set_last_value(value); + return ret; +} + +openxc_DynamicField decoder_t::v1_to_v2_agRequest(signal_t& signal, std::shared_ptr message, bool* send){ + float value = decoder_t::parse_signal_bitfield(signal, message); + openxc_DynamicField ret = decoder_t::agRequest(signal, value, send); + if ((signal.get_last_value() == value && !signal.get_send_same()) || !*send ){ + *send = false; + } + signal.set_last_value(value); + return ret; +} + diff --git a/examples/engine/application-generated.cpp b/examples/engine/application-generated.cpp index 4f6dd702..ea003109 100644 --- a/examples/engine/application-generated.cpp +++ b/examples/engine/application-generated.cpp @@ -7,7 +7,7 @@ application_t::application_t() , message_set_{ {std::make_shared(message_set_t{0,"example", { // beginning message_definition_ vector - {std::make_shared(message_definition_t{"hs", 0x3D9,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, + {std::make_shared(message_definition_t{"hs",0x3D9,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.speed",// generic_name @@ -27,8 +27,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -49,8 +50,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -71,13 +73,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x3E9,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x3E9,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "vehicle.average.speed",// generic_name @@ -97,13 +100,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x4D1,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x4D1,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.oil.temp",// generic_name @@ -123,8 +127,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -145,8 +150,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector @@ -161,7 +167,7 @@ application_t::application_t() { for(std::shared_ptr cms: message_set_) { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); + std::vector> messages_definition = cms->get_messages_definition(); for(std::shared_ptr cmd : messages_definition) { cmd->set_parent(cms); diff --git a/examples/hvac/application-generated.cpp b/examples/hvac/application-generated.cpp index 0086abb5..473f4245 100644 --- a/examples/hvac/application-generated.cpp +++ b/examples/hvac/application-generated.cpp @@ -7,7 +7,7 @@ application_t::application_t() , message_set_{ {std::make_shared(message_set_t{0,"example", { // beginning message_definition_ vector - {std::make_shared(message_definition_t{"ls", 0x30,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, + {std::make_shared(message_definition_t{"ls",0x30,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "hvac.fan.speed",// generic_name @@ -27,8 +27,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -49,8 +50,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -71,8 +73,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -93,8 +96,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector @@ -109,7 +113,7 @@ application_t::application_t() { for(std::shared_ptr cms: message_set_) { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); + std::vector> messages_definition = cms->get_messages_definition(); for(std::shared_ptr cmd : messages_definition) { cmd->set_parent(cms); diff --git a/examples/j1939/application-generated.cpp b/examples/j1939/application-generated.cpp deleted file mode 100644 index e0b633b5..00000000 --- a/examples/j1939/application-generated.cpp +++ /dev/null @@ -1,1010 +0,0 @@ -#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"}} - , message_set_{ - {std::make_shared(message_set_t{0,"Virtual J1939", - { // beginning message_definition_ vector - {std::make_shared(message_definition_t{"j1939", 61442,"ETC1", 8, false, message_format_t::J1939, frequency_clock_t(5.00000f), true, - { // beginning signals vector - {std::make_shared (signal_t{ - "Eng.Momentary.Overspeed.Enable",// generic_name - 32,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {0,"MomentaryEngOverspeedIsDisabled"}, - {1,"MomentaryEngOverspeedIsEnabled"}, - {2,"Reserved"}, - {3,"TakeNoAction"} - },// states - true,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Momentary.Eng.Max.Power.Enable",// generic_name - 36,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {2,"fault"}, - {1,"mmntarilyRqingMaxPowerAvailable"}, - {3,"notAvailable"}, - {0,"notRqingMaxPowerAvailable"} - },// states - true,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Percent.Clutch.Slip",// generic_name - 24,// bit_position - 8,// bit_size - 0.400000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - true,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "%"// unit - })}, - {std::make_shared (signal_t{ - "Progressive.Shift.Disable",// generic_name - 34,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {1,"ProgressiveShiftIsDisabled"}, - {0,"ProgressiveShiftIsNotDisabled"}, - {2,"Reserved"}, - {3,"TakeNoAction"} - },// states - true,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Src.Addrss.Of.Ctrllng.Dvc.Fr.Trns.Cntrl",// generic_name - 56,// bit_position - 8,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - true,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Trans.Driveline.Engaged",// generic_name - 0,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {0,"DrivelineDisengaged"}, - {1,"DrivelineEngaged"}, - {2,"Error"}, - {3,"NotAvailable"} - },// states - true,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Trans.Input.Shaft.Speed",// generic_name - 40,// bit_position - 16,// bit_size - 0.125000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - true,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "rpm"// unit - })}, - {std::make_shared (signal_t{ - "Trans.Output.Shaft.Speed",// generic_name - 8,// bit_position - 16,// bit_size - 0.125000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - true,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "rpm"// unit - })}, - {std::make_shared (signal_t{ - "Trans.Shift.In.Process",// generic_name - 4,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {2,"Error"}, - {3,"NotAvailable"}, - {1,"ShiftInProcess"}, - {0,"ShiftIsNotInProcess"} - },// states - true,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Trns.Trq.Cnvrtr.Lckp.Trnstn.In.Prcess",// generic_name - 6,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {2,"Error"}, - {3,"NotAvailable"}, - {1,"TransitionIsInProcess"}, - {0,"TransitionIsNotInProcess"} - },// states - true,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Trns.Trque.Converter.Lockup.Engaged",// generic_name - 2,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {2,"Error"}, - {3,"NotAvailable"}, - {0,"TorqueConverterLockupDisengaged"}, - {1,"TorqueConverterLockupEngaged"} - },// states - true,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })} - } // end signals vector - })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 61444,"EEC1", 8, false, message_format_t::J1939, frequency_clock_t(5.00000f), true, - { // beginning signals vector - {std::make_shared (signal_t{ - "Actl.Eng.Prcnt.Trque.High.Resolution",// generic_name - 4,// bit_position - 4,// bit_size - 0.125000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {0,"0000"}, - {1,"0125"}, - {7,"0875"}, - {8,"1111NotAvailable"} - },// states - false,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "%"// unit - })}, - {std::make_shared (signal_t{ - "Actual.Eng.Percent.Torque",// generic_name - 16,// bit_position - 8,// bit_size - 1.00000f,// factor - -125.000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "%"// unit - })}, - {std::make_shared (signal_t{ - "Drivers.Demand.Eng.Percent.Torque",// generic_name - 8,// bit_position - 8,// bit_size - 1.00000f,// factor - -125.000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "%"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Demand.Percent.Torque",// generic_name - 56,// bit_position - 8,// bit_size - 1.00000f,// factor - -125.000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "%"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Speed",// generic_name - 24,// bit_position - 16,// bit_size - 0.125000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "rpm"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Starter.Mode",// generic_name - 48,// bit_position - 4,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {9,"1011Reserved"}, - {14,"error"}, - {15,"notAvailable"}, - {0,"startNotRqed"}, - {2,"starterActiveGearEngaged"}, - {1,"starterActiveGearNotEngaged"}, - {12,"starterInhibitedReasonUnknown"}, - {3,"strtFnshdStrtrNtActvAftrHvngBnA"}, - {6,"strtrInhbtdDTDrvlnEnggdOthrTrns"}, - {5,"strtrInhbtdDTEngNtReadyForStart"}, - {7,"strtrInhbtdDToActiveImmobilizer"}, - {4,"strtrInhbtdDToEngAlreadyRunning"}, - {8,"strtrInhbtdDueToStarterOvertemp"} - },// states - false,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Eng.Torque.Mode",// generic_name - 0,// bit_position - 4,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {7,"ABS control"}, - {5,"ASR control"}, - {1,"Accelerator pedal/operator selec"}, - {10,"Braking system"}, - {2,"Cruise control"}, - {9,"High speed governor"}, - {0,"Low idle governor/no request (de"}, - {15,"Not available"}, - {3,"PTO governor"}, - {11,"Remote accelerator"}, - {4,"Road speed governor"}, - {8,"Torque limiting"}, - {6,"Transmission control"} - },// states - false,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Src.AddrssOf.Ctrllng.Dvc.Fr.Eng.Cntrl",// generic_name - 40,// bit_position - 8,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })} - } // end signals vector - })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 61449,"VDC2", 8, false, message_format_t::J1939, frequency_clock_t(5.00000f), true, - { // beginning signals vector - {std::make_shared (signal_t{ - "Lateral.Acceleration",// generic_name - 40,// bit_position - 16,// bit_size - 0.000488281f,// factor - -15.6870f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "m/s/s"// unit - })}, - {std::make_shared (signal_t{ - "Longitudinal.Acceleration",// generic_name - 56,// bit_position - 8,// bit_size - 0.100000f,// factor - -12.5000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "m/s/s"// unit - })}, - {std::make_shared (signal_t{ - "Steer.Wheel.Angle",// generic_name - 0,// bit_position - 16,// bit_size - 0.000976562f,// factor - -31.3740f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "rad"// unit - })}, - {std::make_shared (signal_t{ - "Steer.Wheel.Angle.Sensor.Type",// generic_name - 22,// bit_position - 2,// bit_size - 1.00000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - {1,"AbsMeasuringPrinciple"}, - {3,"NotAvailable"}, - {0,"RelativeMeasuringPrinciple"}, - {2,"Reserved"} - },// states - false,// writable - decoder_t::decode_state,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - ""// unit - })}, - {std::make_shared (signal_t{ - "Steer.Wheel.Turn.Counter",// generic_name - 16,// bit_position - 6,// bit_size - 1.00000f,// factor - -32.0000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "turns"// unit - })}, - {std::make_shared (signal_t{ - "Yaw.Rate",// generic_name - 24,// bit_position - 16,// bit_size - 0.000122070f,// factor - -3.92000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "rad/s"// unit - })} - } // end signals vector - })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 65215,"EBC2", 8, false, message_format_t::J1939, frequency_clock_t(5.00000f), true, - { // beginning signals vector - {std::make_shared (signal_t{ - "Front.Axle.Speed",// generic_name - 0,// bit_position - 16,// bit_size - 0.00390625f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "km/h"// unit - })}, - {std::make_shared (signal_t{ - "Relative.Speed.Front.Axle.Left.Wheel",// generic_name - 16,// bit_position - 8,// bit_size - 0.0625000f,// factor - -7.81250f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "km/h"// unit - })}, - {std::make_shared (signal_t{ - "Relative.Speed.Rear.Axle1.Left.Wheel",// generic_name - 32,// bit_position - 8,// bit_size - 0.0625000f,// factor - -7.81250f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "km/h"// unit - })}, - {std::make_shared (signal_t{ - "Relative.Speed.Rear.Axle2.Left.Wheel",// generic_name - 48,// bit_position - 8,// bit_size - 0.0625000f,// factor - -7.81250f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "km/h"// unit - })}, - {std::make_shared (signal_t{ - "Rlative.Speed.Front.Axle.Right.Wheel",// generic_name - 24,// bit_position - 8,// bit_size - 0.0625000f,// factor - -7.81250f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "km/h"// unit - })}, - {std::make_shared (signal_t{ - "Rlative.Speed.Rear.Axle1.Right.Wheel",// generic_name - 40,// bit_position - 8,// bit_size - 0.0625000f,// factor - -7.81250f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "km/h"// unit - })}, - {std::make_shared (signal_t{ - "Rlative.Speed.Rear.Axle2.Right.Wheel",// generic_name - 56,// bit_position - 8,// bit_size - 0.0625000f,// factor - -7.81250f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "km/h"// unit - })} - } // end signals vector - })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 65253,"HOURS", 8, false, message_format_t::J1939, frequency_clock_t(5.00000f), true, - { // beginning signals vector - {std::make_shared (signal_t{ - "Eng.Total.Hours.Of.Operation",// generic_name - 0,// bit_position - 32,// bit_size - 0.0500000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "hr"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Total.Revolutions",// generic_name - 32,// bit_position - 32,// bit_size - 1000.00f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "r"// unit - })} - } // end signals vector - })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 65262,"ET1", 8, false, message_format_t::J1939, frequency_clock_t(5.00000f), true, - { // beginning signals vector - {std::make_shared (signal_t{ - "Eng.Coolant.Temp",// generic_name - 0,// bit_position - 8,// bit_size - 0.0312500f,// factor - -273.000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "deg C"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Fuel.Temp1",// generic_name - 8,// bit_position - 8,// bit_size - 1.00000f,// factor - -40.0000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "deg C"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Intercooler.Temp",// generic_name - 48,// bit_position - 8,// bit_size - 1.00000f,// factor - -40.0000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "deg C"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Intercooler.Thermostat.Opening",// generic_name - 56,// bit_position - 8,// bit_size - 0.400000f,// factor - 0.00000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "%"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Oil.Temp1",// generic_name - 16,// bit_position - 16,// bit_size - 0.0312500f,// factor - -273.000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "deg C"// unit - })}, - {std::make_shared (signal_t{ - "Eng.Turbo.Oil.Temp",// generic_name - 32,// bit_position - 16,// bit_size - 0.0312500f,// factor - -273.000f,// offset - 0,// min_value - 0,// max_value - frequency_clock_t(0.00000f),// frequency - true,// send_same - false,// force_send_changed - { - },// states - false,// writable - nullptr,// decoder - nullptr,// encoder - false,// received - std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed - "deg C"// unit - })} - } // end signals vector - })} // end message_definition entry - - }, // end message_definition vector - { // beginning diagnostic_messages_ vector - - } // end diagnostic_messages_ vector - })} // end message_set entry - } // end message_set vector -{ - for(std::shared_ptr cms: message_set_) - { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); - for(std::shared_ptr cmd : messages_definition) - { - cmd->set_parent(cms); - std::vector> signals = cmd->get_signals(); - for(std::shared_ptr sig: signals) - { - sig->set_parent(cmd); - } - } - - std::vector> diagnostic_messages = cms->get_diagnostic_messages(); - for(std::shared_ptr dm : diagnostic_messages) - { - dm->set_parent(cms); - } - } - } - -const std::string application_t::get_diagnostic_bus() const -{ - return ""; -} - - diff --git a/examples/j1939/j1939-simple.cpp b/examples/j1939/j1939-simple.cpp new file mode 100644 index 00000000..660d0ffa --- /dev/null +++ b/examples/j1939/j1939-simple.cpp @@ -0,0 +1,1050 @@ +#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"}} + , message_set_{ + {std::make_shared(message_set_t{0,"Virtual J1939", + { // beginning message_definition_ vector + {std::make_shared(message_definition_t{"j1939",61442,"ETC1",8,4,true,frequency_clock_t(5.00000f),true, + { // beginning signals vector + {std::make_shared (signal_t{ + "Eng.Momentary.Overspeed.Enable",// generic_name + 32,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {0,"MomentaryEngOverspeedIsDisabled"}, + {1,"MomentaryEngOverspeedIsEnabled"}, + {2,"Reserved"}, + {3,"TakeNoAction"} + },// states + true,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Momentary.Eng.Max.Power.Enable",// generic_name + 36,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {2,"fault"}, + {1,"mmntarilyRqingMaxPowerAvailable"}, + {3,"notAvailable"}, + {0,"notRqingMaxPowerAvailable"} + },// states + true,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Percent.Clutch.Slip",// generic_name + 24,// bit_position + 8,// bit_size + 0.400000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + true,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "%"// unit + })}, + {std::make_shared (signal_t{ + "Progressive.Shift.Disable",// generic_name + 34,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {1,"ProgressiveShiftIsDisabled"}, + {0,"ProgressiveShiftIsNotDisabled"}, + {2,"Reserved"}, + {3,"TakeNoAction"} + },// states + true,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Src.Addrss.Of.Ctrllng.Dvc.Fr.Trns.Cntrl",// generic_name + 56,// bit_position + 8,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + true,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Trans.Driveline.Engaged",// generic_name + 0,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {0,"DrivelineDisengaged"}, + {1,"DrivelineEngaged"}, + {2,"Error"}, + {3,"NotAvailable"} + },// states + true,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Trans.Input.Shaft.Speed",// generic_name + 40,// bit_position + 16,// bit_size + 0.125000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + true,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "rpm"// unit + })}, + {std::make_shared (signal_t{ + "Trans.Output.Shaft.Speed",// generic_name + 8,// bit_position + 16,// bit_size + 0.125000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + true,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "rpm"// unit + })}, + {std::make_shared (signal_t{ + "Trans.Shift.In.Process",// generic_name + 4,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {2,"Error"}, + {3,"NotAvailable"}, + {1,"ShiftInProcess"}, + {0,"ShiftIsNotInProcess"} + },// states + true,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Trns.Trq.Cnvrtr.Lckp.Trnstn.In.Prcess",// generic_name + 6,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {2,"Error"}, + {3,"NotAvailable"}, + {1,"TransitionIsInProcess"}, + {0,"TransitionIsNotInProcess"} + },// states + true,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Trns.Trque.Converter.Lockup.Engaged",// generic_name + 2,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {2,"Error"}, + {3,"NotAvailable"}, + {0,"TorqueConverterLockupDisengaged"}, + {1,"TorqueConverterLockupEngaged"} + },// states + true,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })} + } // end signals vector + })} // end message_definition entry +, {std::make_shared(message_definition_t{"j1939",61444,"EEC1",8,4,true,frequency_clock_t(5.00000f),true, + { // beginning signals vector + {std::make_shared (signal_t{ + "Actl.Eng.Prcnt.Trque.High.Resolution",// generic_name + 4,// bit_position + 4,// bit_size + 0.125000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {0,"0000"}, + {1,"0125"}, + {7,"0875"}, + {8,"1111NotAvailable"} + },// states + false,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "%"// unit + })}, + {std::make_shared (signal_t{ + "Actual.Eng.Percent.Torque",// generic_name + 16,// bit_position + 8,// bit_size + 1.00000f,// factor + -125.000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "%"// unit + })}, + {std::make_shared (signal_t{ + "Drivers.Demand.Eng.Percent.Torque",// generic_name + 8,// bit_position + 8,// bit_size + 1.00000f,// factor + -125.000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "%"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Demand.Percent.Torque",// generic_name + 56,// bit_position + 8,// bit_size + 1.00000f,// factor + -125.000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "%"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Speed",// generic_name + 24,// bit_position + 16,// bit_size + 0.125000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "rpm"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Starter.Mode",// generic_name + 48,// bit_position + 4,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {9,"1011Reserved"}, + {14,"error"}, + {15,"notAvailable"}, + {0,"startNotRqed"}, + {2,"starterActiveGearEngaged"}, + {1,"starterActiveGearNotEngaged"}, + {12,"starterInhibitedReasonUnknown"}, + {3,"strtFnshdStrtrNtActvAftrHvngBnA"}, + {6,"strtrInhbtdDTDrvlnEnggdOthrTrns"}, + {5,"strtrInhbtdDTEngNtReadyForStart"}, + {7,"strtrInhbtdDToActiveImmobilizer"}, + {4,"strtrInhbtdDToEngAlreadyRunning"}, + {8,"strtrInhbtdDueToStarterOvertemp"} + },// states + false,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Eng.Torque.Mode",// generic_name + 0,// bit_position + 4,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {7,"ABS control"}, + {5,"ASR control"}, + {1,"Accelerator pedal/operator selec"}, + {10,"Braking system"}, + {2,"Cruise control"}, + {9,"High speed governor"}, + {0,"Low idle governor/no request (de"}, + {15,"Not available"}, + {3,"PTO governor"}, + {11,"Remote accelerator"}, + {4,"Road speed governor"}, + {8,"Torque limiting"}, + {6,"Transmission control"} + },// states + false,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Src.AddrssOf.Ctrllng.Dvc.Fr.Eng.Cntrl",// generic_name + 40,// bit_position + 8,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })} + } // end signals vector + })} // end message_definition entry +, {std::make_shared(message_definition_t{"j1939",61449,"VDC2",8,4,true,frequency_clock_t(5.00000f),true, + { // beginning signals vector + {std::make_shared (signal_t{ + "Lateral.Acceleration",// generic_name + 40,// bit_position + 16,// bit_size + 0.000488281f,// factor + -15.6870f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "m/s/s"// unit + })}, + {std::make_shared (signal_t{ + "Longitudinal.Acceleration",// generic_name + 56,// bit_position + 8,// bit_size + 0.100000f,// factor + -12.5000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "m/s/s"// unit + })}, + {std::make_shared (signal_t{ + "Steer.Wheel.Angle",// generic_name + 0,// bit_position + 16,// bit_size + 0.000976562f,// factor + -31.3740f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "rad"// unit + })}, + {std::make_shared (signal_t{ + "Steer.Wheel.Angle.Sensor.Type",// generic_name + 22,// bit_position + 2,// bit_size + 1.00000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + {1,"AbsMeasuringPrinciple"}, + {3,"NotAvailable"}, + {0,"RelativeMeasuringPrinciple"}, + {2,"Reserved"} + },// states + false,// writable + decoder_t::decode_state,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + ""// unit + })}, + {std::make_shared (signal_t{ + "Steer.Wheel.Turn.Counter",// generic_name + 16,// bit_position + 6,// bit_size + 1.00000f,// factor + -32.0000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "turns"// unit + })}, + {std::make_shared (signal_t{ + "Yaw.Rate",// generic_name + 24,// bit_position + 16,// bit_size + 0.000122070f,// factor + -3.92000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "rad/s"// unit + })} + } // end signals vector + })} // end message_definition entry +, {std::make_shared(message_definition_t{"j1939",65215,"EBC2",8,4,true,frequency_clock_t(5.00000f),true, + { // beginning signals vector + {std::make_shared (signal_t{ + "Front.Axle.Speed",// generic_name + 0,// bit_position + 16,// bit_size + 0.00390625f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "km/h"// unit + })}, + {std::make_shared (signal_t{ + "Relative.Speed.Front.Axle.Left.Wheel",// generic_name + 16,// bit_position + 8,// bit_size + 0.0625000f,// factor + -7.81250f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "km/h"// unit + })}, + {std::make_shared (signal_t{ + "Relative.Speed.Rear.Axle1.Left.Wheel",// generic_name + 32,// bit_position + 8,// bit_size + 0.0625000f,// factor + -7.81250f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "km/h"// unit + })}, + {std::make_shared (signal_t{ + "Relative.Speed.Rear.Axle2.Left.Wheel",// generic_name + 48,// bit_position + 8,// bit_size + 0.0625000f,// factor + -7.81250f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "km/h"// unit + })}, + {std::make_shared (signal_t{ + "Rlative.Speed.Front.Axle.Right.Wheel",// generic_name + 24,// bit_position + 8,// bit_size + 0.0625000f,// factor + -7.81250f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "km/h"// unit + })}, + {std::make_shared (signal_t{ + "Rlative.Speed.Rear.Axle1.Right.Wheel",// generic_name + 40,// bit_position + 8,// bit_size + 0.0625000f,// factor + -7.81250f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "km/h"// unit + })}, + {std::make_shared (signal_t{ + "Rlative.Speed.Rear.Axle2.Right.Wheel",// generic_name + 56,// bit_position + 8,// bit_size + 0.0625000f,// factor + -7.81250f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "km/h"// unit + })} + } // end signals vector + })} // end message_definition entry +, {std::make_shared(message_definition_t{"j1939",65253,"HOURS",8,4,true,frequency_clock_t(5.00000f),true, + { // beginning signals vector + {std::make_shared (signal_t{ + "Eng.Total.Hours.Of.Operation",// generic_name + 0,// bit_position + 32,// bit_size + 0.0500000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "hr"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Total.Revolutions",// generic_name + 32,// bit_position + 32,// bit_size + 1000.00f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "r"// unit + })} + } // end signals vector + })} // end message_definition entry +, {std::make_shared(message_definition_t{"j1939",65262,"ET1",8,4,true,frequency_clock_t(5.00000f),true, + { // beginning signals vector + {std::make_shared (signal_t{ + "Eng.Coolant.Temp",// generic_name + 0,// bit_position + 8,// bit_size + 0.0312500f,// factor + -273.000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "deg C"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Fuel.Temp1",// generic_name + 8,// bit_position + 8,// bit_size + 1.00000f,// factor + -40.0000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "deg C"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Intercooler.Temp",// generic_name + 48,// bit_position + 8,// bit_size + 1.00000f,// factor + -40.0000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "deg C"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Intercooler.Thermostat.Opening",// generic_name + 56,// bit_position + 8,// bit_size + 0.400000f,// factor + 0.00000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "%"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Oil.Temp1",// generic_name + 16,// bit_position + 16,// bit_size + 0.0312500f,// factor + -273.000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "deg C"// unit + })}, + {std::make_shared (signal_t{ + "Eng.Turbo.Oil.Temp",// generic_name + 32,// bit_position + 16,// bit_size + 0.0312500f,// factor + -273.000f,// offset + 0,// min_value + 0,// max_value + frequency_clock_t(0.00000f),// frequency + true,// send_same + false,// force_send_changed + { + },// states + false,// writable + nullptr,// decoder + nullptr,// encoder + false,// received + std::make_pair(false, 0),// multiplex + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position + "deg C"// unit + })} + } // end signals vector + })} // end message_definition entry + + }, // end message_definition vector + { // beginning diagnostic_messages_ vector + + } // end diagnostic_messages_ vector + })} // end message_set entry + } // end message_set vector +{ + for(std::shared_ptr cms: message_set_) + { + std::vector> messages_definition = cms->get_messages_definition(); + for(std::shared_ptr cmd : messages_definition) + { + cmd->set_parent(cms); + std::vector> signals = cmd->get_signals(); + for(std::shared_ptr sig: signals) + { + sig->set_parent(cmd); + } + } + + std::vector> diagnostic_messages = cms->get_diagnostic_messages(); + for(std::shared_ptr dm : diagnostic_messages) + { + dm->set_parent(cms); + } + } + } + +const std::string application_t::get_diagnostic_bus() const +{ + return ""; +} + + diff --git a/examples/j1939/j1939_parse.json b/examples/j1939/j1939_parse.json index 3896acba..41b3da20 100644 --- a/examples/j1939/j1939_parse.json +++ b/examples/j1939/j1939_parse.json @@ -13,7 +13,6 @@ "name": "ETC1", "bus" : "j1939", "is_fd" : false, - "is_extended": false, "is_j1939" : true, "signals" : { "Trns.Trque.Converter.Lockup.Engaged" : { @@ -190,7 +189,6 @@ "name": "EEC1", "bus" : "j1939", "is_fd" : false, - "is_extended": false, "is_j1939" : true, "signals" : { "Src.AddrssOf.Ctrllng.Dvc.Fr.Eng.Cntrl" : { @@ -322,7 +320,6 @@ "name": "HOURS", "bus" : "j1939", "is_fd" : false, - "is_extended": false, "is_j1939" : true, "signals" : { "Eng.Total.Revolutions" : { @@ -355,7 +352,6 @@ "name": "VDC2", "bus" : "j1939", "is_fd" : false, - "is_extended": false, "is_j1939" : true, "signals" : { "Steer.Wheel.Angle" : { @@ -437,7 +433,6 @@ "name": "EBC2", "bus" : "j1939", "is_fd" : false, - "is_extended": false, "is_j1939" : true, "signals" : { "Rlative.Speed.Rear.Axle2.Right.Wheel" : { @@ -525,7 +520,6 @@ "name": "ET1", "bus" : "j1939", "is_fd" : false, - "is_extended": false, "is_j1939" : true, "signals" : { "Eng.Fuel.Temp1" : { diff --git a/examples/tests/application-generated.cpp b/examples/tests/application-generated.cpp index 2cbcbe28..584514de 100644 --- a/examples/tests/application-generated.cpp +++ b/examples/tests/application-generated.cpp @@ -7,7 +7,7 @@ application_t::application_t() , message_set_{ {std::make_shared(message_set_t{0,"AGL Virtual Car", { // beginning message_definition_ vector - {std::make_shared(message_definition_t{"ls", 0x111,"", 16, 66, frequency_clock_t(5.00000f), true, + {std::make_shared(message_definition_t{"ls",0x111,"",16,16,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "sig1.1",// generic_name @@ -27,8 +27,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -49,8 +50,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -71,8 +73,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -93,8 +96,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -115,8 +119,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -137,8 +142,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -159,8 +165,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -181,13 +188,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"ls", 0x30,"", 8, 4, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"ls",0x30,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "hvac.fan.speed",// generic_name @@ -207,8 +215,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -229,8 +238,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -251,8 +261,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -273,13 +284,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x3D9,"", 8, 2050, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x3D9,"",8,128,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.speed",// generic_name @@ -299,8 +311,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -321,8 +334,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -343,13 +357,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x3E9,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x3E9,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "vehicle.average.speed",// generic_name @@ -369,13 +384,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x4D1,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x4D1,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.oil.temp",// generic_name @@ -395,8 +411,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -417,13 +434,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x620,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x620,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "doors.boot.open",// generic_name @@ -443,8 +461,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -465,8 +484,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -487,8 +507,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -509,8 +530,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -531,13 +553,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x799,"", 8, 2, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x799,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "windows.front_left.open",// generic_name @@ -557,8 +580,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -579,8 +603,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -601,8 +626,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -623,13 +649,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 61442,"ETC1", 8, 18, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"j1939",61442,"ETC1",8,4,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "Eng.Momentary.Overspeed.Enable",// generic_name @@ -653,8 +680,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -679,8 +707,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -701,8 +730,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "%"// unit })}, {std::make_shared (signal_t{ @@ -727,8 +757,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -749,8 +780,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -775,8 +807,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -797,8 +830,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "rpm"// unit })}, {std::make_shared (signal_t{ @@ -819,8 +853,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "rpm"// unit })}, {std::make_shared (signal_t{ @@ -845,8 +880,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -871,8 +907,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -897,13 +934,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 61444,"EEC1", 8, 18, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"j1939",61444,"EEC1",8,4,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "Actl.Eng.Prcnt.Trque.High.Resolution",// generic_name @@ -927,8 +965,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "%"// unit })}, {std::make_shared (signal_t{ @@ -949,8 +988,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "%"// unit })}, {std::make_shared (signal_t{ @@ -971,8 +1011,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "%"// unit })}, {std::make_shared (signal_t{ @@ -993,8 +1034,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "%"// unit })}, {std::make_shared (signal_t{ @@ -1015,8 +1057,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "rpm"// unit })}, {std::make_shared (signal_t{ @@ -1050,8 +1093,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -1085,8 +1129,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -1107,13 +1152,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 61449,"VDC2", 8, 18, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"j1939",61449,"VDC2",8,4,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "Lateral.Acceleration",// generic_name @@ -1133,8 +1179,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "m/s/s"// unit })}, {std::make_shared (signal_t{ @@ -1155,8 +1202,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "m/s/s"// unit })}, {std::make_shared (signal_t{ @@ -1177,8 +1225,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "rad"// unit })}, {std::make_shared (signal_t{ @@ -1203,8 +1252,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -1225,8 +1275,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "turns"// unit })}, {std::make_shared (signal_t{ @@ -1247,13 +1298,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "rad/s"// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 65215,"EBC2", 8, 18, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"j1939",65215,"EBC2",8,4,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "Front.Axle.Speed",// generic_name @@ -1273,8 +1325,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "km/h"// unit })}, {std::make_shared (signal_t{ @@ -1295,8 +1348,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "km/h"// unit })}, {std::make_shared (signal_t{ @@ -1317,8 +1371,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "km/h"// unit })}, {std::make_shared (signal_t{ @@ -1339,8 +1394,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "km/h"// unit })}, {std::make_shared (signal_t{ @@ -1361,8 +1417,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "km/h"// unit })}, {std::make_shared (signal_t{ @@ -1383,8 +1440,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "km/h"// unit })}, {std::make_shared (signal_t{ @@ -1405,13 +1463,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "km/h"// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 65253,"HOURS", 8, 18, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"j1939",65253,"HOURS",8,4,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "Eng.Total.Hours.Of.Operation",// generic_name @@ -1431,8 +1490,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "hr"// unit })}, {std::make_shared (signal_t{ @@ -1453,13 +1513,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "r"// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"j1939", 65262,"ET1", 8, 18, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"j1939",65262,"ET1",8,4,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "Eng.Coolant.Temp",// generic_name @@ -1479,8 +1540,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "deg C"// unit })}, {std::make_shared (signal_t{ @@ -1501,8 +1563,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "deg C"// unit })}, {std::make_shared (signal_t{ @@ -1523,8 +1586,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "deg C"// unit })}, {std::make_shared (signal_t{ @@ -1545,8 +1609,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "%"// unit })}, {std::make_shared (signal_t{ @@ -1567,8 +1632,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "deg C"// unit })}, {std::make_shared (signal_t{ @@ -1589,8 +1655,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position "deg C"// unit })} } // end signals vector @@ -1857,7 +1924,7 @@ application_t::application_t() { for(std::shared_ptr cms: message_set_) { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); + std::vector> messages_definition = cms->get_messages_definition(); for(std::shared_ptr cmd : messages_definition) { cmd->set_parent(cms); diff --git a/examples/toyota/auris/application-generated.cpp b/examples/toyota/auris/application-generated.cpp index 30102d74..c0d55756 100644 --- a/examples/toyota/auris/application-generated.cpp +++ b/examples/toyota/auris/application-generated.cpp @@ -7,7 +7,7 @@ application_t::application_t() , message_set_{ {std::make_shared(message_set_t{0,"example", { // beginning message_definition_ vector - {std::make_shared(message_definition_t{"hs", 0x3D9,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, + {std::make_shared(message_definition_t{"hs",0x3D9,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.speed",// generic_name @@ -27,8 +27,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -49,8 +50,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -71,13 +73,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x3E9,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x3E9,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "vehicle.average.speed",// generic_name @@ -97,13 +100,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x4D1,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x4D1,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "engine.oil.temp",// generic_name @@ -123,8 +127,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -145,13 +150,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x620,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x620,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "doors.boot.open",// generic_name @@ -171,8 +177,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -193,8 +200,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -215,8 +223,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -237,8 +246,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -259,13 +269,14 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector })} // end message_definition entry -, {std::make_shared(message_definition_t{"hs", 0x799,"", 0, false, message_format_t::STANDARD, frequency_clock_t(5.00000f), true, +, {std::make_shared(message_definition_t{"hs",0x799,"",8,0,true,frequency_clock_t(5.00000f),true, { // beginning signals vector {std::make_shared (signal_t{ "windows.front_left.open",// generic_name @@ -285,8 +296,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -307,8 +319,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -329,8 +342,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })}, {std::make_shared (signal_t{ @@ -351,8 +365,9 @@ application_t::application_t() nullptr,// encoder false,// received std::make_pair(false, 0),// multiplex - 0,// is_big_endian - 0,// is_signed + false,// is_big_endian + static_cast(0),// signed + -1,// bit_sign_position ""// unit })} } // end signals vector @@ -619,7 +634,7 @@ application_t::application_t() { for(std::shared_ptr cms: message_set_) { - vect_ptr_msg_def_t messages_definition = cms->get_messages_definition(); + std::vector> messages_definition = cms->get_messages_definition(); for(std::shared_ptr cmd : messages_definition) { cmd->set_parent(cms); -- cgit 1.2.3-korg