Ability to use custom encoder for CAN signals 93/18093/2 6.99.1 6.99.2 guppy/6.99.1 guppy/6.99.2 guppy_6.99.1 guppy_6.99.2
authorRomain Forlot <romain.forlot@iot.bzh>
Tue, 20 Nov 2018 17:04:51 +0000 (18:04 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Wed, 21 Nov 2018 12:45:03 +0000 (12:45 +0000)
Adds the encoder header file that hold the default encoding functions

Bug-AGL: SPEC-1965

Change-Id: I13fe90b515cde04894ba45c9cce72477b56d924b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
src/main.cpp

index dad4480..0929d8f 100644 (file)
@@ -217,7 +217,8 @@ std::ostream& operator<<(std::ostream& o, const generator<openxc::diagnostic_mes
 void generate(const std::string& header, const std::string& footer, const openxc::message_set& message_set, std::ostream& out)\r
 {\r
        out << "#include \"application.hpp\"\n"\r
-               << "#include \"../can/can-decoder.hpp\"\n\n";\r
+               << "#include \"../can/can-decoder.hpp\"\n"\r
+               << "#include \"../can/can-encoder.hpp\"\n\n";\r
 \r
        if (header.size()) out << header << "\n";\r
 \r
@@ -269,7 +270,7 @@ void generate(const std::string& header, const std::string& footer, const openxc
 std::string read_file(const std::string& file)\r
 {\r
        if(file.size() == 0) return std::string();\r
-       \r
+\r
        std::string content;\r
        std::ifstream stream(file);\r
        if (stream)\r
@@ -334,7 +335,7 @@ int main(int argc, char *argv[])
                        showhelpinfo(argv[0]);\r
                        exit(1);\r
                }\r
-               /*use function getopt to get the arguments with option."hu:p:s:v" indicate \r
+               /*use function getopt to get the arguments with option."hu:p:s:v" indicate\r
                that option h,v are the options without arguments while u,p,s are the\r
                options with arguments*/\r
                while((tmp=(char)getopt(argc,argv,"m:h:f:o:"))!=-1)\r
@@ -385,7 +386,7 @@ int main(int argc, char *argv[])
                                throw std::runtime_error(ss.str());\r
                        }\r
                }\r
-               generate(header.str(), footer, message_set, output_file.size() ? out : std::cout); \r
+               generate(header.str(), footer, message_set, output_file.size() ? out : std::cout);\r
        }\r
        catch (std::exception& e)\r
        {\r