CAN FD implementation
[apps/agl-service-can-low-level.git] / low-can-binding / binding / application-generated.cpp
index 8253c62..1b0a350 100644 (file)
@@ -1,12 +1,19 @@
 #include "application.hpp"
 #include "../can/can-decoder.hpp"
+#include "../can/can-encoder.hpp"
 
 application_t::application_t()
        : can_bus_manager_{utils::config_parser_t{"/etc/dev-mapping.conf"}}
        , can_message_set_{
-               {std::make_shared<can_message_set_t>(can_message_set_t{0,"example",
+               {std::make_shared<can_message_set_t>(can_message_set_t{0,"AGL Virtual Car",
                        { // beginning can_message_definition_ vector
-                               {std::make_shared<can_message_definition_t>(can_message_definition_t{"ls",0x30,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+                               {std::make_shared<can_message_definition_t>(can_message_definition_t{
+                                "ls",
+                                0x30,
+                                false,
+                                can_message_format_t::EXTENDED,
+                                frequency_clock_t(5.00000f),
+                                true,
                                        { // beginning can_signals vector
                                                {std::make_shared<can_signal_t> (can_signal_t{
                                                        "hvac.fan.speed",
@@ -39,7 +46,7 @@ application_t::application_t()
                                                        false,
                                                        {
                                                        },
-                                                       false,
+                                                       true,
                                                        nullptr,
                                                        nullptr,
                                                        false
@@ -57,7 +64,7 @@ application_t::application_t()
                                                        false,
                                                        {
                                                        },
-                                                       false,
+                                                       true,
                                                        nullptr,
                                                        nullptr,
                                                        false
@@ -75,14 +82,20 @@ application_t::application_t()
                                                        false,
                                                        {
                                                        },
-                                                       false,
+                                                       true,
                                                        nullptr,
                                                        nullptr,
                                                        false
                                                })}
                                        } // end can_signals vector
                                })} // end can_message_definition entry
-,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x3D9,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{
+                                "hs",
+                                0x3D9,
+                                true,
+                                can_message_format_t::STANDARD,
+                                frequency_clock_t(5.00000f),
+                                true,
                                        { // beginning can_signals vector
                                                {std::make_shared<can_signal_t> (can_signal_t{
                                                        "engine.speed",
@@ -140,7 +153,13 @@ application_t::application_t()
                                                })}
                                        } // end can_signals vector
                                })} // end can_message_definition entry
-,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x3E9,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{
+                                "hs",
+                                0x3E9,
+                                false,
+                                can_message_format_t::EXTENDED,
+                                frequency_clock_t(5.00000f),
+                                true,
                                        { // beginning can_signals vector
                                                {std::make_shared<can_signal_t> (can_signal_t{
                                                        "vehicle.average.speed",
@@ -162,7 +181,13 @@ application_t::application_t()
                                                })}
                                        } // end can_signals vector
                                })} // end can_message_definition entry
-,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x4D1,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{
+                                "hs",
+                                0x4D1,
+                                false,
+                                can_message_format_t::STANDARD,
+                                frequency_clock_t(5.00000f),
+                                true,
                                        { // beginning can_signals vector
                                                {std::make_shared<can_signal_t> (can_signal_t{
                                                        "engine.oil.temp",
@@ -202,7 +227,13 @@ application_t::application_t()
                                                })}
                                        } // end can_signals vector
                                })} // end can_message_definition entry
-,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x620,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{
+                                "hs",
+                                0x620,
+                                false,
+                                can_message_format_t::STANDARD,
+                                frequency_clock_t(5.00000f),
+                                true,
                                        { // beginning can_signals vector
                                                {std::make_shared<can_signal_t> (can_signal_t{
                                                        "doors.boot.open",
@@ -296,7 +327,13 @@ application_t::application_t()
                                                })}
                                        } // end can_signals vector
                                })} // end can_message_definition entry
-,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{"hs",0x799,can_message_format_t::STANDARD,frequency_clock_t(5.00000f),true,
+,                              {std::make_shared<can_message_definition_t>(can_message_definition_t{
+                                "hs",
+                                0x799,
+                                false,
+                                can_message_format_t::STANDARD,
+                                frequency_clock_t(5.00000f),
+                                true,
                                        { // beginning can_signals vector
                                                {std::make_shared<can_signal_t> (can_signal_t{
                                                        "windows.front_left.open",
@@ -429,7 +466,7 @@ application_t::application_t()
                                        0,
                                        0,
                                        UNIT::INVALID,
-                                       6.00000f,
+                                       5.00000f,
                                        decoder_t::decode_obd2_response,
                                        nullptr,
                                        true,
@@ -441,7 +478,7 @@ application_t::application_t()
                                        0,
                                        0,
                                        UNIT::INVALID,
-                                       6.00000f,
+                                       5.00000f,
                                        decoder_t::decode_obd2_response,
                                        nullptr,
                                        true,