sebastiankb пре 13 година
родитељ
комит
1516a5977e
5 измењених фајлова са 92 додато и 4 уклоњено
  1. 2 0
      src/appHandshake/appHand_dataTypes.h
  2. 44 0
      src/test/main.c
  3. 42 0
      src/test/main.h
  4. 1 1
      src/test/main_codec.c
  5. 3 3
      src/test/pev_service.c

+ 2 - 0
src/appHandshake/appHand_dataTypes.h

@@ -123,6 +123,8 @@ struct EXIDocumentType_appHand
 
 void init_EXIDocumentType_appHand(struct EXIDocumentType_appHand* type);
 
+void init_AnonType_supportedAppProtocolReq(struct AnonType_supportedAppProtocolReq* type);
+
 #endif
 
 #ifdef __cplusplus

+ 44 - 0
src/test/main.c

@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @author Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.6
+ * @contact Joerg.Heuer@siemens.com
+ *
+ * <p>Switch for sample programs: EXI codec only or for entire V2G service</p>
+ *
+ ********************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "main.h"
+
+int main(int argc, char *argv[]) {
+#if CODE_VERSION == CODE_VERSION_EXI
+	/* EXI codec only */
+	return main_codec(argc, argv);
+#elif CODE_VERSION == CODE_VERSION_SERVICE
+	/* V2G client / service example scenario */
+	return main_service(argc, argv);
+#endif
+
+}
+

+ 42 - 0
src/test/main.h

@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @author Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.6
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
+ ********************************************************************/
+
+
+#define CODE_VERSION_EXI 1
+#define CODE_VERSION_SERVICE 2
+#define CODE_VERSION CODE_VERSION_SERVICE
+
+#ifndef MAIN_H_
+#define MAIN_H_
+
+#if CODE_VERSION == CODE_VERSION_EXI
+int main_codec(int argc, char *argv[]);
+#elif CODE_VERSION == CODE_VERSION_SERVICE
+int main_service(int argc, char *argv[]);
+#endif
+
+#endif

+ 1 - 1
src/test/main_codec.c

@@ -66,7 +66,7 @@ static void debugValue(exi_value_t* val);
 #endif /*EXI_DEBUG*/
 
 
-int xmain(int argc, char *argv[]) {
+int main_codec(int argc, char *argv[]) {
 
 	int errn = 0;
 

+ 3 - 3
src/test/pev_service.c

@@ -1411,7 +1411,7 @@ static int dc_charging()
 
 
 
-int main()
+int main_service()
 {
 	printf("+++ Start application handshake protocol example +++\n\n");
 
@@ -1426,7 +1426,7 @@ int main()
 
 	 ac_charging();
 
-	printf("\n+++Terminate V2G Client / Service example for AC charging +++\n");
+	printf("\n+++ Terminate V2G Client / Service example for AC charging +++\n");
 	printf("Please press enter for DC charging!\n");
 	fflush(stdout);
 	getchar();
@@ -1435,7 +1435,7 @@ int main()
 
 	dc_charging();
 
-	printf("\n+++Terminate V2G client / service example for DC charging +++");
+	printf("\n+++ Terminate V2G client / service example for DC charging +++");
 
 	return 0;
 }