sebastiankb %!s(int64=14) %!d(string=hai) anos
pai
achega
326e0b8b1d
Modificáronse 55 ficheiros con 2238 adicións e 4218 borrados
  1. 1 3
      .cproject
  2. 1 13
      .project
  3. 2 21
      README.txt
  4. 10 11
      data/test/sessionSetupReq.xml
  5. BIN=BIN
      data/test/sessionSetupReq.xml.exi
  6. 27 31
      data/test/sessionSetupRes.xml
  7. 1 1
      data/test/sessionSetupRes.xml.exi
  8. 17 48
      src/codec/BitDecoderChannel.c
  9. 4 18
      src/codec/BitDecoderChannel.h
  10. 4 4
      src/codec/BitEncoderChannel.c
  11. 4 4
      src/codec/BitEncoderChannel.h
  12. 3 3
      src/codec/BitInputStream.c
  13. 3 3
      src/codec/BitInputStream.h
  14. 3 3
      src/codec/BitOutputStream.c
  15. 3 3
      src/codec/BitOutputStream.h
  16. 5 5
      src/codec/ByteStream.c
  17. 4 4
      src/codec/ByteStream.h
  18. 4 4
      src/codec/EXICoder.c
  19. 4 4
      src/codec/EXICoder.h
  20. 18 17
      src/codec/EXIDecoder.c
  21. 2 5
      src/codec/EXIDecoder.h
  22. 5 8
      src/codec/EXIEncoder.c
  23. 2 2
      src/codec/EXIEncoder.h
  24. 3 3
      src/codec/EXIHeaderDecoder.c
  25. 2 2
      src/codec/EXIHeaderDecoder.h
  26. 2 2
      src/codec/EXIHeaderEncoder.c
  27. 2 2
      src/codec/EXIHeaderEncoder.h
  28. 19 21
      src/codec/EXITypes.h
  29. 11 8
      src/codec/StringTable.c
  30. 8 8
      src/codec/StringTable.h
  31. 41 53
      src/codec/StringTableEntries.c
  32. 4 4
      src/codec/StringTableEntries.h
  33. 2 2
      src/codec/UCSString.c
  34. 2 2
      src/codec/UCSString.h
  35. 79 79
      src/service/v2g_service.h
  36. 44 44
      src/service/v2g_serviceClientDataTransmitter.h
  37. 635 1507
      src/service/v2g_serviceClientStubs.c
  38. 22 135
      src/service/v2g_serviceClientStubs.h
  39. 300 229
      src/service/v2g_serviceDataSerialization.c
  40. 42 0
      src/service/v2g_serviceDataSerializiation.h
  41. 118 124
      src/service/v2g_serviceDataTypes.c
  42. 282 319
      src/service/v2g_serviceDataTypes.h
  43. 375 482
      src/service/v2g_serviceDispatcher.c
  44. 43 43
      src/service/v2g_serviceDispatcher.h
  45. 3 13
      src/service/v2g_serviceMethods.h
  46. 3 4
      src/test/main.c
  47. 2 2
      src/test/main.h
  48. 10 10
      src/test/main_codec.c
  49. 23 589
      src/test/main_service.c
  50. 5 5
      src/test/v2g_server.c
  51. 3 3
      src/test/v2g_server.h
  52. 5 5
      src/test/v2g_serviceClientDataTransmitter.c
  53. 11 293
      src/test/v2g_serviceMethods.c
  54. 5 5
      src/transport/doIP.c
  55. 5 5
      src/transport/doIP.h

+ 1 - 3
.cproject

@@ -555,7 +555,6 @@
 </profile>
 </scannerConfigBuildInfo>
 </storageModule>
-<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
 </cconfiguration>
 <cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.release.681614450">
 <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.release.681614450" moduleId="org.eclipse.cdt.core.settings" name="Release">
@@ -572,7 +571,7 @@
 <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.release.681614450." name="/" resourcePath="">
 <toolChain id="cdt.managedbuild.toolchain.gnu.base.506532925" name="Linux GCC" nonInternalBuilderId="cdt.managedbuild.target.gnu.builder.base" superClass="cdt.managedbuild.toolchain.gnu.base">
 <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.784544317" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
-<builder autoBuildTarget="all" buildPath="${workspace_loc:/OpenV2G/Release}" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.332458815" incrementalBuildTarget="all" managedBuildOn="true" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>
+<builder autoBuildTarget="all" buildPath="${workspace_loc:/OpenV2G/Release}" cleanBuildTarget="clean" id="org.eclipse.cdt.build.core.internal.builder.755395484" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="org.eclipse.cdt.build.core.internal.builder"/>
 <tool id="cdt.managedbuild.tool.gnu.archiver.base.501212056" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
 <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.605628336" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
 <option id="gnu.cpp.compiler.option.optimization.level.937286096" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
@@ -1105,7 +1104,6 @@
 </profile>
 </scannerConfigBuildInfo>
 </storageModule>
-<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
 </cconfiguration>
 </storageModule>
 <storageModule moduleId="cdtBuildSystem" version="4.0.0">

+ 1 - 13
.project

@@ -17,10 +17,6 @@
 					<key>org.eclipse.cdt.make.core.append_environment</key>
 					<value>true</value>
 				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
-					<value>all</value>
-				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildArguments</key>
 					<value></value>
@@ -31,11 +27,7 @@
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.buildLocation</key>
-					<value>${workspace_loc:/OpenV2G/Release}</value>
-				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
-					<value>clean</value>
+					<value>${workspace_loc:/OpenV2G/Debug}</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.contents</key>
@@ -53,10 +45,6 @@
 					<key>org.eclipse.cdt.make.core.enableFullBuild</key>
 					<value>true</value>
 				</dictionary>
-				<dictionary>
-					<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
-					<value>all</value>
-				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.stopOnError</key>
 					<value>true</value>

+ 2 - 21
README.txt

@@ -1,13 +1,13 @@
 -------------------------------------------------------------------------
 OpenV2G - an open source project implementing the basic functionality of the ISO IEC 15118 vehicle to grid (V2G) communication interface 
-Version 0.4, released April 14, 2011
+Version 0.3, released October 27, 2010
 http://openv2g.sourceforge.net/
 
 Please report bugs via the SourceForge bug tracking system at http://sourceforge.net/tracker/?group_id=350113.
 Thank you.
 
 
-Copyright (C) 2007-2011 Siemens AG
+Copyright (C) 2007-2010 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
@@ -22,25 +22,6 @@ 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/>.
 
--------------------------------------------------------------------------
-CHANGES from version 0.3.1:
--------------------------------------------------------------------------
-* adaption of V2G schema changes
-* supporting of DC messages
-* example program showing the message sequence of AC charging and 
-DC charging
-* bug-fixes
-
--------------------------------------------------------------------------
-CHANGES from version 0.3:
--------------------------------------------------------------------------
-* Bug-fixes
-* reduced memory usage
-* some type changes in the EXI codec and V2G service: 
-** struct v2gService->struct EXIService in v2g_service.h
-** size_t->uint16_t in v2g_serviceClientDataTransmitter.h and doIP.h
-* renaming of some enumeration values in v2g_serviceDataTypes.h
-
 -------------------------------------------------------------------------
 CHANGES from version 0.2.2:
 -------------------------------------------------------------------------

+ 10 - 11
data/test/sessionSetupReq.xml

@@ -1,22 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ns0:V2G_Message xmlns:ns0="urn:iso:15118:2:2010:eval1.0:MsgDef" xmlns:ns1="urn:iso:15118:2:2010:eval1.0:MsgBody"
-    xmlns:ns2="urn:iso:15118:2:2010:eval1.0:MsgDataTypes"
- xmlns:ns3="urn:iso:15118:2:2010:eval1.0:MsgHeader"
+<ns3:V2G_Message xmlns:ns1="urn:iso:15118:2:2010:MsgBody"
+ xmlns:ns2="urn:iso:15118:2:2010:MsgDataTypes"
+ xmlns:ns3="urn:iso:15118:2:2010:MsgDef"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:iso:15118:2:2010:eval1.0:MsgDef V2G_CI_MsgDef.xsd">
-    <ns0:Header>
+ xsi:schemaLocation="urn:iso:15118:2:2010:MsgDef V2G_CI_MsgDef.xsd">
+    <ns3:Header>
         <ns3:SessionInformation>
             <ns2:SessionID>3031323334353637</ns2:SessionID>
             <ns2:ProtocolVersion>1</ns2:ProtocolVersion>
         </ns3:SessionInformation>
-    </ns0:Header>
-    <ns0:Body>
-        <ns1:SessionSetupReq>            
+    </ns3:Header>
+    <ns3:Body>
+        <ns1:SessionSetupReq>
             <ns1:PEVStatus>
                 <ns2:ConnectorLocked>0</ns2:ConnectorLocked>
                 <ns2:ChargerStandby>1</ns2:ChargerStandby>
-                <ns2:ReadyToCharge>false</ns2:ReadyToCharge>
             </ns1:PEVStatus>
         </ns1:SessionSetupReq>
-    </ns0:Body>
-</ns0:V2G_Message>
+    </ns3:Body>
+</ns3:V2G_Message>

BIN=BIN
data/test/sessionSetupReq.xml.exi


+ 27 - 31
data/test/sessionSetupRes.xml

@@ -1,32 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ns0:V2G_Message xmlns:ns0="urn:iso:15118:2:2010:eval1.0:MsgDef"
-    xmlns:ns1="urn:iso:15118:2:2010:eval1.0:MsgBody"
-    xmlns:ns2="urn:iso:15118:2:2010:eval1.0:MsgDataTypes"
-    xmlns:ns3="urn:iso:15118:2:2010:eval1.0:MsgHeader"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="urn:iso:15118:2:2010:eval1.0:MsgDef V2G_CI_MsgDef.xsd">
-    <ns0:Header>
-        <ns3:SessionInformation>
-            <ns2:SessionID>0Fb80Fb80Fb80Fb8</ns2:SessionID>
-            <ns2:ProtocolVersion>1</ns2:ProtocolVersion>
-        </ns3:SessionInformation>
-    </ns0:Header>
-    <ns0:Body>
-        <ns1:SessionSetupRes>
-            <ns1:ResponseCode>OK_SessionSetup</ns1:ResponseCode>
-            <ns1:EVSEID>54</ns1:EVSEID>
-            <ns1:EVSEStatus>
-                <ns2:FatalError>0</ns2:FatalError>
-                <ns2:EVSEStandby>1</ns2:EVSEStandby>
-                <ns2:ConnectorLocked>1</ns2:ConnectorLocked>
-                <ns2:PowerSwitchClosed>0</ns2:PowerSwitchClosed>
-                <ns2:RCD>1</ns2:RCD>
-                <ns2:ShutDownTime>123456789</ns2:ShutDownTime>
-                <ns2:ChargerStandby>1</ns2:ChargerStandby>
-                <ns2:EVSEMalfunction>false</ns2:EVSEMalfunction>
-                <ns2:StopCharging>true</ns2:StopCharging>
-            </ns1:EVSEStatus>
-            <ns1:TCurrent>123456789</ns1:TCurrent>
-        </ns1:SessionSetupRes>
-    </ns0:Body>
-</ns0:V2G_Message>
+<v2gci_d:V2G_Message xmlns:v2gci_d="urn:iso:15118:2:2010:MsgDef"
+ xmlns:v2gci_t="urn:iso:15118:2:2010:MsgDataTypes"
+ xmlns:ns0="urn:iso:15118:2:2010:MsgBody"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:iso:15118:2:2010:MsgDef V2G_CI_MsgDef.xsd">
+    <v2gci_d:Header>
+        <v2gci_d:SessionInformation>
+            <v2gci_t:SessionID>0Fb80Fb80Fb80Fb8</v2gci_t:SessionID>
+            <v2gci_t:ProtocolVersion>1</v2gci_t:ProtocolVersion>
+        </v2gci_d:SessionInformation>
+    </v2gci_d:Header>
+    <v2gci_d:Body>
+        <ns0:SessionSetupRes>
+            <ns0:ResponseCode>OK_SessionSetup</ns0:ResponseCode>
+            <ns0:EVSEID>54</ns0:EVSEID>
+            <ns0:EVSEStatus>
+                <v2gci_t:FatalError>0</v2gci_t:FatalError>
+                <v2gci_t:EVSEStandby>1</v2gci_t:EVSEStandby>
+                <v2gci_t:ConnectorLocked>1</v2gci_t:ConnectorLocked>
+                <v2gci_t:PowerSwitchClosed>0</v2gci_t:PowerSwitchClosed>
+                <v2gci_t:RCD>1</v2gci_t:RCD>
+                <v2gci_t:ShutDownTime>123456789</v2gci_t:ShutDownTime>
+            </ns0:EVSEStatus>
+            <ns0:TCurrent>123456789</ns0:TCurrent>
+        </ns0:SessionSetupRes>
+    </v2gci_d:Body>
+</v2gci_d:V2G_Message>

+ 1 - 1
data/test/sessionSetupRes.xml.exi

@@ -1 +1 @@
-�Ø@}À}À}À}ÂcÀTjVk¼ê)Y®ó 
+�˜@}À}À}À}Âc�TjVk¼é+5Þt

+ 17 - 48
src/codec/BitDecoderChannel.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  * Bit decoding functionalities
@@ -38,59 +38,36 @@
 #ifndef BIT_DECODER_CHANNEL_C
 #define BIT_DECODER_CHANNEL_C
 
-/* only the least significant 8 bits are filled properly */
-int _decode(bitstream_t* stream, uint32_t* b) {
+int decode(bitstream_t* stream, uint8_t* b) {
 	return readBits(stream, 8, b);
 }
 
 int decodeBoolean(bitstream_t* stream, int* b) {
-	uint32_t ub;
+	uint8_t ub;
 	int errn = readBits(stream, 1, &ub);
 	*b = (ub == 0) ? 0 : 1;
 	return errn;
 }
 
-int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32) {
+int decodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint8_t* uint8) {
 	if (nbits == 0) {
-		*uint32 = 0;
+		*uint8 = 0;
 		return 0;
 	} else {
-		return readBits(stream, nbits, uint32);
+		return readBits(stream, nbits, uint8);
 	}
 }
 
-int decodeUnsignedInteger16(bitstream_t* stream, uint16_t* uint16) {
-	unsigned int mShift = 0;
-	int errn = 0;
-	uint32_t b;
-	*uint16 = 0;
-
-	do {
-		/* 1. Read the next octet */
-		errn = _decode(stream, &b);
-		/* 2. Multiply the value of the unsigned number represented by the 7
-		 * least significant
-		 * bits of the octet by the current multiplier and add the result to
-		 * the current value */
-		*uint16 += (b & 127) << mShift;
-		/* 3. Multiply the multiplier by 128 */
-		mShift += 7;
-		/* 4. If the most significant bit of the octet was 1, go back to step 1 */
-	} while (errn >= 0 && (b >> 7) == 1);
-
-	return errn;
-}
-
 int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32) {
 	/* 0XXXXXXX ... 1XXXXXXX 1XXXXXXX */
 	unsigned int mShift = 0;
 	int errn = 0;
-	uint32_t b;
+	uint8_t b;
 	*uint32 = 0;
 
 	do {
 		/* 1. Read the next octet */
-		errn = _decode(stream, &b);
+		errn = decode(stream, &b);
 		/* 2. Multiply the value of the unsigned number represented by the 7
 		 * least significant
 		 * bits of the octet by the current multiplier and add the result to
@@ -113,11 +90,11 @@ int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32) {
 int decodeUnsignedInteger64(bitstream_t* stream, uint64_t* uint64) {
 	unsigned int mShift = 0;
 	int errn = 0;
-	uint32_t b;
+	uint8_t b;
 	*uint64 = 0L;
 
 	do {
-		errn = _decode(stream, &b);
+		errn = decode(stream, &b);
 		*uint64 += ((uint64_t) (b & 127)) << mShift;
 		mShift += 7;
 	} while (errn >= 0 && (b >> 7) == 1);
@@ -200,7 +177,7 @@ int decodeFloat(bitstream_t* stream, float_me_t* f) {
 /**
  * Decode a sequence of characters for a given length.
  */
-int decodeStringOnly(bitstream_t* stream, uint16_t len, string_ucs_t* s) {
+int decodeStringOnly(bitstream_t* stream, size_t len, string_ucs_t* s) {
 	decodeCharacters(stream, len, s->codepoints);
 	s->len = len;
 	return 0;
@@ -210,7 +187,7 @@ int decodeStringOnly(bitstream_t* stream, uint16_t len, string_ucs_t* s) {
  * Decode a length prefixed sequence of characters.
  */
 int decodeString(bitstream_t* stream, string_ucs_t* s) {
-	int errn = decodeUnsignedInteger16(stream, &s->len);
+	int errn = decodeUnsignedInteger32(stream, &s->len);
 	if (errn < 0) {
 		return errn;
 	}
@@ -218,7 +195,7 @@ int decodeString(bitstream_t* stream, string_ucs_t* s) {
 }
 
 int decodeStringValue(bitstream_t* stream, string_ucs_t* s) {
-	int errn = decodeUnsignedInteger16(stream, &s->len);
+	int errn = decodeUnsignedInteger32(stream, &s->len);
 	if (errn < 0) {
 		return errn;
 	}
@@ -249,14 +226,11 @@ int decodeStringValue(bitstream_t* stream, string_ucs_t* s) {
  * Each character is represented by its UCS [ISO/IEC 10646]
  * code point encoded as an Unsigned Integer
  */
-int decodeCharacters(bitstream_t* stream, uint16_t len, uint32_t* chars) {
+int decodeCharacters(bitstream_t* stream, size_t len, uint32_t* chars) {
 	unsigned int i;
 	int errn = 0;
 	for (i = 0; i < len && errn >= 0; i++) {
 		errn = decodeUnsignedInteger32(stream, &chars[i]);
-		if (errn < 0) {
-			return errn;
-		}
 	}
 
 	return errn;
@@ -267,18 +241,13 @@ int decodeCharacters(bitstream_t* stream, uint16_t len, uint32_t* chars) {
  */
 int decodeBinary(bitstream_t* stream, bytes_t* bytes) {
 	unsigned int i;
-	uint32_t b;
-	int errn = decodeUnsignedInteger16(stream, &bytes->len);
+	int errn = decodeUnsignedInteger32(stream, &bytes->len);
 	if (errn < 0) {
 		return errn;
 	}
 
 	for (i = 0; i < bytes->len && errn >= 0; i++) {
-		errn = _decode(stream, &b);
-		if (errn < 0) {
-			return errn;
-		}
-		bytes->data[i] = (uint8_t)b;
+		errn = decode(stream, &bytes->data[i]);
 	}
 
 	return errn;

+ 4 - 18
src/codec/BitDecoderChannel.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -41,15 +41,7 @@ int decodeBoolean(bitstream_t* stream, int* b);
 /**
  * Decodes and returns an n-bit unsigned integer.
  */
-int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32);
-
-/**
- * Decode an arbitrary precision non negative integer using a sequence of
- * octets. The most significant bit of the last octet is set to zero to
- * indicate sequence termination. Only seven bits per octet are used to
- * store the integer's value.
- */
-int decodeUnsignedInteger16(bitstream_t* stream, uint16_t* uint16);
+int decodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint8_t* uint8);
 
 /**
  * Decode an arbitrary precision non negative integer using a sequence of
@@ -91,12 +83,6 @@ int decodeInteger64(bitstream_t* stream, int64_t* int64);
  */
 int decodeFloat(bitstream_t* stream, float_me_t* f);
 
-
-/**
- * Decode a sequence of characters for a given length.
- */
-int decodeStringOnly(bitstream_t* stream, uint16_t len, string_ucs_t* s);
-
 /**
  * Decode a length prefixed sequence of characters.
  */
@@ -114,7 +100,7 @@ int decodeStringValue(bitstream_t* stream, string_ucs_t* s);
 /**
  * Decode a sequence of characters according to a given length.
  */
-int decodeCharacters(bitstream_t* stream, uint16_t len, uint32_t* chars);
+int decodeCharacters(bitstream_t* stream, size_t len, uint32_t* chars);
 
 /**
  * Decode a binary value as a length-prefixed sequence of octets.

+ 4 - 4
src/codec/BitEncoderChannel.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -86,7 +86,7 @@ int encodeBoolean(bitstream_t* stream, int b) {
  * Encode n-bit unsigned integer. The n least significant bits of parameter
  * b starting with the most significant, i.e. from left to right.
  */
-int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val)  {
+int encodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint8_t val)  {
 	return writeBits(stream, nbits, val);
 }
 
@@ -252,7 +252,7 @@ int encodeStringValue(bitstream_t* stream, string_ucs_t* string) {
  * Each character is represented by its UCS [ISO/IEC 10646]
  * code point encoded as an Unsigned Integer
  */
-int encodeCharacters(bitstream_t* stream, uint32_t* chars, uint16_t len) {
+int encodeCharacters(bitstream_t* stream, uint32_t* chars, size_t len) {
 	unsigned int i;
 	int errn = 0;
 	for(i=0; i<len && errn>=0; i++) {

+ 4 - 4
src/codec/BitEncoderChannel.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -45,7 +45,7 @@ int encodeBoolean(bitstream_t* stream, int b);
  * Encode n-bit unsigned integer. The n least significant bits of parameter
  * b starting with the most significant, i.e. from left to right.
  */
-int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val);
+int encodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint8_t val);
 
 
 /**
@@ -104,7 +104,7 @@ int encodeStringValue(bitstream_t* stream, string_ucs_t* string);
  * Each character is represented by its UCS [ISO/IEC 10646]
  * code point encoded as an Unsigned Integer
  */
-int encodeCharacters(bitstream_t* stream, uint32_t* chars, uint16_t len);
+int encodeCharacters(bitstream_t* stream, uint32_t* chars, size_t len);
 
 /**
  * Encode a binary value as a length-prefixed sequence of octets.

+ 3 - 3
src/codec/BitInputStream.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -49,7 +49,7 @@ int readBuffer(bitstream_t* stream)
 	return errn;
 }
 
-int readBits(bitstream_t* stream, uint16_t num_bits, uint32_t* b)
+int readBits(bitstream_t* stream, size_t num_bits, uint8_t* b)
 {
 	int errn = readBuffer(stream);
 	if (errn < 0) {

+ 3 - 3
src/codec/BitInputStream.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -32,7 +32,7 @@ extern "C" {
 #ifndef BIT_INPUT_STREAM_H
 #define BIT_INPUT_STREAM_H
 
-int readBits(bitstream_t* stream, uint16_t num_bits, uint32_t* b);
+int readBits(bitstream_t* stream, size_t num_bits, uint8_t* b);
 
 int flush();
 

+ 3 - 3
src/codec/BitOutputStream.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -32,7 +32,7 @@
 #define BIT_OUTPUT_STREAM_C
 
 /*	NOTE: nbits <= 8 */
-int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t val) {
+int writeBits(bitstream_t* stream, size_t nbits, uint8_t val) {
 	/*  is there enough space in the buffer */
 	if (nbits <= stream->capacity) {
 		/* all bits fit into the current buffer */

+ 3 - 3
src/codec/BitOutputStream.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -34,7 +34,7 @@ extern "C" {
 #ifndef BIT_OUTPUT_STREAM_H
 #define BIT_OUTPUT_STREAM_H
 
-int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t bits);
+int writeBits(bitstream_t* stream, size_t nbits, uint8_t bits);
 
 /* flush output */
 int flush(bitstream_t* stream);

+ 5 - 5
src/codec/ByteStream.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -36,7 +36,7 @@
 #ifndef BYTE_STREAM_C
 #define BYTE_STREAM_C
 
-int readBytesFromFile(const char * filename, uint8_t* data, uint16_t size, uint16_t pos) {
+int readBytesFromFile(const char * filename, uint8_t* data, size_t size, size_t pos) {
 	FILE* f;
 	int character;
 
@@ -60,8 +60,8 @@ int readBytesFromFile(const char * filename, uint8_t* data, uint16_t size, uint1
 	return pos;
 }
 
-int writeBytesToFile(uint8_t* data, uint16_t len, const char * filename) {
-	uint16_t rlen;
+int writeBytesToFile(uint8_t* data, size_t len, const char * filename) {
+	size_t rlen;
 	FILE* f = fopen(filename, "wb+");
 
 	if (f == NULL) {

+ 4 - 4
src/codec/ByteStream.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -34,9 +34,9 @@ extern "C" {
 #ifndef BYTE_STREAM_H
 #define BYTE_STREAM_H
 
-int writeBytesToFile(uint8_t* data, uint16_t len, const char * filename);
+int writeBytesToFile(uint8_t* data, size_t len, const char * filename);
 
-int readBytesFromFile(const char * filename, uint8_t* data, uint16_t size, uint16_t pos);
+int readBytesFromFile(const char * filename, uint8_t* data, size_t size, size_t pos);
 
 #endif
 

+ 4 - 4
src/codec/EXICoder.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -39,13 +39,13 @@
 #include "EXICoder.h"
 
 /*
- uint16_t exiGetCurrentState(struct exiState* state) {
+ size_t exiGetCurrentState(struct exiState* state) {
  return state->grammarStates[state->currentStack];
  // return 0;
  }
  */
 
-int exiPushStack(exi_state_t* state, uint16_t newState, eqname_t* eqn) {
+int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn) {
 	if ((state->stackIndex + 1) < EXI_ELEMENT_STACK_SIZE) {
 		state->grammarStack[++state->stackIndex] = newState;
 		/* copy qname */

+ 4 - 4
src/codec/EXICoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -37,9 +37,9 @@ extern "C" {
 #include "EXITypes.h"
 
 
-/* uint16_t exiGetCurrentState(struct exiState* state); */
+/* size_t exiGetCurrentState(struct exiState* state); */
 
-int exiPushStack(exi_state_t* state, uint16_t newState, eqname_t* eqn);
+int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn);
 
 int exiPopStack(exi_state_t* state);
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 18 - 17
src/codec/EXIDecoder.c


+ 2 - 5
src/codec/EXIDecoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -44,9 +44,6 @@ int exiDecodeEndDocument(bitstream_t* stream, exi_state_t* state);
 int exiDecodeStartElement(bitstream_t* stream, exi_state_t* state,
 		eqname_t* se);
 
-int exiDecodeStartElementGeneric(bitstream_t* stream, exi_state_t* state,
-		eqname_t* se);
-
 int exiDecodeEndElement(bitstream_t* stream, exi_state_t* state,
 		eqname_t* ee);
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5 - 8
src/codec/EXIEncoder.c


+ 2 - 2
src/codec/EXIEncoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

+ 3 - 3
src/codec/EXIHeaderDecoder.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -34,7 +34,7 @@
 #define EXI_HEADER_DECODER_C
 
 int readEXIHeader(bitstream_t* stream) {
-	uint32_t header = 0;
+	uint8_t header;
 	int errn = readBits(stream, 8, &header);
 	if (errn < 0) {
 		return errn;

+ 2 - 2
src/codec/EXIHeaderDecoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

+ 2 - 2
src/codec/EXIHeaderEncoder.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

+ 2 - 2
src/codec/EXIHeaderEncoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

+ 19 - 21
src/codec/EXITypes.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -35,8 +35,6 @@ extern "C" {
 
 #define BITS_IN_BYTE 8
 
-#define UINT_MAX_VALUE 65535
-
 #define EXI_ELEMENT_STACK_SIZE 16
 
 /* EXI automaton methods prefixes such as "inline" etc. */
@@ -51,29 +49,29 @@ extern "C" {
 
 typedef struct {
 	/*	Integer Array */
-	uint16_t size; /* array size */
+	size_t size; /* array size */
 	uint8_t* data; /* int data array */
-	uint16_t* pos; /* next position in array */
+	size_t* pos; /* next position in array */
 	/* Current byte buffer & its remaining bit capacity */
 	uint8_t buffer;
-	uint16_t capacity;
+	size_t capacity;
 } bitstream_t;
 
 typedef struct {
 	/* Bytes Size and array container */
-	uint16_t size;
+	size_t size;
 	uint8_t* data;
 	/* current length (len <= size) */
-	uint16_t len;
+	size_t len;
 } bytes_t;
 
 /* Universal Character Set (UCS) strings */
 typedef struct {
 	/* UCS size and UCS character container*/
-	uint16_t size;
+	size_t size;
 	uint32_t* codepoints;
 	/* current length == number of code-points, (len <= size) */
-	uint16_t len;
+	size_t len;
 } string_ucs_t;
 
 typedef struct {
@@ -129,27 +127,27 @@ typedef enum
 /* TODO list support */
 typedef struct {
 	/* List container with memory size */
-	uint16_t size;
+	size_t size;
 	uint8_t* data;
 	/* list item type */
 	exi_datatype_t type;
 	/* number of items */
-	uint16_t len;
+	size_t len;
 } list_t;
 
 
 typedef struct {
-	uint16_t namespaceURI;
-	uint16_t localPart;
+	unsigned int namespaceURI;
+	unsigned int localPart;
 } eqname_t;
 
 typedef struct  {
 	/* stack of grammar states and elements */
-	uint16_t grammarStack [EXI_ELEMENT_STACK_SIZE];
+	size_t grammarStack [EXI_ELEMENT_STACK_SIZE];
 	eqname_t elementStack [EXI_ELEMENT_STACK_SIZE];
-	uint16_t stackIndex;
+	size_t stackIndex;
 	/* event-code */
-	uint32_t eventCode;
+	uint8_t eventCode;
 } exi_state_t;
 
 
@@ -159,16 +157,16 @@ typedef struct  {
 
 	/* base types */
 	int boolean;
+	int8_t int8;
+	uint8_t uint8;
 	uint32_t uint32;
-	uint64_t uint64;
 	int32_t int32;
 	int64_t int64;
-	uint32_t enumeration;
+	uint8_t enumeration;
 
 	/* Bytes, Strings and Lists are not native types anymore */
 	bytes_t binary;
 	string_ucs_t string;
-	float_me_t float_me;
 	list_t list;
 } exi_value_t;
 

+ 11 - 8
src/codec/StringTable.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -32,12 +32,15 @@
 #include <stdlib.h>
 
 #include "StringTable.h"
+#include "EXITypes.h"
+#include "BitInputStream.h"
+#include "BitDecoderChannel.h"
 
 #include "StringTableEntries.h"
 
 #include "assert.h"
 
-int exiGetUri(uint16_t uriID, const char** uri) {
+int exiGetUri(size_t uriID, const char** uri) {
 	if ( uriID < stringTable.len ) {
 		*uri = stringTable.uris[uriID];
 	} else {
@@ -47,13 +50,13 @@ int exiGetUri(uint16_t uriID, const char** uri) {
 	return 0;
 }
 
-int exiGetUriLength(uint16_t* uriLength) {
+int exiGetUriLength(size_t* uriLength) {
 	*uriLength =  stringTable.len;
 	return 0;
 }
 
 
-int exiGetUriID(const char* uri, uint16_t* uriID) {
+int exiGetUriID(const char* uri, size_t* uriID) {
 	unsigned int i;
 	for(i=0; i<stringTable.len; i++) {
 		if ( strcmp ( uri, stringTable.uris[i] ) == 0 ) {
@@ -65,7 +68,7 @@ int exiGetUriID(const char* uri, uint16_t* uriID) {
 }
 
 
-int exiGetLocalName(uint16_t uriID, uint16_t localNameID, const char** localName) {
+int exiGetLocalName(size_t uriID, size_t localNameID, const char** localName) {
 	if ( uriID < stringTable.len ) {
 		if ( localNameID < stringTable.localNames[uriID].len ) {
 			*localName = stringTable.localNames[uriID].entries[localNameID];
@@ -78,7 +81,7 @@ int exiGetLocalName(uint16_t uriID, uint16_t localNameID, const char** localName
 	return 0;
 }
 
-int exiGetLocalNameLength(uint16_t uriID, uint16_t* localNameLength) {
+int exiGetLocalNameLength(size_t uriID, size_t* localNameLength) {
 	if ( uriID < stringTable.len ) {
 		*localNameLength =  stringTable.localNames[uriID].len;
 	} else {
@@ -88,7 +91,7 @@ int exiGetLocalNameLength(uint16_t uriID, uint16_t* localNameLength) {
 	return 0;
 }
 
-int exiGetLocalNameID(uint16_t uriID, const char* localName, uint16_t* localNameID) {
+int exiGetLocalNameID(size_t uriID, const char* localName, size_t* localNameID) {
 	unsigned int i;
 	if ( uriID < stringTable.len ) {
 		/* TODO binary search */

+ 8 - 8
src/codec/StringTable.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -32,17 +32,17 @@ extern "C" {
 
 #include "EXITypes.h"
 
-int exiGetUri(uint16_t uriID, const char** uri);
+int exiGetUri(size_t uriID, const char** uri);
 
-int exiGetUriLength(uint16_t* uriLength);
+int exiGetUriLength(size_t* uriLength);
 
-int exiGetUriID(const char* uri, uint16_t* uriID);
+int exiGetUriID(const char* uri, size_t* uriID);
 
-int exiGetLocalName(uint16_t uriID, uint16_t localNameID, const char** localName);
+int exiGetLocalName(size_t uriID, size_t localNameID, const char** localName);
 
-int exiGetLocalNameLength(uint16_t uriID, uint16_t* localNameLength);
+int exiGetLocalNameLength(size_t uriID, size_t* localNameLength);
 
-int exiGetLocalNameID(uint16_t uriID, const char* localName, uint16_t* localNameID);
+int exiGetLocalNameID(size_t uriID, const char* localName, size_t* localNameID);
 
 #endif
 

+ 41 - 53
src/codec/StringTableEntries.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -59,73 +59,61 @@ const char * localNames3[] = {
 };
 /* localName entries for URI id = 4 */
 const char * localNames4[] = {
-  "CableCheckReq",  "CableCheckReqType",  "CableCheckRes",  "CableCheckResType",  "ChargeParameterDiscoveryReq",
-  "ChargeParameterDiscoveryReqType",  "ChargeParameterDiscoveryRes",  "ChargeParameterDiscoveryResType",  "ChargingMode",  "ContractID",
-  "CurrentDemandReq",  "CurrentDemandReqType",  "CurrentDemandRes",  "CurrentDemandResType",  "CurrentDifferential",
-  "EAmount",  "EVSEID",  "EVSEMaxCurrent",  "EVSEMaxPhases",  "EVSEMaxPower",
-  "EVSEMaxVoltage",  "EVSEMinCurrent",  "EVSEMinVoltage",  "EVSEPresentCurrent",  "EVSEPresentVoltage",
-  "EVSEStatus",  "EnergyProvider",  "EoC",  "LineLockReq",  "LineLockReqType",
-  "LineLockRes",  "LineLockResType",  "MeterInfo",  "MeteringReceiptReq",  "MeteringReceiptReqType",
-  "MeteringReceiptRes",  "MeteringReceiptResType",  "MeteringStatusReq",  "MeteringStatusReqType",  "MeteringStatusRes",
-  "MeteringStatusResType",  "PCurrent",  "PEVDemandCurrent",  "PEVID",  "PEVMaxCurrent",
-  "PEVMaxPhases",  "PEVMaxPower",  "PEVMaxVoltage",  "PEVMinCurrent",  "PEVMinVoltage",
-  "PEVStatus",  "PEVTargetVoltage",  "PaymentDetailsReq",  "PaymentDetailsReqType",  "PaymentDetailsRes",
-  "PaymentDetailsResType",  "PowerDeliveryReq",  "PowerDeliveryReqType",  "PowerDeliveryRes",  "PowerDeliveryResType",
-  "PreChargeReq",  "PreChargeReqType",  "PreChargeRes",  "PreChargeResType",  "ReqLockStatus",
-  "ReqSwitchStatus",  "ResponseCode",  "ServiceDiscoveryReq",  "ServiceDiscoveryReqType",  "ServiceDiscoveryRes",
-  "ServiceDiscoveryResType",  "ServiceList",  "ServicePaymentSelectionReq",  "ServicePaymentSelectionReqType",  "ServicePaymentSelectionRes",
-  "ServicePaymentSelectionResType",  "ServiceScope",  "ServiceType",  "SessionSetupReq",  "SessionSetupReqType",
-  "SessionSetupRes",  "SessionSetupResType",  "TCurrent",  "Tariff",  "TariffTable",
-  "TerminateChargingReq",  "TerminateChargingReqType",  "TerminateChargingRes",  "TerminateChargingResType",  "VoltageDifferential",
-  "WeldingDetectionReq",  "WeldingDetectionReqType",  "WeldingDetectionRes",  "WeldingDetectionResType"
+  "ChargingProfile",  "ContractID",  "EAmount",  "EVSEID",  "EVSEIMax",
+  "EVSEMaxPhases",  "EVSEMaxPower",  "EVSEStatus",  "EVSEVoltage",  "EnergyProvider",
+  "EoC",  "LineLockReq",  "LineLockReqType",  "LineLockRes",  "LineLockResType",
+  "MeterInfo",  "MeteringAuthPubKey",  "MeteringReceiptReq",  "MeteringReceiptReqType",  "MeteringReceiptRes",
+  "MeteringReceiptResType",  "MeteringStatusReq",  "MeteringStatusReqType",  "MeteringStatusRes",  "MeteringStatusResType",
+  "PCurrent",  "PEVID",  "PEVMaxPhases",  "PEVMaxPower",  "PEVMaxVoltage",
+  "PEVMinVoltage",  "PEVPubKey",  "PEVStatus",  "PaymentDetailsReq",  "PaymentDetailsReqType",
+  "PaymentDetailsRes",  "PaymentDetailsResType",  "PowerDeliveryReq",  "PowerDeliveryReqType",  "PowerDeliveryRes",
+  "PowerDeliveryResType",  "PowerDiscoveryReq",  "PowerDiscoveryReqType",  "PowerDiscoveryRes",  "PowerDiscoveryResType",
+  "ReqLockStatus",  "ReqSwitchStatus",  "ResponseCode",  "ServiceDiscoveryReq",  "ServiceDiscoveryReqType",
+  "ServiceDiscoveryRes",  "ServiceDiscoveryResType",  "ServiceList",  "ServicePaymentSelectionReq",  "ServicePaymentSelectionReqType",
+  "ServicePaymentSelectionRes",  "ServicePaymentSelectionResType",  "ServiceScope",  "ServiceType",  "SessionSetupReq",
+  "SessionSetupReqType",  "SessionSetupRes",  "SessionSetupResType",  "TCurrent",  "Tariff",
+  "TariffTable"
 };
 /* localName entries for URI id = 5 */
 const char * localNames5[] = {
   "ChargerStandby",  "ChargingProfileEntryMaxPower",  "ChargingProfileEntryStart",  "ChargingProfileType",  "ConnectorLocked",
-  "Currency",  "EPrice",  "EVSEMalfunction",  "EVSEStandby",  "EVSEStatusType",
-  "Event",  "EventList",  "EventListType",  "FatalError",  "FaultCode",
-  "FaultMsg",  "FloatingValueType",  "MeterID",  "MeterInfoType",  "MeterReading",
-  "MeterStatus",  "Multiplier",  "NotificationType",  "PEVStatusType",  "PowerSwitchClosed",
-  "ProtocolVersion",  "RCD",  "ReadyToCharge",  "Service",  "ServiceDescriptionType",
-  "ServiceID",  "ServiceListType",  "ServiceName",  "ServiceScope",  "ServiceSessionID",
-  "ServiceType",  "SessionID",  "SessionInformationType",  "ShutDownTime",  "StopCharging",
-  "TMeter",  "Tariff",  "TariffDescrType",  "TariffDescription",  "TariffEntries",
-  "TariffEntriesType",  "TariffEntry",  "TariffEntryType",  "TariffID",  "TariffPMax",
-  "TariffStart",  "TariffTableType",  "Unit",  "Value",  "chargingModeType",
-  "contractIDType",  "currencyType",  "energyProviderType",  "eventEntryType",  "evseIDType",
-  "fatalErrorType",  "faultCodeType",  "lockStatusType",  "maxPhasesType",  "meterIDType",
-  "meterStatusType",  "paymentOptionListType",  "paymentOptionType",  "pevIDType",  "protocolVersionType",
-  "pubKeyType",  "rcdType",  "responseCode_CableCheckType",  "responseCode_ChargeParameterDiscoveryType",  "responseCode_CurrentDemandType",
-  "responseCode_LineLockType",  "responseCode_MeteringReceiptType",  "responseCode_MeteringStatusType",  "responseCode_PaymentDetailsType",  "responseCode_PowerDeliveryType",
-  "responseCode_PreChargeType",  "responseCode_ServiceDiscoveryType",  "responseCode_ServicePaymentSelectionType",  "responseCode_SessionSetupType",  "responseCode_TerminateChargingType",
-  "responseCode_WeldingDetectionType",  "serviceDetailsType",  "serviceIDType",  "serviceNameType",  "serviceScopeType",
-  "serviceTypeType",  "sessionIDType",  "standbyType",  "switchStatusType",  "tariffDescriptionType",
-  "tariffIDType",  "tariffStartType",  "timeType",  "unitMultiplierType",  "unitSymbolType"
-
+  "Currency",  "EPrice",  "EVSEStandby",  "EVSEStatusType",  "Event",
+  "EventList",  "EventListType",  "FatalError",  "FaultCode",  "FaultMsg",
+  "FloatingValueType",  "MeterID",  "MeterInfoType",  "MeterReading",  "MeterStatus",
+  "Multiplier",  "NotificationType",  "PEVStatusType",  "PowerSwitchClosed",  "ProtocolVersion",
+  "RCD",  "Service",  "ServiceDescriptionType",  "ServiceID",  "ServiceListType",
+  "ServiceName",  "ServiceScope",  "ServiceSessionID",  "ServiceType",  "SessionID",
+  "SessionInformationType",  "ShutDownTime",  "TMeter",  "Tariff",  "TariffDescrType",
+  "TariffDescription",  "TariffEntries",  "TariffEntriesType",  "TariffEntry",  "TariffEntryType",
+  "TariffID",  "TariffPMax",  "TariffStart",  "TariffTableType",  "Unit",
+  "Value",  "contractIDType",  "currencyType",  "energyProviderType",  "eventEntryType",
+  "evseIDType",  "fatalErrorType",  "faultCodeType",  "lockStatusType",  "maxPhasesType",
+  "meterIDType",  "meterStatusType",  "paymentOptionListType",  "paymentOptionType",  "pevIDType",
+  "protocolVersionType",  "pubKeyType",  "rcdType",  "responseCode_LineLockType",  "responseCode_MeteringReceiptType",
+  "responseCode_MeteringStatusType",  "responseCode_PaymentDetailsType",  "responseCode_PowerDeliveryType",  "responseCode_PowerDiscoveryType",  "responseCode_ServiceDiscoveryType",
+  "responseCode_ServicePaymentSelectionType",  "responseCode_SessionSetupType",  "serviceDetailsType",  "serviceIDType",  "serviceNameType",
+  "serviceScopeType",  "serviceTypeType",  "sessionIDType",  "standbyType",  "switchStatusType",
+  "tariffDescriptionType",  "tariffIDType",  "tariffStartType",  "timeType",  "unitMultiplierType",
+  "unitSymbolType"
 };
 /* localName entries for URI id = 6 */
 const char * localNames6[] = {
   "Body",  "BodyBaseType",  "BodyElement",  "BodyType",  "Header",
-  "V2G_Message"
-};
-/* localName entries for URI id = 7 */
-const char * localNames7[] = {
-  "HeaderType",  "Notification",  "SessionInformation"
+  "HeaderType",  "Notification",  "SessionInformation",  "V2G_Message"
 };
-struct exiPartition localNamePartitions[8] = {
+struct exiPartition localNamePartitions[7] = {
  { 0, localNames0 },
  { 4, localNames1 },
  { 2, localNames2 },
  { 46, localNames3 },
- { 94, localNames4 },
- { 100, localNames5 },
- { 6, localNames6 },
- { 3, localNames7 }
+ { 66, localNames4 },
+ { 91, localNames5 },
+ { 9, localNames6 }
 };
 const char * uris[] = {
-  "",  "http://www.w3.org/XML/1998/namespace",  "http://www.w3.org/2001/XMLSchema-instance",  "http://www.w3.org/2001/XMLSchema",  "urn:iso:15118:2:2010:eval1.0:MsgBody",  "urn:iso:15118:2:2010:eval1.0:MsgDataTypes",  "urn:iso:15118:2:2010:eval1.0:MsgDef",  "urn:iso:15118:2:2010:eval1.0:MsgHeader"
+  "",  "http://www.w3.org/XML/1998/namespace",  "http://www.w3.org/2001/XMLSchema-instance",  "http://www.w3.org/2001/XMLSchema",  "urn:iso:15118:2:2010:MsgBody",  "urn:iso:15118:2:2010:MsgDataTypes",  "urn:iso:15118:2:2010:MsgDef"
 };
-struct exiStringTable stringTable = { 8, uris, localNamePartitions };
+struct exiStringTable stringTable = { 7, uris, localNamePartitions };
 
 
 

+ 4 - 4
src/codec/StringTableEntries.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -36,14 +36,14 @@
 
 struct exiPartition {
 	/* length of array */
-	uint16_t len;
+	size_t len;
 	/* array of string entries */
 	const char** entries;
 };
 
 struct exiStringTable {
 	/* length of both arrays (uris & localNames) */
-	uint16_t len;
+	size_t len;
 	/* URI entries*/
 	const char** uris;
 	/* localName entries divided by URI */

+ 2 - 2
src/codec/UCSString.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

+ 2 - 2
src/codec/UCSString.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

+ 79 - 79
src/service/v2g_service.h

@@ -1,79 +1,79 @@
-/*
- * Copyright (C) 2007-2011 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 Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.2
- * @contact Joerg.Heuer@siemens.com
- *
- ********************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef EXI_SERVICE_H_
-#define EXI_SERVICE_H_
-
-#include "v2g_serviceDataTypes.h"
-#include "EXITypes.h"
-
-struct uniqueIDPath
-{
-	int id[10];
-	size_t pos;
-};
-
-
-struct EXIService
-{
-	/* in-/ out-stream */
-	bitstream_t inStream;
-	bitstream_t outStream;
-
-	/* EXI */
-	exi_state_t stateDecode;
-	exi_state_t stateEncode;
-	exi_event_t event;
-	eqname_t eqn;
-	exi_value_t val;
-
-	/* v2g message data structure */
-	struct EXIDocumentType exiMsg;
-
-	/* unique id for ambiguous elements */
-	struct uniqueIDPath idPath;
-
-	/* error code */
-	uint8_t errorCode;
-
-	/* offset for transport header data */
-	uint16_t transportHeaderOffset;
-};
-
-/* define error codes (TODO: define precise error codes) */
-#define EXI_NON_VALID_MESSAGE 0x01
-#define EXI_SERIALIZATION_FAILED 0x02
-
-#define EXI_UNKNOWN_ERROR 0xFF
-
-#endif /* EXI_SERVICE_H_ */
-
-#ifdef __cplusplus
-}
-#endif
+/*
+ * Copyright (C) 2007-2010 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 Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.3
+ * @contact Joerg.Heuer@siemens.com
+ *
+ ********************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef V2G_SERVICE_H_
+#define V2G_SERVICE_H_
+
+#include "v2g_serviceDataTypes.h"
+#include "EXITypes.h"
+
+struct uniqueIDPath
+{
+	int id[10];
+	size_t pos;
+};
+
+
+struct v2gService
+{
+	/* in-/ out-stream */
+	bitstream_t inStream;
+	bitstream_t outStream;
+
+	/* EXI */
+	exi_state_t stateDecode;
+	exi_state_t stateEncode;
+	exi_event_t event;
+	eqname_t eqn;
+	exi_value_t val;
+
+	/* v2g message data structure */
+	struct AnonType_V2G_Message v2gMsg;
+
+	/* unique id for ambiguous elements */
+	struct uniqueIDPath idPath;
+
+	/* error code */
+	uint8_t errorCode;
+
+	/* offset for transport header data */
+	uint16_t transportHeaderOffset;
+};
+
+/* define error codes (TODO: define precise error codes) */
+#define V2G_NON_VALID_MESSAGE 0x01
+#define V2G_SERIALIZATION_FAILED 0x02
+
+#define V2G_UNKNOWN_ERROR 0xFF
+
+#endif /* V2G_SERVICE_H_ */
+
+#ifdef __cplusplus
+}
+#endif

+ 44 - 44
src/service/v2g_serviceClientDataTransmitter.h

@@ -1,44 +1,44 @@
-
-/*
- * Copyright (C) 2007-2011 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 Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.2
- * @contact Joerg.Heuer@siemens.com
- *
- ********************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef V2G_SERVICECLIENTDATATRANSMITTER_H_
-#define V2G_SERVICECLIENTDATATRANSMITTER_H_
-
-#include "EXITypes.h"
-
-/* This method has to be implemented!
- * This method sends EXI stream (outStream) to the EVSE and receives response stream (inStream)*/
-int serviceDataTransmitter(uint8_t* outStream, uint16_t outStreamLength, uint8_t* inStream);
-
-#endif /* V2G_SERVICECLIENTDATATRANSMITTER_H_ */
-
-#ifdef __cplusplus
-}
-#endif
+
+/*
+ * Copyright (C) 2007-2010 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 Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.3
+ * @contact Joerg.Heuer@siemens.com
+ *
+ ********************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef V2G_SERVICECLIENTDATATRANSMITTER_H_
+#define V2G_SERVICECLIENTDATATRANSMITTER_H_
+
+#include "EXITypes.h"
+
+/* This method has to be implemented!
+ * This method sends EXI stream (outStream) to the EVSE and receives response stream (inStream)*/
+int serviceDataTransmitter(uint8_t* outStream, size_t outStreamLength, uint8_t* inStream);
+
+#endif /* V2G_SERVICECLIENTDATATRANSMITTER_H_ */
+
+#ifdef __cplusplus
+}
+#endif

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 635 - 1507
src/service/v2g_serviceClientStubs.c


+ 22 - 135
src/service/v2g_serviceClientStubs.h

@@ -3,7 +3,7 @@
 
 
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -22,7 +22,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.3.2
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -40,176 +40,63 @@ extern "C" {
  #include "v2g_serviceDataTypes.h"
  #include "v2g_serviceClientStubs.h"
  
-/**  
- * \brief   Calls the remote sessionSetup method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct SessionSetupReqType* Request data for the server (has to be set up before)
- * \param	result   struct SessionSetupResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_sessionSetup(struct EXIService* service, struct HeaderType* header, struct SessionSetupReqType* params, struct SessionSetupResType* result);
+	/* call sessionSetup  */
+	int call_sessionSetup(struct v2gService* service, struct HeaderType* header, struct SessionSetupReqType* params, struct SessionSetupResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote serviceDiscovery method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct ServiceDiscoveryReqType* Request data for the server (has to be set up before)
- * \param	result   struct ServiceDiscoveryResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_serviceDiscovery(struct EXIService* service, struct HeaderType* header, struct ServiceDiscoveryReqType* params, struct ServiceDiscoveryResType* result);
+	/* call serviceDiscovery  */
+	int call_serviceDiscovery(struct v2gService* service, struct HeaderType* header, struct ServiceDiscoveryReqType* params, struct ServiceDiscoveryResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote selectedServicePayment method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct ServicePaymentSelectionReqType* Request data for the server (has to be set up before)
- * \param	result   struct ServicePaymentSelectionResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_selectedServicePayment(struct EXIService* service, struct HeaderType* header, struct ServicePaymentSelectionReqType* params, struct ServicePaymentSelectionResType* result);
+	/* call selectedServicePayment  */
+	int call_selectedServicePayment(struct v2gService* service, struct HeaderType* header, struct ServicePaymentSelectionReqType* params, struct ServicePaymentSelectionResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote paymentDetails method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct PaymentDetailsReqType* Request data for the server (has to be set up before)
- * \param	result   struct PaymentDetailsResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_paymentDetails(struct EXIService* service, struct HeaderType* header, struct PaymentDetailsReqType* params, struct PaymentDetailsResType* result);
+	/* call paymentDetails  */
+	int call_paymentDetails(struct v2gService* service, struct HeaderType* header, struct PaymentDetailsReqType* params, struct PaymentDetailsResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote chargeParameterDiscovery method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct ChargeParameterDiscoveryReqType* Request data for the server (has to be set up before)
- * \param	result   struct ChargeParameterDiscoveryResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_chargeParameterDiscovery(struct EXIService* service, struct HeaderType* header, struct ChargeParameterDiscoveryReqType* params, struct ChargeParameterDiscoveryResType* result);
+	/* call powerDiscovery  */
+	int call_powerDiscovery(struct v2gService* service, struct HeaderType* header, struct PowerDiscoveryReqType* params, struct PowerDiscoveryResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote lineLock method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct LineLockReqType* Request data for the server (has to be set up before)
- * \param	result   struct LineLockResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_lineLock(struct EXIService* service, struct HeaderType* header, struct LineLockReqType* params, struct LineLockResType* result);
+	/* call lineLock  */
+	int call_lineLock(struct v2gService* service, struct HeaderType* header, struct LineLockReqType* params, struct LineLockResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote powerDelivery method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct PowerDeliveryReqType* Request data for the server (has to be set up before)
- * \param	result   struct PowerDeliveryResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_powerDelivery(struct EXIService* service, struct HeaderType* header, struct PowerDeliveryReqType* params, struct PowerDeliveryResType* result);
+	/* call powerDelivery  */
+	int call_powerDelivery(struct v2gService* service, struct HeaderType* header, struct PowerDeliveryReqType* params, struct PowerDeliveryResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote meteringStatus method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
-  * \param	result   struct MeteringStatusResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_meteringStatus(struct EXIService* service, struct HeaderType* header, struct MeteringStatusResType* result);
+	/* call meteringStatus  */
+	int call_meteringStatus(struct v2gService* service, struct HeaderType* header, struct MeteringStatusResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote meteringReceipt method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct MeteringReceiptReqType* Request data for the server (has to be set up before)
- * \param	result   struct MeteringReceiptResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_meteringReceipt(struct EXIService* service, struct HeaderType* header, struct MeteringReceiptReqType* params, struct MeteringReceiptResType* result);
+	/* call meteringReceipt  */
+	int call_meteringReceipt(struct v2gService* service, struct HeaderType* header, struct MeteringReceiptReqType* params, struct MeteringReceiptResType* result);
 
  
 
 	
-/**  
- * \brief   Calls the remote cableCheck method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct CableCheckReqType* Request data for the server (has to be set up before)
- * \param	result   struct CableCheckResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_cableCheck(struct EXIService* service, struct HeaderType* header, struct CableCheckReqType* params, struct CableCheckResType* result);
 
- 
-
-	
-/**  
- * \brief   Calls the remote preCharge method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct PreChargeReqType* Request data for the server (has to be set up before)
- * \param	result   struct PreChargeResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_preCharge(struct EXIService* service, struct HeaderType* header, struct PreChargeReqType* params, struct PreChargeResType* result);
-
- 
-
-	
-/**  
- * \brief   Calls the remote currentDemand method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct CurrentDemandReqType* Request data for the server (has to be set up before)
- * \param	result   struct CurrentDemandResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_currentDemand(struct EXIService* service, struct HeaderType* header, struct CurrentDemandReqType* params, struct CurrentDemandResType* result);
-
- 
-
-	
-/**  
- * \brief   Calls the remote weldingDetection method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct WeldingDetectionReqType* Request data for the server (has to be set up before)
- * \param	result   struct WeldingDetectionResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_weldingDetection(struct EXIService* service, struct HeaderType* header, struct WeldingDetectionReqType* params, struct WeldingDetectionResType* result);
-
- 
-
-	
-/**  
- * \brief   Calls the remote terminateCharging method
- * \param	service  struct EXIService* Service data structure (has to be initialized before)
- * \param	header   struct HeaderType* Header data structure
- * \param	params   struct TerminateChargingReqType* Request data for the server (has to be set up before)
- * \param	result   struct TerminateChargingResType* Contains the response data from the server 
- * \return  0 = 0K; -1 = ERROR */
-	int call_terminateCharging(struct EXIService* service, struct HeaderType* header, struct TerminateChargingReqType* params, struct TerminateChargingResType* result);
-
- 
-
-	
-
-	/* Initialize the v2g client */
-	int init_v2gServiceClient(struct EXIService* service, bytes_t bytes, string_ucs_t string, uint8_t* inStream, size_t max_inStream_size, uint8_t* outStream, size_t max_outStream_size, uint16_t transportHeaderOffset);
+/* Initialize the v2g client */
+int init_v2gServiceClient(struct v2gService* service, bytes_t bytes, string_ucs_t string, uint8_t* inStream, size_t max_inStream_size, uint8_t* outStream, size_t max_outStream_size, uint16_t transportHeaderOffset);
  
 #endif
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 300 - 229
src/service/v2g_serviceDataSerialization.c


+ 42 - 0
src/service/v2g_serviceDataSerializiation.h

@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2007-2010 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 Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.3
+ * @contact Joerg.Heuer@siemens.com
+ *
+ ********************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef V2GSERVICEDATASERIAL_H_
+#define V2GSERVICEDATASERIAL_H_
+
+#include "v2g_service.h"
+
+int serialize_message(struct v2gService* service);
+
+
+#endif /* V2GSERVICEDATASERIAL_H_ */
+
+#ifdef __cplusplus
+}
+#endif

+ 118 - 124
src/service/v2g_serviceDataTypes.c

@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -19,7 +19,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.3.2
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -29,13 +29,19 @@
 #include "v2g_serviceDataTypes.h"
 
 
-static  void init_sessionIDType(struct sessionIDType* type)
+static  void init_SessionInformationType_SessionID(struct SessionInformationType_SessionID* type)
 {	
 	type->arraylen.data=0;
 
 }
 
-static  void init_protocolVersionType(struct protocolVersionType* type)
+static  void init_SessionInformationType_ServiceSessionID(struct SessionInformationType_ServiceSessionID* type)
+{	
+	type->arraylen.data=0;
+
+}
+
+static  void init_SessionInformationType_ProtocolVersion(struct SessionInformationType_ProtocolVersion* type)
 {	
 	type->arraylen.data=0;
 
@@ -43,15 +49,15 @@ static  void init_protocolVersionType(struct protocolVersionType* type)
 
 static  void init_SessionInformationType(struct SessionInformationType* type)
 {	
-	init_sessionIDType(&(type->SessionID));	
-	init_sessionIDType(&(type->ServiceSessionID));	
+	init_SessionInformationType_SessionID(&(type->SessionID));	
+	init_SessionInformationType_ServiceSessionID(&(type->ServiceSessionID));	
 	type->isused.ServiceSessionID=0;	
-	init_protocolVersionType(&(type->ProtocolVersion));	
+	init_SessionInformationType_ProtocolVersion(&(type->ProtocolVersion));	
 	type->isused.ProtocolVersion=0;
 
 }
 
-static  void init_service_string(struct service_string* type)
+static  void init_NotificationType_FaultMsg(struct NotificationType_FaultMsg* type)
 {	
 	type->arraylen.data=0;
 
@@ -60,7 +66,7 @@ static  void init_service_string(struct service_string* type)
 static  void init_NotificationType(struct NotificationType* type)
 {		
 	type->isused.FaultCode=0;	
-	init_service_string(&(type->FaultMsg));	
+	init_NotificationType_FaultMsg(&(type->FaultMsg));	
 	type->isused.FaultMsg=0;		
 	type->isused.EventList=0;
 
@@ -74,7 +80,7 @@ static  void init_HeaderType(struct HeaderType* type)
 
 }
 
-static  void init_pevIDType(struct pevIDType* type)
+static  void init_SessionSetupReqType_PEVID(struct SessionSetupReqType_PEVID* type)
 {	
 	type->arraylen.data=0;
 
@@ -82,12 +88,12 @@ static  void init_pevIDType(struct pevIDType* type)
 
 static  void init_SessionSetupReqType(struct SessionSetupReqType* type)
 {	
-	init_pevIDType(&(type->PEVID));	
+	init_SessionSetupReqType_PEVID(&(type->PEVID));	
 	type->isused.PEVID=0;	
 
 }
 
-static  void init_evseIDType(struct evseIDType* type)
+static  void init_SessionSetupResType_EVSEID(struct SessionSetupResType_EVSEID* type)
 {	
 	type->arraylen.data=0;
 
@@ -95,11 +101,11 @@ static  void init_evseIDType(struct evseIDType* type)
 
 static  void init_SessionSetupResType(struct SessionSetupResType* type)
 {		
-	init_evseIDType(&(type->EVSEID));		
+	init_SessionSetupResType_EVSEID(&(type->EVSEID));		
 
 }
 
-static  void init_serviceScopeType(struct serviceScopeType* type)
+static  void init_ServiceDiscoveryReqType_ServiceScope(struct ServiceDiscoveryReqType_ServiceScope* type)
 {	
 	type->arraylen.data=0;
 
@@ -108,18 +114,24 @@ static  void init_serviceScopeType(struct serviceScopeType* type)
 static  void init_ServiceDiscoveryReqType(struct ServiceDiscoveryReqType* type)
 {		
 	type->isused.ServiceType=0;	
-	init_serviceScopeType(&(type->ServiceScope));	
+	init_ServiceDiscoveryReqType_ServiceScope(&(type->ServiceScope));	
 	type->isused.ServiceScope=0;
 
 }
 
-static  void init_serviceIDType(struct serviceIDType* type)
+static  void init_ServiceDescriptionType_ServiceID(struct ServiceDescriptionType_ServiceID* type)
 {	
 	type->arraylen.data=0;
 
 }
 
-static  void init_serviceNameType(struct serviceNameType* type)
+static  void init_ServiceDescriptionType_ServiceName(struct ServiceDescriptionType_ServiceName* type)
+{	
+	type->arraylen.data=0;
+
+}
+
+static  void init_ServiceDescriptionType_ServiceScope(struct ServiceDescriptionType_ServiceScope* type)
 {	
 	type->arraylen.data=0;
 
@@ -127,11 +139,11 @@ static  void init_serviceNameType(struct serviceNameType* type)
 
 static  void init_ServiceDescriptionType(struct ServiceDescriptionType* type)
 {	
-	init_serviceIDType(&(type->ServiceID));	
-	init_serviceNameType(&(type->ServiceName));	
+	init_ServiceDescriptionType_ServiceID(&(type->ServiceID));	
+	init_ServiceDescriptionType_ServiceName(&(type->ServiceName));	
 	type->isused.ServiceName=0;		
 	type->isused.ServiceType=0;	
-	init_serviceScopeType(&(type->ServiceScope));	
+	init_ServiceDescriptionType_ServiceScope(&(type->ServiceScope));	
 	type->isused.ServiceScope=0;
 
 }
@@ -156,13 +168,33 @@ static  void init_ServiceDiscoveryResType(struct ServiceDiscoveryResType* type)
 
 }
 
+static  void init_ServicePaymentSelectionReqType_PEVPubKey(struct ServicePaymentSelectionReqType_PEVPubKey* type)
+{	
+	type->arraylen.data=0;
+
+}
+
 static  void init_ServicePaymentSelectionReqType(struct ServicePaymentSelectionReqType* type)
 {	
-	init_ServiceListType(&(type->ServiceList));
+	init_ServiceListType(&(type->ServiceList));	
+	init_ServicePaymentSelectionReqType_PEVPubKey(&(type->PEVPubKey));
 
 }
 
-static  void init_contractIDType(struct contractIDType* type)
+static  void init_ServicePaymentSelectionResType_MeteringAuthPubKey(struct ServicePaymentSelectionResType_MeteringAuthPubKey* type)
+{	
+	type->arraylen.data=0;
+
+}
+
+static  void init_ServicePaymentSelectionResType(struct ServicePaymentSelectionResType* type)
+{		
+	init_ServicePaymentSelectionResType_MeteringAuthPubKey(&(type->MeteringAuthPubKey));	
+	type->isused.MeteringAuthPubKey=0;
+
+}
+
+static  void init_PaymentDetailsReqType_ContractID(struct PaymentDetailsReqType_ContractID* type)
 {	
 	type->arraylen.data=0;
 
@@ -170,28 +202,28 @@ static  void init_contractIDType(struct contractIDType* type)
 
 static  void init_PaymentDetailsReqType(struct PaymentDetailsReqType* type)
 {	
-	init_contractIDType(&(type->ContractID));
+	init_PaymentDetailsReqType_ContractID(&(type->ContractID));
 
 }
 
-static  void init_ChargeParameterDiscoveryReqType(struct ChargeParameterDiscoveryReqType* type)
-{										
+static  void init_PowerDiscoveryReqType(struct PowerDiscoveryReqType* type)
+{							
 
 }
 
-static  void init_energyProviderType(struct energyProviderType* type)
+static  void init_PowerDiscoveryResType_EnergyProvider(struct PowerDiscoveryResType_EnergyProvider* type)
 {	
 	type->arraylen.data=0;
 
 }
 
-static  void init_currencyType(struct currencyType* type)
+static  void init_TariffTableType_Currency(struct TariffTableType_Currency* type)
 {	
 	type->arraylen.data=0;
 
 }
 
-static  void init_tariffDescriptionType(struct tariffDescriptionType* type)
+static  void init_TariffDescrType_TariffDescription(struct TariffDescrType_TariffDescription* type)
 {	
 	type->arraylen.data=0;
 
@@ -218,7 +250,7 @@ static  void init_TariffEntriesType(struct TariffEntriesType* type)
 
 static  void init_TariffDescrType(struct TariffDescrType* type)
 {		
-	init_tariffDescriptionType(&(type->TariffDescription));	
+	init_TariffDescrType_TariffDescription(&(type->TariffDescription));	
 	type->isused.TariffDescription=0;	
 	init_TariffEntriesType(&(type->TariffEntries));
 
@@ -228,7 +260,7 @@ static  void init_TariffTableType(struct TariffTableType* type)
 {
 	int i_loop;
 		
-	init_currencyType(&(type->Currency));	
+	init_TariffTableType_Currency(&(type->Currency));	
 	for(i_loop=0; i_loop<6;i_loop++)
 	{
 		init_TariffDescrType(&(type->Tariff[i_loop]));
@@ -238,9 +270,9 @@ static  void init_TariffTableType(struct TariffTableType* type)
 
 }
 
-static  void init_ChargeParameterDiscoveryResType(struct ChargeParameterDiscoveryResType* type)
-{								
-	init_energyProviderType(&(type->EnergyProvider));	
+static  void init_PowerDiscoveryResType(struct PowerDiscoveryResType* type)
+{						
+	init_PowerDiscoveryResType_EnergyProvider(&(type->EnergyProvider));	
 	type->isused.EnergyProvider=0;	
 	init_TariffTableType(&(type->TariffTable));	
 	type->isused.TariffTable=0;
@@ -257,18 +289,26 @@ static  void init_LineLockResType(struct LineLockResType* type)
 
 }
 
+static  void init_ChargingProfileType(struct ChargingProfileType* type)
+{		
+
+}
+
 static  void init_PowerDeliveryReqType(struct PowerDeliveryReqType* type)
 {				
-	type->isused.Tariff=0;
+	type->isused.Tariff=0;	
+	init_ChargingProfileType(&(type->ChargingProfile));	
+	type->isused.ChargingProfile=0;
 
 }
 
-static  void init_PowerDeliveryResType(struct PowerDeliveryResType* type)
-{		
+static  void init_MeteringStatusResType_EVSEID(struct MeteringStatusResType_EVSEID* type)
+{	
+	type->arraylen.data=0;
 
 }
 
-static  void init_meterIDType(struct meterIDType* type)
+static  void init_MeterInfoType_MeterID(struct MeterInfoType_MeterID* type)
 {	
 	type->arraylen.data=0;
 
@@ -276,7 +316,7 @@ static  void init_meterIDType(struct meterIDType* type)
 
 static  void init_MeterInfoType(struct MeterInfoType* type)
 {	
-	init_meterIDType(&(type->MeterID));	
+	init_MeterInfoType_MeterID(&(type->MeterID));	
 	type->isused.MeterID=0;		
 	type->isused.MeterReading=0;		
 	type->isused.MeterStatus=0;		
@@ -286,113 +326,67 @@ static  void init_MeterInfoType(struct MeterInfoType* type)
 
 static  void init_MeteringStatusResType(struct MeteringStatusResType* type)
 {		
-	init_evseIDType(&(type->EVSEID));					
+	init_MeteringStatusResType_EVSEID(&(type->EVSEID));					
 	type->isused.PCurrent=0;	
 	init_MeterInfoType(&(type->MeterInfo));	
 	type->isused.MeterInfo=0;
 
 }
 
-static  void init_MeteringReceiptReqType(struct MeteringReceiptReqType* type)
-{	
-	init_pevIDType(&(type->PEVID));	
-	type->isused.PEVID=0;			
-	type->isused.TCurrent=0;		
-	init_MeterInfoType(&(type->MeterInfo));
-
-}
-
-static  void init_CableCheckReqType(struct CableCheckReqType* type)
-{	
-
-}
-
-static  void init_CableCheckResType(struct CableCheckResType* type)
-{		
-
-}
-
-static  void init_PreChargeReqType(struct PreChargeReqType* type)
-{				
-
-}
-
-static  void init_PreChargeResType(struct PreChargeResType* type)
-{			
-
-}
-
-static  void init_CurrentDemandReqType(struct CurrentDemandReqType* type)
-{					
-
-}
-
-static  void init_CurrentDemandResType(struct CurrentDemandResType* type)
-{				
-
-}
-
-static  void init_WeldingDetectionReqType(struct WeldingDetectionReqType* type)
+static  void init_MeteringReceiptReqType_PEVID(struct MeteringReceiptReqType_PEVID* type)
 {	
+	type->arraylen.data=0;
 
 }
 
-static  void init_WeldingDetectionResType(struct WeldingDetectionResType* type)
-{			
-
-}
-
-static  void init_TerminateChargingReqType(struct TerminateChargingReqType* type)
+static  void init_MeteringReceiptReqType(struct MeteringReceiptReqType* type)
 {	
-
-}
-
-static  void init_TerminateChargingResType(struct TerminateChargingResType* type)
-{			
+	init_MeteringReceiptReqType_PEVID(&(type->PEVID));	
+	type->isused.PEVID=0;			
+	type->isused.TCurrent=0;		
+	init_MeterInfoType(&(type->MeterInfo));
 
 }
 
 static  void init_BodyType(struct BodyType* type)
-{		
-	type->isused.SessionSetupReq=0;		
-	type->isused.SessionSetupRes=0;		
-	type->isused.ServiceDiscoveryReq=0;		
-	type->isused.ServiceDiscoveryRes=0;		
-	type->isused.ServicePaymentSelectionReq=0;		
-	type->isused.ServicePaymentSelectionRes=0;		
+{	
+	init_SessionSetupReqType(&(type->SessionSetupReq));	
+	type->isused.SessionSetupReq=0;	
+	init_SessionSetupResType(&(type->SessionSetupRes));	
+	type->isused.SessionSetupRes=0;	
+	init_ServiceDiscoveryReqType(&(type->ServiceDiscoveryReq));	
+	type->isused.ServiceDiscoveryReq=0;	
+	init_ServiceDiscoveryResType(&(type->ServiceDiscoveryRes));	
+	type->isused.ServiceDiscoveryRes=0;	
+	init_ServicePaymentSelectionReqType(&(type->ServicePaymentSelectionReq));	
+	type->isused.ServicePaymentSelectionReq=0;	
+	init_ServicePaymentSelectionResType(&(type->ServicePaymentSelectionRes));	
+	type->isused.ServicePaymentSelectionRes=0;	
+	init_PaymentDetailsReqType(&(type->PaymentDetailsReq));	
 	type->isused.PaymentDetailsReq=0;		
-	type->isused.PaymentDetailsRes=0;		
-	type->isused.ChargeParameterDiscoveryReq=0;		
-	type->isused.ChargeParameterDiscoveryRes=0;		
-	type->isused.LineLockReq=0;		
-	type->isused.LineLockRes=0;		
+	type->isused.PaymentDetailsRes=0;	
+	init_PowerDiscoveryReqType(&(type->PowerDiscoveryReq));	
+	type->isused.PowerDiscoveryReq=0;	
+	init_PowerDiscoveryResType(&(type->PowerDiscoveryRes));	
+	type->isused.PowerDiscoveryRes=0;	
+	init_LineLockReqType(&(type->LineLockReq));	
+	type->isused.LineLockReq=0;	
+	init_LineLockResType(&(type->LineLockRes));	
+	type->isused.LineLockRes=0;	
+	init_PowerDeliveryReqType(&(type->PowerDeliveryReq));	
 	type->isused.PowerDeliveryReq=0;		
 	type->isused.PowerDeliveryRes=0;		
-	type->isused.MeteringStatusReq=0;		
-	type->isused.MeteringStatusRes=0;		
+	type->isused.MeteringStatusReq=0;	
+	init_MeteringStatusResType(&(type->MeteringStatusRes));	
+	type->isused.MeteringStatusRes=0;	
+	init_MeteringReceiptReqType(&(type->MeteringReceiptReq));	
 	type->isused.MeteringReceiptReq=0;		
-	type->isused.MeteringReceiptRes=0;		
-	type->isused.CableCheckReq=0;		
-	type->isused.CableCheckRes=0;		
-	type->isused.PreChargeReq=0;		
-	type->isused.PreChargeRes=0;		
-	type->isused.CurrentDemandReq=0;		
-	type->isused.CurrentDemandRes=0;		
-	type->isused.WeldingDetectionReq=0;		
-	type->isused.WeldingDetectionRes=0;		
-	type->isused.TerminateChargingReq=0;		
-	type->isused.TerminateChargingRes=0;
-
-}
-
-static  void init_AnonType_V2G_Message(struct AnonType_V2G_Message* type)
-{		
-	init_BodyType(&(type->Body));
+	type->isused.MeteringReceiptRes=0;
 
 }
-
-static  void init_EXIDocumentType(struct EXIDocumentType* type)
+ void init_AnonType_V2G_Message(struct AnonType_V2G_Message* type)
 {	
-	init_AnonType_V2G_Message(&(type->V2G_Message));
+	init_HeaderType(&(type->Header));	
+	init_BodyType(&(type->Body));
 
 }

+ 282 - 319
src/service/v2g_serviceDataTypes.h

@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -19,7 +19,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.3.2
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -40,201 +40,195 @@ extern "C" {
 
 enum faultCodeType
 {
-	ParsingError_faultCodeType, 
-	V2GProtocolVersionNotSupported_faultCodeType, 
-	UnknownError_faultCodeType
+	ParsingError, 
+	V2GProtocolVersionNotSupported, 
+	UnknownError
 
 }; 
 
 enum eventEntryType
 {
-	InitiateSessionSetup_eventEntryType, 
-	InitiateServiceDiscovery_eventEntryType, 
-	InitiatePowerDiscovery_eventEntryType, 
-	InitiateLineLock_eventEntryType, 
-	InitiatePowerDelivery_eventEntryType, 
-	InitiateInitiateMeteringStatus_eventEntryType
+	InitiateSessionSetup, 
+	InitiateServiceDiscovery, 
+	InitiatePowerDiscovery, 
+	InitiateLineLock, 
+	InitiatePowerDelivery, 
+	InitiateInitiateMeteringStatus
 
 }; 
 
 enum responseCode_SessionSetupType
 {
-	OK_SessionSetup_responseCode_SessionSetupType, 
-	OK_NewSessionEstablished_responseCode_SessionSetupType, 
-	OK_OldSessionJoined_responseCode_SessionSetupType, 
-	FAILED_UnknownSession_responseCode_SessionSetupType, 
-	FAILED_SessionEstablishmentError_responseCode_SessionSetupType, 
-	FAILED_UnknownError_InSessionSetup_responseCode_SessionSetupType
+	OK_SessionSetup, 
+	OK_NewSessionEstablished, 
+	OK_OldSessionJoined, 
+	FAILED_UnknownSession, 
+	FAILED_SessionEstablishmentError, 
+	FAILED_UnknownError_InSessionSetup
 
 }; 
 
 enum serviceTypeType
 {
-	PEV_Recharge_serviceTypeType, 
-	Remote_Customer_Support_serviceTypeType, 
-	Internet_serviceTypeType, 
-	Other_serviceTypeType
+	PEV_Recharge, 
+	Remote_Customer_Support, 
+	Internet, 
+	Other
 
 }; 
 
 enum responseCode_ServiceDiscoveryType
 {
-	OK_ServiceDiscovery_responseCode_ServiceDiscoveryType, 
-	FAILED_NoServicesOfThisType_responseCode_ServiceDiscoveryType, 
-	FAILED_NoServicesInThisScope_responseCode_ServiceDiscoveryType, 
-	FAILED_NoServicesOfThisTypeScope_responseCode_ServiceDiscoveryType, 
-	FAILED_NoServicesFound_responseCode_ServiceDiscoveryType, 
-	FAILED_UnknownError_InServiceDiscovery_responseCode_ServiceDiscoveryType
+	OK_ServiceDiscovery, 
+	FAILED_NoServicesOfThisType, 
+	FAILED_NoServicesInThisScope, 
+	FAILED_NoServicesOfThisTypeScope, 
+	FAILED_NoServicesFound, 
+	FAILED_UnknownError_InServiceDiscovery
 
 }; 
 
 enum responseCode_ServicePaymentSelectionType
 {
-	OK_ServicePaymentSelection_responseCode_ServicePaymentSelectionType, 
-	FAILED_ServiceSelectionInvalid_responseCode_ServicePaymentSelectionType, 
-	FAILED_PaymentSelectionInvalid_responseCode_ServicePaymentSelectionType, 
-	FAILED_UnknownError_InServicePaymentSelection_responseCode_ServicePaymentSelectionType
+	OK_ServicePaymentSelection, 
+	FAILED_ServiceSelectionInvalid, 
+	FAILED_PaymentSelectionInvalid, 
+	FAILED_UnknownError_InServicePaymentSelection
 
 }; 
 
 enum responseCode_PaymentDetailsType
 {
-	OK_PaymentDetails_responseCode_PaymentDetailsType, 
-	FAILED_PaymentDetailsInvalid_responseCode_PaymentDetailsType, 
-	FAILED_UnknownError_responseCode_PaymentDetailsType
+	OK_PaymentDetails, 
+	FAILED_PaymentDetailsInvalid, 
+	FAILED_UnknownError
 
 }; 
 
-enum chargingModeType
+enum unitMultiplierType
 {
-	AC_charging_chargingModeType, 
-	DC_charging_chargingModeType
+	d, 
+	c, 
+	m, 
+	micro, 
+	n, 
+	p, 
+	k, 
+	M, 
+	G, 
+	T, 
+	none
 
 }; 
 
 enum unitSymbolType
 {
-	A_unitSymbolType, 
-	deg_unitSymbolType, 
-	F_unitSymbolType, 
-	h_unitSymbolType, 
-	min_unitSymbolType, 
-	s_unitSymbolType, 
-	s_1_unitSymbolType, 
-	V_unitSymbolType, 
-	V_VAr_unitSymbolType, 
-	VA_unitSymbolType, 
-	VAh_unitSymbolType, 
-	VAr_unitSymbolType, 
-	VArh_unitSymbolType, 
-	W_unitSymbolType, 
-	W_Hz_unitSymbolType, 
-	W_s_unitSymbolType, 
-	Wh_unitSymbolType, 
-	Ah_unitSymbolType,
-	J_unitSymbolType
+	A, 
+	deg, 
+	F, 
+	g, 
+	h, 
+	J, 
+	J_s, 
+	kg_J, 
+	min, 
+	N, 
+	ohm, 
+	s, 
+	S, 
+	s_1, 
+	V, 
+	V_VAr, 
+	VA, 
+	VAh, 
+	VAr, 
+	VArh, 
+	W, 
+	W_Hz, 
+	W_s, 
+	Wh, 
+	Ah
+
 }; 
 
-enum responseCode_ChargeParameterDiscoveryType
+enum responseCode_PowerDiscoveryType
 {
-	OK_responseCode_ChargeParameterDiscoveryType, 
-	FAILED_BatteryNotCompatible_responseCode_ChargeParameterDiscoveryType, 
-	FAILED_UnknownError_responseCode_ChargeParameterDiscoveryType
+	OK_PowerDiscovery, 
+	FAILED_UnknownError_InPowerDiscovery
 
 }; 
 
 enum tariffIDType
 {
-	Standard_charge_tariffIDType, 
-	Fast_charge_tariffIDType, 
-	Green_charge_tariffIDType, 
-	Grid_friendly_charge_tariffIDType, 
-	Freely_parameterisable_charge_tariffIDType, 
-	Charge_under_reserve_tariffIDType
+	Standard_charge, 
+	Fast_charge, 
+	Green_charge, 
+	Grid_friendly_charge, 
+	Freely_parameterisable_charge, 
+	Charge_under_reserve
 
 }; 
 
 enum responseCode_LineLockType
 {
-	OK_LineLock_responseCode_LineLockType, 
-	FAILED_LineLockNotApplied_responseCode_LineLockType, 
-	FAILED_UnknownError_InLineLock_responseCode_LineLockType
+	OK_LineLock, 
+	FAILED_LineLockNotApplied, 
+	FAILED_UnknownError_InLineLock
 
 }; 
 
 enum responseCode_PowerDeliveryType
 {
-	OK_PowerDelivery_responseCode_PowerDeliveryType, 
-	FAILED_PowerDeliveryNotApplied_responseCode_PowerDeliveryType, 
-	FAILED_TariffSelectionInvalid_responseCode_PowerDeliveryType, 
-	FAILED_ChargingProfileInvalid_responseCode_PowerDeliveryType, 
-	FAILED_UnknownError_InPowerDelivery_responseCode_PowerDeliveryType
+	OK_PowerDelivery, 
+	FAILED_PowerDeliveryNotApplied, 
+	FAILED_TariffSelectionInvalid, 
+	FAILED_ChargingProfileInvalid, 
+	FAILED_UnknownError_InPowerDelivery
 
 }; 
 
 enum responseCode_MeteringStatusType
 {
-	OK_MeteringStatus_responseCode_MeteringStatusType, 
-	FAILED_UnknownError_InMeteringStatus_responseCode_MeteringStatusType
+	OK_MeteringStatus, 
+	FAILED_UnknownError_InMeteringStatus
 
 }; 
 
 enum responseCode_MeteringReceiptType
 {
-	OK_MeteringReceipt_responseCode_MeteringReceiptType, 
-	FAILED_UnknownError_MeteringReceipt_responseCode_MeteringReceiptType
+	OK_MeteringReceipt, 
+	FAILED_UnknownError_MeteringReceipt
 
 }; 
 
-enum responseCode_CableCheckType
-{
-	OK_responseCode_CableCheckType, 
-	FAILED_UnknownError_responseCode_CableCheckType
 
-}; 
-
-enum responseCode_PreChargeType
-{
-	OK_responseCode_PreChargeType, 
-	FAILED_UnknownError_responseCode_PreChargeType
 
-}; 
 
-enum responseCode_CurrentDemandType
+struct arraylen_SessionInformationType_SessionID
 {
-	OK_responseCode_CurrentDemandType, 
-	FAILED_UnknownError_responseCode_CurrentDemandType
-
-}; 
+	size_t data;
 
-enum responseCode_WeldingDetectionType
-{
-	OK_responseCode_WeldingDetectionType, 
-	FAILED_UnknownError_responseCode_WeldingDetectionType
 
-}; 
+};
 
-enum responseCode_TerminateChargingType
+struct SessionInformationType_SessionID
 {
-	OK_responseCode_TerminateChargingType, 
-	FAILED_UnknownError_responseCode_TerminateChargingType
-
-}; 
-
-
+	uint8_t data[8];
+	struct arraylen_SessionInformationType_SessionID arraylen;
 
+};
 
-struct arraylen_sessionIDType
+struct arraylen_SessionInformationType_ServiceSessionID
 {
 	size_t data;
 
 
 };
 
-struct sessionIDType
+struct SessionInformationType_ServiceSessionID
 {
 	uint8_t data[8];
-	struct arraylen_sessionIDType arraylen;
+	struct arraylen_SessionInformationType_ServiceSessionID arraylen;
 
 };
 
@@ -246,25 +240,25 @@ struct selection_SessionInformationType
 
 };
 
-struct arraylen_protocolVersionType
+struct arraylen_SessionInformationType_ProtocolVersion
 {
 	size_t data;
 
 
 };
 
-struct protocolVersionType
+struct SessionInformationType_ProtocolVersion
 {
-	uint32_t data[5];
-	struct arraylen_protocolVersionType arraylen;
+	uint32_t data[256];
+	struct arraylen_SessionInformationType_ProtocolVersion arraylen;
 
 };
 
 struct SessionInformationType
 {
-	struct sessionIDType SessionID;
-	struct sessionIDType ServiceSessionID;
-	struct protocolVersionType ProtocolVersion;
+	struct SessionInformationType_SessionID SessionID;
+	struct SessionInformationType_ServiceSessionID ServiceSessionID;
+	struct SessionInformationType_ProtocolVersion ProtocolVersion;
 	struct selection_SessionInformationType isused;
 
 };
@@ -278,17 +272,17 @@ struct selection_NotificationType
 
 };
 
-struct arraylen_service_string
+struct arraylen_NotificationType_FaultMsg
 {
 	size_t data;
 
 
 };
 
-struct service_string
+struct NotificationType_FaultMsg
 {
 	uint32_t data[256];
-	struct arraylen_service_string arraylen;
+	struct arraylen_NotificationType_FaultMsg arraylen;
 
 };
 
@@ -302,7 +296,7 @@ struct EventListType
 struct NotificationType
 {
 	enum faultCodeType FaultCode;
-	struct service_string FaultMsg;
+	struct NotificationType_FaultMsg FaultMsg;
 	struct EventListType EventList;
 	struct selection_NotificationType isused;
 
@@ -323,17 +317,17 @@ struct HeaderType
 
 };
 
-struct arraylen_pevIDType
+struct arraylen_SessionSetupReqType_PEVID
 {
 	size_t data;
 
 
 };
 
-struct pevIDType
+struct SessionSetupReqType_PEVID
 {
 	uint32_t data[32];
-	struct arraylen_pevIDType arraylen;
+	struct arraylen_SessionSetupReqType_PEVID arraylen;
 
 };
 
@@ -348,14 +342,13 @@ struct PEVStatusType
 {
 	int ConnectorLocked;
 	int ChargerStandby;
-	int ReadyToCharge;
 
 
 };
 
 struct SessionSetupReqType
 {
-	struct pevIDType PEVID;
+	struct SessionSetupReqType_PEVID PEVID;
 	struct PEVStatusType PEVStatus;
 	struct selection_SessionSetupReqType isused;
 
@@ -371,8 +364,8 @@ struct selection_BodyType
 	unsigned int ServicePaymentSelectionRes:1;
 	unsigned int PaymentDetailsReq:1;
 	unsigned int PaymentDetailsRes:1;
-	unsigned int ChargeParameterDiscoveryReq:1;
-	unsigned int ChargeParameterDiscoveryRes:1;
+	unsigned int PowerDiscoveryReq:1;
+	unsigned int PowerDiscoveryRes:1;
 	unsigned int LineLockReq:1;
 	unsigned int LineLockRes:1;
 	unsigned int PowerDeliveryReq:1;
@@ -381,31 +374,21 @@ struct selection_BodyType
 	unsigned int MeteringStatusRes:1;
 	unsigned int MeteringReceiptReq:1;
 	unsigned int MeteringReceiptRes:1;
-	unsigned int CableCheckReq:1;
-	unsigned int CableCheckRes:1;
-	unsigned int PreChargeReq:1;
-	unsigned int PreChargeRes:1;
-	unsigned int CurrentDemandReq:1;
-	unsigned int CurrentDemandRes:1;
-	unsigned int WeldingDetectionReq:1;
-	unsigned int WeldingDetectionRes:1;
-	unsigned int TerminateChargingReq:1;
-	unsigned int TerminateChargingRes:1;
 
 
 };
 
-struct arraylen_evseIDType
+struct arraylen_SessionSetupResType_EVSEID
 {
 	size_t data;
 
 
 };
 
-struct evseIDType
+struct SessionSetupResType_EVSEID
 {
 	uint8_t data[32];
-	struct arraylen_evseIDType arraylen;
+	struct arraylen_SessionSetupResType_EVSEID arraylen;
 
 };
 
@@ -417,9 +400,6 @@ struct EVSEStatusType
 	int PowerSwitchClosed;
 	int RCD;
 	int32_t ShutDownTime;
-	int ChargerStandby;
-	int EVSEMalfunction;
-	int StopCharging;
 
 
 };
@@ -427,7 +407,7 @@ struct EVSEStatusType
 struct SessionSetupResType
 {
 	enum responseCode_SessionSetupType ResponseCode;
-	struct evseIDType EVSEID;
+	struct SessionSetupResType_EVSEID EVSEID;
 	struct EVSEStatusType EVSEStatus;
 	int32_t TCurrent;
 
@@ -442,53 +422,53 @@ struct selection_ServiceDiscoveryReqType
 
 };
 
-struct arraylen_serviceScopeType
+struct arraylen_ServiceDiscoveryReqType_ServiceScope
 {
 	size_t data;
 
 
 };
 
-struct serviceScopeType
+struct ServiceDiscoveryReqType_ServiceScope
 {
-	uint32_t data[20];
-	struct arraylen_serviceScopeType arraylen;
+	uint32_t data[255];
+	struct arraylen_ServiceDiscoveryReqType_ServiceScope arraylen;
 
 };
 
 struct ServiceDiscoveryReqType
 {
 	enum serviceTypeType ServiceType;
-	struct serviceScopeType ServiceScope;
+	struct ServiceDiscoveryReqType_ServiceScope ServiceScope;
 	struct selection_ServiceDiscoveryReqType isused;
 
 };
 
-struct arraylen_serviceIDType
+struct arraylen_ServiceDescriptionType_ServiceID
 {
 	size_t data;
 
 
 };
 
-struct serviceIDType
+struct ServiceDescriptionType_ServiceID
 {
 	uint8_t data[8];
-	struct arraylen_serviceIDType arraylen;
+	struct arraylen_ServiceDescriptionType_ServiceID arraylen;
 
 };
 
-struct arraylen_serviceNameType
+struct arraylen_ServiceDescriptionType_ServiceName
 {
 	size_t data;
 
 
 };
 
-struct serviceNameType
+struct ServiceDescriptionType_ServiceName
 {
-	uint32_t data[20];
-	struct arraylen_serviceNameType arraylen;
+	uint32_t data[64];
+	struct arraylen_ServiceDescriptionType_ServiceName arraylen;
 
 };
 
@@ -501,12 +481,26 @@ struct selection_ServiceDescriptionType
 
 };
 
+struct arraylen_ServiceDescriptionType_ServiceScope
+{
+	size_t data;
+
+
+};
+
+struct ServiceDescriptionType_ServiceScope
+{
+	uint32_t data[255];
+	struct arraylen_ServiceDescriptionType_ServiceScope arraylen;
+
+};
+
 struct ServiceDescriptionType
 {
-	struct serviceIDType ServiceID;
-	struct serviceNameType ServiceName;
+	struct ServiceDescriptionType_ServiceID ServiceID;
+	struct ServiceDescriptionType_ServiceName ServiceName;
 	enum serviceTypeType ServiceType;
-	struct serviceScopeType ServiceScope;
+	struct ServiceDescriptionType_ServiceScope ServiceScope;
 	struct selection_ServiceDescriptionType isused;
 
 };
@@ -540,9 +534,45 @@ struct ServiceDiscoveryResType
 
 };
 
+struct arraylen_ServicePaymentSelectionReqType_PEVPubKey
+{
+	size_t data;
+
+
+};
+
+struct ServicePaymentSelectionReqType_PEVPubKey
+{
+	uint8_t data[64];
+	struct arraylen_ServicePaymentSelectionReqType_PEVPubKey arraylen;
+
+};
+
 struct ServicePaymentSelectionReqType
 {
 	struct ServiceListType ServiceList;
+	struct ServicePaymentSelectionReqType_PEVPubKey PEVPubKey;
+
+
+};
+
+struct arraylen_ServicePaymentSelectionResType_MeteringAuthPubKey
+{
+	size_t data;
+
+
+};
+
+struct ServicePaymentSelectionResType_MeteringAuthPubKey
+{
+	uint8_t data[64];
+	struct arraylen_ServicePaymentSelectionResType_MeteringAuthPubKey arraylen;
+
+};
+
+struct selection_ServicePaymentSelectionResType
+{
+	unsigned int MeteringAuthPubKey:1;
 
 
 };
@@ -550,27 +580,28 @@ struct ServicePaymentSelectionReqType
 struct ServicePaymentSelectionResType
 {
 	enum responseCode_ServicePaymentSelectionType ResponseCode;
-
+	struct ServicePaymentSelectionResType_MeteringAuthPubKey MeteringAuthPubKey;
+	struct selection_ServicePaymentSelectionResType isused;
 
 };
 
-struct arraylen_contractIDType
+struct arraylen_PaymentDetailsReqType_ContractID
 {
 	size_t data;
 
 
 };
 
-struct contractIDType
+struct PaymentDetailsReqType_ContractID
 {
 	uint32_t data[128];
-	struct arraylen_contractIDType arraylen;
+	struct arraylen_PaymentDetailsReqType_ContractID arraylen;
 
 };
 
 struct PaymentDetailsReqType
 {
-	struct contractIDType ContractID;
+	struct PaymentDetailsReqType_ContractID ContractID;
 
 
 };
@@ -578,51 +609,47 @@ struct PaymentDetailsReqType
 struct PaymentDetailsResType
 {
 	enum responseCode_PaymentDetailsType ResponseCode;
-	int32_t TCurrent;
 
 
 };
 
 struct FloatingValueType
 {
-	int16_t Multiplier;
+	enum unitMultiplierType Multiplier;
 	enum unitSymbolType Unit;
 	int32_t Value;
 
 
 };
 
-struct ChargeParameterDiscoveryReqType
+struct PowerDiscoveryReqType
 {
 	struct PEVStatusType PEVStatus;
-	enum chargingModeType ChargingMode;
 	int32_t EoC;
 	struct FloatingValueType EAmount;
 	struct FloatingValueType PEVMaxPower;
 	int16_t PEVMaxPhases;
 	struct FloatingValueType PEVMaxVoltage;
 	struct FloatingValueType PEVMinVoltage;
-	struct FloatingValueType PEVMaxCurrent;
-	struct FloatingValueType PEVMinCurrent;
 
 
 };
 
-struct arraylen_energyProviderType
+struct arraylen_PowerDiscoveryResType_EnergyProvider
 {
 	size_t data;
 
 
 };
 
-struct energyProviderType
+struct PowerDiscoveryResType_EnergyProvider
 {
-	uint32_t data[20];
-	struct arraylen_energyProviderType arraylen;
+	uint32_t data[256];
+	struct arraylen_PowerDiscoveryResType_EnergyProvider arraylen;
 
 };
 
-struct selection_ChargeParameterDiscoveryResType
+struct selection_PowerDiscoveryResType
 {
 	unsigned int EnergyProvider:1;
 	unsigned int TariffTable:1;
@@ -630,31 +657,31 @@ struct selection_ChargeParameterDiscoveryResType
 
 };
 
-struct arraylen_currencyType
+struct arraylen_TariffTableType_Currency
 {
 	size_t data;
 
 
 };
 
-struct currencyType
+struct TariffTableType_Currency
 {
 	uint32_t data[3];
-	struct arraylen_currencyType arraylen;
+	struct arraylen_TariffTableType_Currency arraylen;
 
 };
 
-struct arraylen_tariffDescriptionType
+struct arraylen_TariffDescrType_TariffDescription
 {
 	size_t data;
 
 
 };
 
-struct tariffDescriptionType
+struct TariffDescrType_TariffDescription
 {
 	uint32_t data[32];
-	struct arraylen_tariffDescriptionType arraylen;
+	struct arraylen_TariffDescrType_TariffDescription arraylen;
 
 };
 
@@ -698,7 +725,7 @@ struct TariffEntriesType
 struct TariffDescrType
 {
 	enum tariffIDType TariffID;
-	struct tariffDescriptionType TariffDescription;
+	struct TariffDescrType_TariffDescription TariffDescription;
 	struct TariffEntriesType TariffEntries;
 	struct selection_TariffDescrType isused;
 
@@ -713,24 +740,22 @@ struct arraylen_TariffTableType
 
 struct TariffTableType
 {
-	struct currencyType Currency;
+	struct TariffTableType_Currency Currency;
 	struct TariffDescrType Tariff[6];
 	struct arraylen_TariffTableType arraylen;
 
 };
 
-struct ChargeParameterDiscoveryResType
+struct PowerDiscoveryResType
 {
-	enum responseCode_ChargeParameterDiscoveryType ResponseCode;
+	enum responseCode_PowerDiscoveryType ResponseCode;
 	struct EVSEStatusType EVSEStatus;
-	struct FloatingValueType EVSEMaxVoltage;
-	struct FloatingValueType EVSEMinVoltage;
-	struct FloatingValueType EVSEMaxCurrent;
-	struct FloatingValueType EVSEMinCurrent;
+	struct FloatingValueType EVSEVoltage;
+	struct FloatingValueType EVSEIMax;
 	int16_t EVSEMaxPhases;
-	struct energyProviderType EnergyProvider;
+	struct PowerDiscoveryResType_EnergyProvider EnergyProvider;
 	struct TariffTableType TariffTable;
-	struct selection_ChargeParameterDiscoveryResType isused;
+	struct selection_PowerDiscoveryResType isused;
 
 };
 
@@ -753,6 +778,15 @@ struct LineLockResType
 struct selection_PowerDeliveryReqType
 {
 	unsigned int Tariff:1;
+	unsigned int ChargingProfile:1;
+
+
+};
+
+struct ChargingProfileType
+{
+	int32_t ChargingProfileEntryStart;
+	struct FloatingValueType ChargingProfileEntryMaxPower;
 
 
 };
@@ -762,6 +796,7 @@ struct PowerDeliveryReqType
 	struct PEVStatusType PEVStatus;
 	int ReqSwitchStatus;
 	enum tariffIDType Tariff;
+	struct ChargingProfileType ChargingProfile;
 	struct selection_PowerDeliveryReqType isused;
 
 };
@@ -769,7 +804,6 @@ struct PowerDeliveryReqType
 struct PowerDeliveryResType
 {
 	enum responseCode_PowerDeliveryType ResponseCode;
-	struct EVSEStatusType EVSEStatus;
 
 
 };
@@ -782,6 +816,20 @@ struct MeteringStatusReqType
 	
 };
 
+struct arraylen_MeteringStatusResType_EVSEID
+{
+	size_t data;
+
+
+};
+
+struct MeteringStatusResType_EVSEID
+{
+	uint8_t data[32];
+	struct arraylen_MeteringStatusResType_EVSEID arraylen;
+
+};
+
 struct selection_MeteringStatusResType
 {
 	unsigned int PCurrent:1;
@@ -790,17 +838,17 @@ struct selection_MeteringStatusResType
 
 };
 
-struct arraylen_meterIDType
+struct arraylen_MeterInfoType_MeterID
 {
 	size_t data;
 
 
 };
 
-struct meterIDType
+struct MeterInfoType_MeterID
 {
 	uint32_t data[32];
-	struct arraylen_meterIDType arraylen;
+	struct arraylen_MeterInfoType_MeterID arraylen;
 
 };
 
@@ -816,7 +864,7 @@ struct selection_MeterInfoType
 
 struct MeterInfoType
 {
-	struct meterIDType MeterID;
+	struct MeterInfoType_MeterID MeterID;
 	struct FloatingValueType MeterReading;
 	int16_t MeterStatus;
 	int32_t TMeter;
@@ -827,7 +875,7 @@ struct MeterInfoType
 struct MeteringStatusResType
 {
 	enum responseCode_MeteringStatusType ResponseCode;
-	struct evseIDType EVSEID;
+	struct MeteringStatusResType_EVSEID EVSEID;
 	struct EVSEStatusType EVSEStatus;
 	int32_t TCurrent;
 	struct FloatingValueType EVSEMaxPower;
@@ -837,6 +885,20 @@ struct MeteringStatusResType
 
 };
 
+struct arraylen_MeteringReceiptReqType_PEVID
+{
+	size_t data;
+
+
+};
+
+struct MeteringReceiptReqType_PEVID
+{
+	uint32_t data[32];
+	struct arraylen_MeteringReceiptReqType_PEVID arraylen;
+
+};
+
 struct selection_MeteringReceiptReqType
 {
 	unsigned int PEVID:1;
@@ -847,7 +909,7 @@ struct selection_MeteringReceiptReqType
 
 struct MeteringReceiptReqType
 {
-	struct pevIDType PEVID;
+	struct MeteringReceiptReqType_PEVID PEVID;
 	struct PEVStatusType PEVStatus;
 	int32_t TCurrent;
 	enum tariffIDType Tariff;
@@ -861,143 +923,44 @@ struct MeteringReceiptResType
 	enum responseCode_MeteringReceiptType ResponseCode;
 
 
-};
-
-struct CableCheckReqType
-{
-	struct PEVStatusType PEVStatus;
-
-
-};
-
-struct CableCheckResType
-{
-	enum responseCode_CableCheckType ResponseCode;
-	struct EVSEStatusType EVSEStatus;
-
-
-};
-
-struct PreChargeReqType
-{
-	struct PEVStatusType PEVStatus;
-	struct FloatingValueType PEVTargetVoltage;
-	struct FloatingValueType PEVDemandCurrent;
-	struct FloatingValueType VoltageDifferential;
-
-
-};
-
-struct PreChargeResType
-{
-	enum responseCode_PreChargeType ResponseCode;
-	struct EVSEStatusType EVSEStatus;
-	struct FloatingValueType EVSEPresentVoltage;
-
-
-};
-
-struct CurrentDemandReqType
-{
-	struct PEVStatusType PEVStatus;
-	struct FloatingValueType PEVTargetVoltage;
-	struct FloatingValueType PEVDemandCurrent;
-	struct FloatingValueType CurrentDifferential;
-	struct FloatingValueType VoltageDifferential;
-
-
-};
-
-struct CurrentDemandResType
-{
-	enum responseCode_CurrentDemandType ResponseCode;
-	struct EVSEStatusType EVSEStatus;
-	struct FloatingValueType EVSEPresentVoltage;
-	struct FloatingValueType EVSEPresentCurrent;
-
-
-};
-
-struct WeldingDetectionReqType
-{
-	struct PEVStatusType PEVStatus;
-
-
-};
-
-struct WeldingDetectionResType
-{
-	enum responseCode_WeldingDetectionType ResponseCode;
-	struct EVSEStatusType EVSEStatus;
-	struct FloatingValueType EVSEPresentVoltage;
-
-
-};
-
-struct TerminateChargingReqType
-{
-	struct PEVStatusType PEVStatus;
-
-
-};
-
-struct TerminateChargingResType
-{
-	enum responseCode_TerminateChargingType ResponseCode;
-	struct EVSEStatusType EVSEStatus;
-	struct FloatingValueType EVSEPresentVoltage;
-
-
 };
 
 struct BodyType
 {
-	struct SessionSetupReqType* SessionSetupReq;
-	struct SessionSetupResType* SessionSetupRes;
-	struct ServiceDiscoveryReqType* ServiceDiscoveryReq;
-	struct ServiceDiscoveryResType* ServiceDiscoveryRes;
-	struct ServicePaymentSelectionReqType* ServicePaymentSelectionReq;
-	struct ServicePaymentSelectionResType* ServicePaymentSelectionRes;
-	struct PaymentDetailsReqType* PaymentDetailsReq;
-	struct PaymentDetailsResType* PaymentDetailsRes;
-	struct ChargeParameterDiscoveryReqType* ChargeParameterDiscoveryReq;
-	struct ChargeParameterDiscoveryResType* ChargeParameterDiscoveryRes;
-	struct LineLockReqType* LineLockReq;
-	struct LineLockResType* LineLockRes;
-	struct PowerDeliveryReqType* PowerDeliveryReq;
-	struct PowerDeliveryResType* PowerDeliveryRes;
-	struct MeteringStatusReqType* MeteringStatusReq;
-	struct MeteringStatusResType* MeteringStatusRes;
-	struct MeteringReceiptReqType* MeteringReceiptReq;
-	struct MeteringReceiptResType* MeteringReceiptRes;
-	struct CableCheckReqType* CableCheckReq;
-	struct CableCheckResType* CableCheckRes;
-	struct PreChargeReqType* PreChargeReq;
-	struct PreChargeResType* PreChargeRes;
-	struct CurrentDemandReqType* CurrentDemandReq;
-	struct CurrentDemandResType* CurrentDemandRes;
-	struct WeldingDetectionReqType* WeldingDetectionReq;
-	struct WeldingDetectionResType* WeldingDetectionRes;
-	struct TerminateChargingReqType* TerminateChargingReq;
-	struct TerminateChargingResType* TerminateChargingRes;
+	struct SessionSetupReqType SessionSetupReq;
+	struct SessionSetupResType SessionSetupRes;
+	struct ServiceDiscoveryReqType ServiceDiscoveryReq;
+	struct ServiceDiscoveryResType ServiceDiscoveryRes;
+	struct ServicePaymentSelectionReqType ServicePaymentSelectionReq;
+	struct ServicePaymentSelectionResType ServicePaymentSelectionRes;
+	struct PaymentDetailsReqType PaymentDetailsReq;
+	struct PaymentDetailsResType PaymentDetailsRes;
+	struct PowerDiscoveryReqType PowerDiscoveryReq;
+	struct PowerDiscoveryResType PowerDiscoveryRes;
+	struct LineLockReqType LineLockReq;
+	struct LineLockResType LineLockRes;
+	struct PowerDeliveryReqType PowerDeliveryReq;
+	struct PowerDeliveryResType PowerDeliveryRes;
+	struct MeteringStatusReqType MeteringStatusReq;
+	struct MeteringStatusResType MeteringStatusRes;
+	struct MeteringReceiptReqType MeteringReceiptReq;
+	struct MeteringReceiptResType MeteringReceiptRes;
 	struct selection_BodyType isused;
 
 };
 
 struct AnonType_V2G_Message
 {
-	struct HeaderType* Header;
+	struct HeaderType Header;
 	struct BodyType Body;
 
 
 };
-
-struct EXIDocumentType
-{
-	struct AnonType_V2G_Message V2G_Message;
+	
+/* init method of the V2G message */	
+void init_AnonType_V2G_Message(struct AnonType_V2G_Message* v2gMsg);
 
 
-};
 
 #endif
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 375 - 482
src/service/v2g_serviceDispatcher.c


+ 43 - 43
src/service/v2g_serviceDispatcher.h

@@ -1,43 +1,43 @@
-/*
- * Copyright (C) 2007-2011 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 Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.2
- * @contact Joerg.Heuer@siemens.com
- *
- ********************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef V2GSERVER_H_
-#define V2GSERVER_H_
-
-#include "v2g_serviceDataTypes.h"
-
-
-int init_v2gservice(struct EXIService* service,bytes_t bytes, string_ucs_t string, uint16_t transportHeaderOffset);
-int messageDispatcher(struct EXIService* service, uint8_t* inStream, uint16_t sizeInStream, uint8_t* outStream, uint16_t sizeOutStream, uint16_t* outPos);
-
-#endif /* V2GSERVER_H_ */
-
-#ifdef __cplusplus
-}
-#endif
+/*
+ * Copyright (C) 2007-2010 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 Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.3
+ * @contact Joerg.Heuer@siemens.com
+ *
+ ********************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef V2GSERVER_H_
+#define V2GSERVER_H_
+
+#include "v2g_serviceDataTypes.h"
+
+
+int init_v2gservice(struct v2gService* service,bytes_t bytes, string_ucs_t string, uint16_t transportHeaderOffset);
+int messageDispatcher(struct v2gService* service, uint8_t* inStream, size_t sizeInStream, uint8_t* outStream, size_t sizeOutStream, size_t* outPos);
+
+#endif /* V2GSERVER_H_ */
+
+#ifdef __cplusplus
+}
+#endif

+ 3 - 13
src/service/v2g_serviceMethods.h

@@ -3,7 +3,7 @@
 
 
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -22,7 +22,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.3.2
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -47,7 +47,7 @@ int	selectedServicePayment(struct ServicePaymentSelectionReqType* param, struct
 					
 int	paymentDetails(struct PaymentDetailsReqType* param, struct PaymentDetailsResType* result);
 					
-int	chargeParameterDiscovery(struct ChargeParameterDiscoveryReqType* param, struct ChargeParameterDiscoveryResType* result);
+int	powerDiscovery(struct PowerDiscoveryReqType* param, struct PowerDiscoveryResType* result);
 					
 int	lineLock(struct LineLockReqType* param, struct LineLockResType* result);
 					
@@ -56,16 +56,6 @@ int	powerDelivery(struct PowerDeliveryReqType* param, struct PowerDeliveryResTyp
 int	meteringStatus(struct MeteringStatusReqType* param, struct MeteringStatusResType* result);
 					
 int	meteringReceipt(struct MeteringReceiptReqType* param, struct MeteringReceiptResType* result);
-					
-int	cableCheck(struct CableCheckReqType* param, struct CableCheckResType* result);
-					
-int	preCharge(struct PreChargeReqType* param, struct PreChargeResType* result);
-					
-int	currentDemand(struct CurrentDemandReqType* param, struct CurrentDemandResType* result);
-					
-int	weldingDetection(struct WeldingDetectionReqType* param, struct WeldingDetectionResType* result);
-					
-int	terminateCharging(struct TerminateChargingReqType* param, struct TerminateChargingResType* result);
 						
 	
 

+ 3 - 4
src/test/main.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -19,7 +19,7 @@
  *
  * @author Daniel.Peintner.EXT@siemens.com
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Switch for sample programs: EXI codec only or for entire V2G service</p>
@@ -33,8 +33,7 @@
 
 int main(int argc, char *argv[]) {
 	/* EXI codec only */
-	/*  return main_codec(argc, argv);*/
-
+	 /*return main_codec(argc, argv);*/
 
 	/* V2G client / service example scenario */
 	return main_service(argc, argv);

+ 2 - 2
src/test/main.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -19,7 +19,7 @@
  *
  * @author Daniel.Peintner.EXT@siemens.com
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  *

+ 10 - 10
src/test/main_codec.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Sample program to illustrate how to read an EXI stream and
@@ -36,10 +36,10 @@
 #include "EXITypes.h"
 #include "ByteStream.h"
 
-#define BUFFER_SIZE 1000
+#define BUFFER_SIZE 100
 
-#define ARRAY_SIZE_BYTES 100
-#define ARRAY_SIZE_STRINGS 100
+#define ARRAY_SIZE_BYTES 50
+#define ARRAY_SIZE_STRINGS 50
 
 /* avoids warning: initializer element is not computable at load time */
 uint8_t bufferIn[BUFFER_SIZE];
@@ -53,8 +53,8 @@ int main_codec(int argc, char *argv[]) {
 	unsigned int i;
 
 	bitstream_t iStream, oStream;
-	uint16_t posDecode;
-	uint16_t posEncode;
+	size_t posDecode;
+	size_t posEncode;
 
 	/* EXI set-up */
 	exi_state_t stateDecode;
@@ -66,7 +66,7 @@ int main_codec(int argc, char *argv[]) {
 	/* BINARY memory setup */
 	bytes_t bytes = { ARRAY_SIZE_BYTES, data, 0 };
 
-	/* STRING memory setup */
+	/* STRING memory setuo */
 	string_ucs_t string = { ARRAY_SIZE_STRINGS, codepoints, 0 };
 
 	const char * localName;
@@ -182,7 +182,7 @@ int main_codec(int argc, char *argv[]) {
 				return errn;
 			}
 			if (val.type == INTEGER_BIG) {
-				printf(" CH int64 : %ld \n", (long int)val.int64);
+				printf(" CH int64 : %lld \n", val.int64);
 			} else if (val.type == BINARY_BASE64 || val.type == BINARY_HEX) {
 				printf(" CH Binary (len == %d) : ", val.binary.len);
 				for(i=0; i<val.binary.len; i++) {
@@ -224,7 +224,7 @@ int main_codec(int argc, char *argv[]) {
 	} while (noEndOfDocument);
 
 	/* write to file */
-	writeBytesToFile(oStream.data, posEncode, argv[2]);
+	writeBytesToFile(oStream.data, iStream.size, argv[2]);
 
 	return 0;
 }

+ 23 - 589
src/test/main_service.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -37,310 +37,11 @@
 #define MAX_STRING_SIZE 256
 #define MAX_STREAM_SIZE 60
 
-static uint8_t byte_array[MAX_BYTE_SIZE]; /* define MAX_BYTE_SIZE before*/
-static uint32_t string_array[MAX_STRING_SIZE]; /* define MAX_STRING_SIZE before*/
+static void printErrorMessage(struct v2gService* service);
 
-static void printEVSEStatus(struct EVSEStatusType* status);
-static void printErrorMessage(struct EXIService* service);
-
-static int ac_charging()
-{
-	/* define in and out byte stream */
-	uint8_t inStream[MAX_STREAM_SIZE]; /* define MAX_STREAM_SIZE before */
-	uint8_t outStream[MAX_STREAM_SIZE]; /* define MAX_STREAM_SIZE before */
-
-	/* define offset variable for transport header data */
-	uint16_t transportHeaderOffset;
-
-	/* service data structure */
-	struct EXIService service;
-	struct HeaderType v2gHeader;
-	struct SessionSetupReqType sessionSetup;
-	struct SessionSetupResType resultSessionSetup;
-	struct ChargeParameterDiscoveryReqType powerDiscovery;
-	struct ChargeParameterDiscoveryResType resultPowerDiscovery;
-	struct LineLockReqType lineLock;
-	struct LineLockResType resultLineLock;
-	struct PowerDeliveryReqType powerDelivery;
-	struct PowerDeliveryResType resultPowerDelivery;
-	struct MeteringStatusResType resultMeteringStatus;
-	struct MeteringReceiptReqType meteringReceipt;
-	struct MeteringReceiptResType resultMeteringReceipt;
-
-
-	struct FloatingValueType float_type; /* test float type*/
-
-
-	/* BINARY memory setup */
-	bytes_t bytes = { MAX_BYTE_SIZE, byte_array, 0 };
-
-	/* STRING memory setup */
-	string_ucs_t string = { MAX_STRING_SIZE, string_array, 0 };
-
-	/* setup offset for DoIP header (otherwise set
-	 * transportHeaderOffset=0 if no transfer protocol is used)*/
-	transportHeaderOffset = DOIP_HEADER_LENGTH;
-
-	/*******************
-	 * Init V2G Client *
-	 *******************/
-
-	init_v2gServiceClient(&service,bytes,string,inStream,MAX_STREAM_SIZE, outStream, MAX_STREAM_SIZE, transportHeaderOffset);
-
-	/*******************************
-	 * Setup data for sessionSetup *
-	 *******************************/
-
-	/* setup header information */
-	v2gHeader.SessionInformation.SessionID.arraylen.data = 0; /* no session id in the initial message -> array length = 0*/
-	v2gHeader.SessionInformation.ProtocolVersion.data[0]='1'; /* assign protocol version number*/
-	v2gHeader.SessionInformation.ProtocolVersion.arraylen.data=1; /* array string length =1 of protocol version */
-	v2gHeader.SessionInformation.isused.ProtocolVersion = 1; /* important: optional elements have to be set used (=1) or not used (=0) */
-	v2gHeader.SessionInformation.isused.ServiceSessionID = 0; /* service session is not used */
-	v2gHeader.isused.Notification=0; /* no notification */
-
-	/* setup sessionSetup parameter */
-	sessionSetup.isused.PEVID=1; /*  PEVID is transported */
-	sessionSetup.PEVID.arraylen.data=1;
-	sessionSetup.PEVID.data[0]=10;
-	sessionSetup.PEVStatus.ChargerStandby=0; /* charger standby = true */
-	sessionSetup.PEVStatus.ConnectorLocked=0; /* connector locked = false */
-	sessionSetup.PEVStatus.ReadyToCharge=0; /* ReadyToCharge = false */
-
-
-
-	printf("PEV: call EVSE sessionSetup\n");
-
-	/*********************
-	 * Call sessionSetup *
-	 *********************/
-	if(call_sessionSetup(&service,&v2gHeader,&sessionSetup,&resultSessionSetup))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-		/* show result of the answer message of EVSE sessionSetup */
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d (OK)\n",resultSessionSetup.ResponseCode);
-		printf("\tEVSEID=%d\n",	resultSessionSetup.EVSEID.data[0]);
-		printEVSEStatus(&resultSessionSetup.EVSEStatus);
-		printf("\tTCurrent=%d\n",resultSessionSetup.TCurrent);
-	}
-
-
-	/*******************************************
-	 * Setup data for chargeParameterDiscovery *
-	 *******************************************/
-
-	powerDiscovery.PEVStatus.ChargerStandby = 1;
-	powerDiscovery.PEVStatus.ConnectorLocked = 0;
-	powerDiscovery.PEVStatus.ReadyToCharge=0;
-	powerDiscovery.ChargingMode = AC_charging_chargingModeType;
-	powerDiscovery.EoC = 12345678;
-
-	float_type.Multiplier = 0;
-	float_type.Unit = J_unitSymbolType;
-	float_type.Value = 100;
-
-	powerDiscovery.EAmount = float_type;
-	powerDiscovery.PEVMaxPhases = 3;
-
-	float_type.Unit = W_unitSymbolType;
-	float_type.Value = 600;
-	powerDiscovery.PEVMaxPower = float_type;
-
-	float_type.Unit = V_unitSymbolType;
-	float_type.Value = 1000;
-	powerDiscovery.PEVMaxVoltage = float_type;
-	float_type.Value = 200;
-	powerDiscovery.PEVMinVoltage = float_type;
-
-	/* only required for DC */
-	float_type.Unit = A_unitSymbolType;
-	float_type.Value = 200;
-	powerDiscovery.PEVMaxCurrent = float_type;
-	powerDiscovery.PEVMinCurrent = float_type;
-
-
-	/*********************************
-	 * Call chargeParameterDiscovery *
-	 *********************************/
-	printf("\nPEV: call EVSE chargeParameterDiscovery\n");
-
-	if(call_chargeParameterDiscovery(&service,&v2gHeader,&powerDiscovery,&resultPowerDiscovery))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE sessionSetup*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultPowerDiscovery.ResponseCode);
-		printEVSEStatus(&resultPowerDiscovery.EVSEStatus);
-		printf("\tEVSEMaxVoltage=%d\n",resultPowerDiscovery.EVSEMaxVoltage.Value);
-		/*printf("\tEVSEMaxCurrent=%d\n",resultPowerDiscovery.EVSEMaxCurrent.Value);*/
-		printf("\tEVSEMaxPhases=%d\n",resultPowerDiscovery.EVSEMaxPhases);
-
-		/*printf("\tEnergyProvider=%d\n",resultPowerDiscovery.EnergyProvider.data[0]);*/
-
-	}
-
-
-
-
-	/*********************************
-	 * Setup data for lineLock *
-	 *********************************/
-
-	lineLock.PEVStatus.ChargerStandby = 1;
-	lineLock.PEVStatus.ConnectorLocked = 1;
-	lineLock.PEVStatus.ReadyToCharge = 1;
-	lineLock.ReqLockStatus = 1;
-
-	/***********************
-	 * Call lineLock *
-	 ***********************/
-	printf("\nPEV: call EVSE lineLock\n");
-
-	if(call_lineLock(&service,&v2gHeader,&lineLock,&resultLineLock))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE sessionSetup*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultLineLock.ResponseCode);
-		printEVSEStatus(&resultLineLock.EVSEStatus);
-
-	}
-
-
-
-	/*********************************
-	 * Setup data for powerDelivery *
-	 *********************************/
-
-	powerDelivery.PEVStatus = lineLock.PEVStatus; /* PEV status, taken from lineLock */
-	/*powerDelivery.isused.Tariff = 0;
-	powerDelivery.Tariff = Green_charge_tariffIDType;*/
-
-	/***********************
-	 * Call powerDelivery *
-	 ***********************/
-	printf("\nPEV: call EVSE powerDelivery\n");
-
-	if(call_powerDelivery(&service,&v2gHeader,&powerDelivery,&resultPowerDelivery))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE sessionSetup*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultPowerDelivery.ResponseCode);
-	}
-
-
-
-
-
-
-	/********************
-	 * Call meterStatus *
-	 ********************/
-
-	printf("\nPEV: call EVSE meterStatus\n");
-
-	if(call_meteringStatus(&service,&v2gHeader,&resultMeteringStatus))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultPowerDiscovery.ResponseCode);
-		printEVSEStatus(&resultPowerDiscovery.EVSEStatus);
-		printf("\tEVSEID=%d\n",resultMeteringStatus.EVSEID.data[0]);
-		printf("\tEVSEMaxPower=%d\n",resultMeteringStatus.EVSEMaxPower.Value);
-		printf("\tisused.MeterInfo=%d\n",		resultMeteringStatus.isused.MeterInfo);
-		printf("\t\tMeterInfo.MeterID=%d\n",		resultMeteringStatus.MeterInfo.MeterID.data[0]);
-		printf("\t\tMeterInfo.MeterReading.Value=%d\n",		resultMeteringStatus.MeterInfo.MeterReading.Value);
-		printf("\t\tMeterInfo.MeterStatus=%d\n",		resultMeteringStatus.MeterInfo.MeterStatus);
-	/*	printf("\t\tMeterInfo.TMeter=%d\n",		resultMeteringStatus.MeterInfo.TMeter);*/
-	/*	printf("\t\tisused.PCurrent=%d\n",		resultMeteringStatus.isused.PCurrent);
-		printf("\t\tPCurrent=%d\n",		resultMeteringStatus.PCurrent.Value);*/
-
-	}
-
-
-
-
-	/*********************************
-	 * Setup data for meteringReceipt *
-	 *********************************/
-
-	meteringReceipt.PEVID.arraylen.data=1;
-	meteringReceipt.PEVID.data[0]=10;
-	meteringReceipt.isused.PEVID=1;
-
-	meteringReceipt.PEVStatus = powerDelivery.PEVStatus; /* PEV status, taken from sessionSetup */
-
-	meteringReceipt.TCurrent = 12345;
-	meteringReceipt.isused.TCurrent = 1;
-	meteringReceipt.Tariff = Green_charge_tariffIDType;
-	meteringReceipt.MeterInfo.MeterStatus = 2;
-	meteringReceipt.MeterInfo.isused.MeterStatus = 1;
-
-
-	meteringReceipt.MeterInfo.MeterID.arraylen.data=1;
-	meteringReceipt.MeterInfo.MeterID.data[0]=3;
-	meteringReceipt.MeterInfo.isused.MeterID = 1;
-
-	meteringReceipt.MeterInfo.MeterReading.Multiplier = 0;
-	meteringReceipt.MeterInfo.MeterReading.Unit = A_unitSymbolType;
-	meteringReceipt.MeterInfo.MeterReading.Value = 500;
-	meteringReceipt.MeterInfo.isused.MeterReading = 1;
-
-	meteringReceipt.MeterInfo.TMeter =123456789;
-	meteringReceipt.MeterInfo.isused.TMeter = 1;
-
-
-
-	/***********************
-	 * Call meteringReceipt *
-	 ***********************/
-	printf("\nPEV: call EVSE meteringReceipt\n");
-
-
-
-	if(call_meteringReceipt(&service,&v2gHeader,&meteringReceipt,&resultMeteringReceipt))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-		/* show result of the answer message of EVSE sessionSetup*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultMeteringReceipt.ResponseCode);
-	}
-
-
-	return 0;
-
-
-}
-
-static int dc_charging()
+int main_service(int argc, char *argv[])
 {
 
-
-
 	static uint8_t byte_array[MAX_BYTE_SIZE]; /* define MAX_BYTE_SIZE before*/
 	static uint32_t string_array[MAX_STRING_SIZE]; /* define MAX_STRING_SIZE before*/
 
@@ -353,29 +54,13 @@ static int dc_charging()
 
 
 	/* service data structure */
-	struct EXIService service;
+	struct v2gService service;
 	struct HeaderType v2gHeader;
 	struct SessionSetupReqType sessionSetup;
 	struct SessionSetupResType resultSessionSetup;
-	struct ChargeParameterDiscoveryReqType powerDiscovery;
-	struct ChargeParameterDiscoveryResType resultPowerDiscovery;
-	struct CableCheckReqType cableCheck;
-	struct CableCheckResType resultCableCheck;
-	struct PowerDeliveryReqType powerDelivery;
-	struct PowerDeliveryResType resultPowerDelivery;
-	struct PreChargeReqType preCharge;
-	struct PreChargeResType resultPreCharge;
-	struct CurrentDemandReqType currentDemand;
-	struct CurrentDemandResType resultCurrentDemand;
-	struct WeldingDetectionReqType weldingDetection;
-	struct WeldingDetectionResType resultWeldingDetection;
-	struct TerminateChargingReqType terminateCharging;
-	struct TerminateChargingResType resultTerminateCharging;
-
-
-
+	/*struct PowerDiscoveryReqType powerDiscovery;
+	struct PowerDiscoveryResType resultPowerDiscovery; */
 
-	struct FloatingValueType float_type; /* test float type*/
 
 
 	/* BINARY memory setup */
@@ -389,6 +74,8 @@ static int dc_charging()
 	transportHeaderOffset = DOIP_HEADER_LENGTH;
 
 
+	printf("+++Start V2G Client / Service Example+++\n\n");
+
 	/*******************
 	 * Init V2G Client *
 	 *******************/
@@ -396,26 +83,22 @@ static int dc_charging()
 	init_v2gServiceClient(&service,bytes,string,inStream,MAX_STREAM_SIZE, outStream, MAX_STREAM_SIZE, transportHeaderOffset);
 
 	/*******************************
-	 * Setup data for sessionSetup *
+	 * Setup data for sessionSetup *
 	 *******************************/
 
 	/* setup header information */
 	v2gHeader.SessionInformation.SessionID.arraylen.data = 0; /* no session id in the initial message -> array length = 0*/
 	v2gHeader.SessionInformation.ProtocolVersion.data[0]='1'; /* assign protocol version number*/
 	v2gHeader.SessionInformation.ProtocolVersion.arraylen.data=1; /* array string length =1 of protocol version */
-	v2gHeader.SessionInformation.isused.ProtocolVersion = 1; /* important: optional elements have to be set used (=1) or not used (=0) */
-	v2gHeader.SessionInformation.isused.ServiceSessionID = 0; /* service session is not used */
+	v2gHeader.SessionInformation.isused.ProtocolVersion = 1; /* important: signalize, protocol version is used */
 	v2gHeader.isused.Notification=0; /* no notification */
 
 	/* setup sessionSetup parameter */
 	sessionSetup.isused.PEVID=1; /* no PEVID is transported */
-	sessionSetup.PEVID.arraylen.data=1;
-	sessionSetup.PEVID.data[0]=10;
-	sessionSetup.PEVStatus.ChargerStandby=0; /* charger standby = true */
+	sessionSetup.PEVStatus.ChargerStandby=1; /* charger standby = true */
 	sessionSetup.PEVStatus.ConnectorLocked=0; /* connector locked = false */
 
 
-
 	printf("PEV: call EVSE sessionSetup\n");
 
 	/*********************
@@ -427,280 +110,31 @@ static int dc_charging()
 	}
 	else
 	{
-		/* show result of the answer message of EVSE sessionSetup */
+		/* show result of the answer message of EVSE sessionSetup*/
 		printf("PEV: received response message from EVSE\n");
 		printf("\tResponseCode=%d\n",resultSessionSetup.ResponseCode);
 		printf("\tEVSEID=%d\n",	resultSessionSetup.EVSEID.data[0]);
-		printEVSEStatus(&resultSessionSetup.EVSEStatus);
+		printf("\tEVSEStatus:\n\t\tConnectorLocked=%d\n",resultSessionSetup.EVSEStatus.ConnectorLocked);
+		printf("\t\tEVSEStandby=%d\n",resultSessionSetup.EVSEStatus.EVSEStandby);
+		printf("\t\tFatalError=%d\n",resultSessionSetup.EVSEStatus.FatalError);
+		printf("\t\tPowerSwitchClosed=%d\n",resultSessionSetup.EVSEStatus.PowerSwitchClosed);
+		printf("\t\tRCD=%d\n",resultSessionSetup.EVSEStatus.RCD);
+		printf("\t\tShutDownTime=%d\n",resultSessionSetup.EVSEStatus.ShutDownTime);
 		printf("\tTCurrent=%d\n",resultSessionSetup.TCurrent);
 	}
 
-
-	/*******************************************
-	 * Setup data for chargeParameterDiscovery *
-	 *******************************************/
-
-	powerDiscovery.PEVStatus = sessionSetup.PEVStatus; /* PEV status, taken from sessionSetup */
-	powerDiscovery.EoC = 4321;
-	powerDiscovery.ChargingMode = DC_charging_chargingModeType;
-
-	float_type.Multiplier = 2;
-	float_type.Unit = A_unitSymbolType;
-	float_type.Value = 700;
-
-	float_type.Multiplier = 0;
-	float_type.Unit = J_unitSymbolType;
-	float_type.Value = 100;
-
-	powerDiscovery.EAmount = float_type;
-	powerDiscovery.PEVMaxPhases = 3;
-
-	float_type.Unit = W_unitSymbolType;
-	float_type.Value = 600;
-	powerDiscovery.PEVMaxPower = float_type;
-
-	float_type.Unit = V_unitSymbolType;
-	float_type.Value = 1000;
-	powerDiscovery.PEVMaxVoltage = float_type;
-	float_type.Value = 200;
-	powerDiscovery.PEVMinVoltage = float_type;
-
-	float_type.Unit = A_unitSymbolType;
-	float_type.Value = 800;
-	powerDiscovery.PEVMaxCurrent = float_type;
-	float_type.Value = 150;
-	powerDiscovery.PEVMinCurrent = float_type;
-
-
-	/*********************************
-	 * Call chargeParameterDiscovery *
-	 *********************************/
-	printf("\nPEV: call EVSE chargeParameterDiscovery\n");
-
-	if(call_chargeParameterDiscovery(&service,&v2gHeader,&powerDiscovery,&resultPowerDiscovery))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE sessionSetup*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultPowerDiscovery.ResponseCode);
-		printEVSEStatus(&resultPowerDiscovery.EVSEStatus);
-		printf("\tEVSEMaxVoltage=%d\n",resultPowerDiscovery.EVSEMaxVoltage.Value);
-		printf("\tEVSEMaxCurrent=%d\n",resultPowerDiscovery.EVSEMaxCurrent.Value);
-		printf("\tEVSEMinCurrent=%d\n",resultPowerDiscovery.EVSEMinCurrent.Value);
-		printf("\tEVSEMaxPhases=%d\n",resultPowerDiscovery.EVSEMaxPhases);
-
-		/*printf("\tEnergyProvider=%d\n",resultPowerDiscovery.EnergyProvider.data[0]);*/
-
-	}
-
-	/***********************
-	 * Call cableCheck     *
-	 ***********************/
-	printf("\nPEV: call EVSE cableCheck\n");
-
-	cableCheck.PEVStatus.ChargerStandby = 1;
-	cableCheck.PEVStatus.ConnectorLocked = 1;
-	cableCheck.PEVStatus.ReadyToCharge = 1;
-
-
-	if(call_cableCheck(&service,&v2gHeader,&cableCheck,&resultCableCheck))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE powerDiscovery*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultCableCheck.ResponseCode);
-		printEVSEStatus(&resultCableCheck.EVSEStatus);
-	}
-
-
-	/*********************************
-	 * Setup data for powerDelivery *
-	 *********************************/
-
-	powerDelivery.PEVStatus = cableCheck.PEVStatus; /* PEV status, taken from sessionSetup */
-	powerDelivery.isused.Tariff = 0;
-	/*powerDelivery.Tariff = Green_charge_tariffIDType;*/
-
-	/***********************
-	 * Call powerDelivery *
-	 ***********************/
-	printf("\nPEV: call EVSE powerDelivery\n");
-
-	if(call_powerDelivery(&service,&v2gHeader,&powerDelivery,&resultPowerDelivery))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE sessionSetup*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultPowerDelivery.ResponseCode);
-		printEVSEStatus(&resultPowerDelivery.EVSEStatus);
-	}
-
-
-	/***********************
-	 * Call preCharge      *
-	 ***********************/
-	printf("\nPEV: call EVSE preCharge\n");
-
-	preCharge.PEVStatus = cableCheck.PEVStatus;
-	float_type.Unit = A_unitSymbolType;
-	float_type.Value = 400;
-	preCharge.PEVDemandCurrent = float_type;
-
-	float_type.Unit = V_unitSymbolType;
-	float_type.Value = 700;
-	preCharge.PEVTargetVoltage = float_type;
-	float_type.Value = 300;
-	preCharge.VoltageDifferential = float_type;
-
-	if(call_preCharge(&service,&v2gHeader,&preCharge,&resultPreCharge))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE powerDiscovery*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultPreCharge.ResponseCode);
-		printEVSEStatus(&resultPreCharge.EVSEStatus);
-		printf("\tEVSEPresentVoltage=%d\n",resultPreCharge.EVSEPresentVoltage.Value);
-	}
-
-	/***********************
-	 * Call currentDemand      *
-	 ***********************/
-	printf("\nPEV: call EVSE currentDemand\n");
-
-	currentDemand.PEVStatus = powerDelivery.PEVStatus;
-
-	float_type.Unit = A_unitSymbolType;
-	float_type.Value = 44;
-	currentDemand.CurrentDifferential = float_type;
-
-	float_type.Value = 40;
-	currentDemand.PEVDemandCurrent = float_type;
-
-	float_type.Unit = V_unitSymbolType;
-	float_type.Value = 300;
-	currentDemand.VoltageDifferential = float_type;
-
-	float_type.Value = 700;
-	preCharge.PEVTargetVoltage = float_type;
-	currentDemand.PEVTargetVoltage = float_type;
-
-	if(call_currentDemand(&service,&v2gHeader,&currentDemand,&resultCurrentDemand))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE powerDiscovery*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultCurrentDemand.ResponseCode);
-		printEVSEStatus(&resultCurrentDemand.EVSEStatus);
-		printf("\tEVSEPresentVoltage.Value=%d\n",resultCurrentDemand.EVSEPresentVoltage.Value);
-		printf("\tEVSEPresentCurrent.Value=%d\n",resultCurrentDemand.EVSEPresentCurrent.Value);
-
-	}
-
-
-
-	/***********************
-	 * Call weldingDetection     *
-	 ***********************/
-	printf("\nPEV: call EVSE weldingDetection\n");
-	weldingDetection.PEVStatus = powerDelivery.PEVStatus;
-
-	if(call_weldingDetection(&service,&v2gHeader,&weldingDetection,&resultWeldingDetection))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE powerDiscovery*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultWeldingDetection.ResponseCode);
-		printEVSEStatus(&resultWeldingDetection.EVSEStatus);
-		printf("\tEVSEPresentVoltage=%d\n",resultWeldingDetection.EVSEPresentVoltage.Value);
-	}
-
-	/*************************
-	 * Call terminateCharging*
-	 *************************/
-	printf("\nPEV: call EVSE terminateCharging\n");
-	terminateCharging.PEVStatus = sessionSetup.PEVStatus;
-
-	if(call_terminateCharging(&service,&v2gHeader,&terminateCharging,&resultTerminateCharging))
-	{
-		printErrorMessage(&service);
-	}
-	else
-	{
-
-		/* show result of the answer message of EVSE powerDiscovery*/
-		printf("PEV: received response message from EVSE\n");
-		printf("\tResponseCode=%d\n",resultTerminateCharging.ResponseCode);
-		printEVSEStatus(&resultWeldingDetection.EVSEStatus);
-		printf("\tEVSEPresentVoltage.Value=%d\n",resultTerminateCharging.EVSEPresentVoltage.Value);
-	}
-
+	printf("\n+++Terminate V2G Client / Service Example+++");
 
 	return 0;
 }
 
-int main_service()
-{
-	printf("+++ Start V2G client / service example for AC charging +++\n\n");
-
-	ac_charging();
-
-	printf("\n+++Terminate V2G Client / Service example for AC charging +++\n");
-	printf("Please press enter for DC charging!\n");
-	fflush(stdout);
-	getchar();
-
-	printf("+++ Start V2G client / service example for DC charging +++\n\n");
-
-	dc_charging();
-
-	printf("\n+++Terminate V2G client / service example for DC charging +++");
-
-	return 0;
-}
-
-static void printEVSEStatus(struct EVSEStatusType* status)
-{
-	printf("\tEVSEStatus:\n\t\tConnectorLocked=%d\n",status->ConnectorLocked);
-	printf("\t\tEVSEStandby=%d\n",status->EVSEStandby);
-	printf("\t\tFatalError=%d\n",status->FatalError);
-	printf("\t\tPowerSwitchClosed=%d\n",status->PowerSwitchClosed);
-	printf("\t\tRCD=%d\n",status->RCD);
-	printf("\t\tChargerStandby=%d\n",status->ChargerStandby);
-	printf("\t\tEVSEMalfunction=%d\n",status->EVSEMalfunction);
-	printf("\t\tShutDownTime=%d\n",status->ShutDownTime);
-}
-
-static void printErrorMessage(struct EXIService* service)
+static void printErrorMessage(struct v2gService* service)
 {
-	if(service->errorCode==EXI_NON_VALID_MESSAGE)
+	if(service->errorCode==V2G_NON_VALID_MESSAGE)
 	{
 		printf("PEV did not send a valid V2G message!\n");
 	}
-	else if(service->errorCode==EXI_SERIALIZATION_FAILED)
+	else if(service->errorCode==V2G_SERIALIZATION_FAILED)
 	{
 		printf("EVSE error: Could not serialize the response message\n");
 	}

+ 5 - 5
src/test/v2g_server.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -32,15 +32,15 @@
 #define MAX_STRING_SIZE 256
 #define MAX_STREAM_SIZE 60
 
-int testV2GService(uint8_t* inStream, uint16_t inStreamLength, uint8_t* outStream, uint16_t* outStreamLength)
+int testV2GService(uint8_t* inStream, size_t inStreamLength, uint8_t* outStream, size_t* outStreamLength)
 {
 	static uint8_t byte_array[MAX_BYTE_SIZE]; /* define MAX_BYTE_SIZE before*/
 	static uint32_t string_array[MAX_STRING_SIZE]; /* define MAX_STRING_SIZE before*/
 
 
-	uint16_t exiMsgLength;
+	size_t exiMsgLength;
 
-	struct EXIService service;
+	struct v2gService service;
 
 	/* BINARY memory setup */
 	bytes_t bytes = { MAX_BYTE_SIZE, byte_array, 0 };

+ 3 - 3
src/test/v2g_server.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -28,6 +28,6 @@
 
 #include "EXITypes.h"
 
-int testV2GService(uint8_t* inStream, uint16_t inStreamLength, uint8_t* outStream,uint16_t* outStreamLength);
+int testV2GService(uint8_t* inStream, size_t inStreamLength, uint8_t* outStream,size_t* outStreamLength);
 
 #endif /* V2G_SERVER_H_ */

+ 5 - 5
src/test/v2g_serviceClientDataTransmitter.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -29,13 +29,13 @@
 
 /* This method has to be implemented!
  * Send EXI stream (outStream) to EVSE and receive response stream (inStream)*/
-int serviceDataTransmitter(uint8_t* outStream, uint16_t outStreamLength, uint8_t* inStream)
+int serviceDataTransmitter(uint8_t* outStream, size_t outStreamLength, uint8_t* inStream)
 {
 	/* send output stream to the underlying network to the EVSE and wait for response
 	 * --> here provide data to the V2G server directly*/
 
-	uint16_t inStreamLength = 0;
-	uint16_t payloadLength = 0;
+	size_t inStreamLength = 0;
+	size_t payloadLength = 0;
 
 	/* setup DoIP header information; outStreamLength==payloadLength*/
 	write_doIPHeader(outStream,&outStreamLength,DOIP_EXI_TYPE);

+ 11 - 293
src/test/v2g_serviceMethods.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -18,7 +18,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -31,27 +31,26 @@
 
 int	sessionSetup(struct SessionSetupReqType* param, struct SessionSetupResType* result)
 {
+
 	printf("EVSE: sessionSetup called\n"  );
 	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
+	printf("\t\t PEVStatus ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
+	printf("\t\t PEVStatus ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
 
 	/* Prepare data for PEV */
-	result->ResponseCode = OK_SessionSetup_responseCode_SessionSetupType;
-	result->EVSEID.data[0]=1;
+	result->ResponseCode = OK_SessionSetup;
+	result->EVSEID.data[0]='E';
 	result->EVSEID.arraylen.data=1;
 	result->EVSEStatus.ConnectorLocked=0;
 	result->EVSEStatus.EVSEStandby=1;
 	result->EVSEStatus.FatalError=0;
 	result->EVSEStatus.PowerSwitchClosed=1;
 	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345678;
-	result->EVSEStatus.ChargerStandby = 1;
-	result->EVSEStatus.EVSEMalfunction = 0;
-	result->TCurrent=12345678;
+	result->EVSEStatus.ShutDownTime=12345678L;
+	result->TCurrent=12345678L;
 
 	return 0;
+
 }
 
 int	serviceDiscovery(struct ServiceDiscoveryReqType* param, struct ServiceDiscoveryResType* result)
@@ -69,309 +68,28 @@ int	paymentDetails(struct PaymentDetailsReqType* param, struct PaymentDetailsRes
 	return 0;
 }
 
-int	chargeParameterDiscovery(struct ChargeParameterDiscoveryReqType* param, struct ChargeParameterDiscoveryResType* result)
+int	powerDiscovery(struct PowerDiscoveryReqType* param, struct PowerDiscoveryResType* result)
 {
-	printf("EVSE: chargeParameterDiscovery called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-
-	if(param->ChargingMode==AC_charging_chargingModeType)
-		printf("\t\t ChargingMode=AC_charging\n");
-	else
-		printf("\t\t ChargingMode=DC_charging\n");
-
-	printf("\t\t Eoc=%d\n", param->EoC);
-	printf("\t\t EAmount=%d\n", param->EAmount.Value);
-	printf("\t\t PEVMaxPower=%d\n", param->PEVMaxPower.Value);
-	printf("\t\t PEVMaxPhases=%d\n", param->PEVMaxPhases);
-	printf("\t\t PEVMaxVoltage=%d\n", param->PEVMaxVoltage.Value);
-	printf("\t\t PEVMinVoltage=%d\n", param->PEVMinVoltage.Value);
-
-
-	if(param->ChargingMode==DC_charging_chargingModeType)
-	{
-		printf("\t\t PEVMaxCurrent=%d\n", param->PEVMaxCurrent.Value);
-		printf("\t\t PEVMinCurrent=%d\n", param->PEVMinCurrent.Value);
-	}
-
-	result->ResponseCode = 0;
-	result->EVSEStatus.ConnectorLocked=0;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.PowerSwitchClosed=0;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345;
-	result->EVSEStatus.ChargerStandby = 1;
-	result->EVSEStatus.EVSEMalfunction = 0;
-	result->EVSEMaxVoltage.Multiplier = 0;
-	result->EVSEMaxVoltage.Unit = V_unitSymbolType;
-	result->EVSEMaxVoltage.Value = 950;
-	result->EVSEMaxPhases = 3;
-
-	/* only for DC charging */
-	result->EVSEMaxCurrent.Multiplier = 0;
-	result->EVSEMaxCurrent.Unit = A_unitSymbolType;
-	result->EVSEMaxCurrent.Value = 10;
-	result->EVSEMinCurrent.Multiplier = 0;
-	result->EVSEMinCurrent.Unit = A_unitSymbolType;
-	result->EVSEMinCurrent.Value = 2;
-
-
-	result->isused.EnergyProvider=0;
-	/*result->EnergyProvider.arraylen.data=1;
-	result->EnergyProvider.data[0]=11; */
-	result->isused.TariffTable = 0;
 
 	return 0;
 }
 
 int	lineLock(struct LineLockReqType* param, struct LineLockResType* result)
 {
-	printf("EVSE: lineLock called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-	printf("\t\t ReqLockStatus=%d\n", param->ReqLockStatus);
-
-	result->ResponseCode = 0;
-	result->EVSEStatus.ConnectorLocked=0;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.PowerSwitchClosed=1;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345;
-	result->EVSEStatus.ChargerStandby = 1;
-	result->EVSEStatus.EVSEMalfunction = 0;
-
 	return 0;
 }
 
 int	powerDelivery(struct PowerDeliveryReqType* param, struct PowerDeliveryResType* result)
 {
-	printf("EVSE: powerDelivery called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-
-	result->ResponseCode=0;
-	result->EVSEStatus.ConnectorLocked=0;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.PowerSwitchClosed=1;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345;
-	result->EVSEStatus.ChargerStandby = 1;
-	result->EVSEStatus.EVSEMalfunction = 0;
-
 	return 0;
 }
 
 int	meteringStatus(struct MeteringStatusReqType* param, struct MeteringStatusResType* result)
 {
-	printf("EVSE: meteringStatus called\n"  );
-
-	result->ResponseCode=1;
-	result->EVSEID.data[0]=1;
-	result->EVSEID.arraylen.data=1;
-	result->EVSEStatus.ConnectorLocked=1;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.PowerSwitchClosed=1;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345678;
-	result->EVSEStatus.EVSEMalfunction = 0;
-	result->EVSEStatus.ChargerStandby = 1;
-	result->TCurrent=12345678;
-	result->EVSEMaxPower.Multiplier = 2;
-	result->EVSEMaxPower.Unit = A_unitSymbolType;
-	result->EVSEMaxPower.Value = 400;
-
-	result->isused.MeterInfo=1;
-	result->MeterInfo.MeterID.arraylen.data=1;
-	result->MeterInfo.MeterID.data[0]=2;
-	result->MeterInfo.MeterReading.Multiplier = 0;
-	result->MeterInfo.MeterReading.Unit = A_unitSymbolType;
-	result->MeterInfo.MeterReading.Value = 500;
-	result->MeterInfo.MeterStatus = 4321;
-	result->MeterInfo.TMeter =123456789;
-	result->MeterInfo.isused.MeterID=1;
-	result->MeterInfo.isused.MeterReading = 1;
-	result->MeterInfo.isused.MeterStatus=1;
-	result->MeterInfo.isused.TMeter=1;
-
-	result->isused.PCurrent=1;
-	result->PCurrent.Value=4321;
-
 	return 0;
 }
 
 int	meteringReceipt(struct MeteringReceiptReqType* param, struct MeteringReceiptResType* result)
 {
-
-	printf("EVSE: meteringReceipt called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-	printf("\t\t TCurrent=%d\n", param->TCurrent);
-	printf("\t\t MeterInfo.MeterStatus=%d\n", param->MeterInfo.MeterStatus);
-	printf("\t\t MeterInfo.MeterID=%d\n",		param->MeterInfo.MeterID.data[0]);
-	printf("\t\t MeterInfo.isused.MeterReading=%d\n", param->MeterInfo.isused.MeterReading);
-	printf("\t\t MeterReading.Value=%d\n",		param->MeterInfo.MeterReading.Value);
-	printf("\t\t MeterInfo.TMeter=%d\n",		param->MeterInfo.TMeter);
-	if(param->Tariff==Green_charge_tariffIDType)
-		printf("\t\t Tariff==Green_charge_tariffIDType\n");
-	result->ResponseCode = 0;
-
-	return 0;
-}
-
-int	cableCheck(struct CableCheckReqType* param, struct CableCheckResType* result)
-{
-	printf("EVSE: cableCheck called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-
-	result->EVSEStatus.ConnectorLocked=1;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.PowerSwitchClosed=1;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345678;
-	result->EVSEStatus.EVSEMalfunction = 0;
-	result->EVSEStatus.ChargerStandby = 1;
-
-	result->ResponseCode = OK_responseCode_CableCheckType;
-
 	return 0;
 }
-
-
-int	preCharge(struct PreChargeReqType* param, struct PreChargeResType* result)
-{
-	struct FloatingValueType float_type;
-	float_type.Multiplier = 0;
-	float_type.Unit = V_unitSymbolType;
-
-	printf("EVSE: currentDemand called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-
-	printf("\t\t PEVDemandCurrent=%d\n",param->PEVDemandCurrent.Value);
-	printf("\t\t PEVTargetVoltage=%d\n", param->PEVTargetVoltage.Value);
-
-	result->ResponseCode=OK_responseCode_CurrentDemandType;
-	result->EVSEStatus.ConnectorLocked=1;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.PowerSwitchClosed=1;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345678;
-	result->EVSEStatus.ChargerStandby=1;
-	result->EVSEStatus.EVSEMalfunction=0;
-	result->EVSEStatus.StopCharging=0;
-
-	float_type.Value = 800;
-
-	result->EVSEPresentVoltage = float_type;
-
-
-	return 0;
-
-
-}
-
-int	currentDemand(struct CurrentDemandReqType* param, struct CurrentDemandResType* result)
-{
-	struct FloatingValueType float_type;
-	float_type.Multiplier = 0;
-
-	printf("EVSE: currentDemand called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-
-	printf("\t\t PEVDemandCurrent=%d\n",param->PEVDemandCurrent.Value);
-	printf("\t\t PEVTargetVoltage=%d\n", param->PEVTargetVoltage.Value);
-
-	result->EVSEStatus.ConnectorLocked=1;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.PowerSwitchClosed=1;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345678;
-	result->EVSEStatus.ChargerStandby=1;
-	result->EVSEStatus.EVSEMalfunction=0;
-	result->EVSEStatus.StopCharging=0;
-	result->ResponseCode=OK_responseCode_CurrentDemandType;
-
-	float_type.Unit = A_unitSymbolType;
-	float_type.Value = 40;
-	result->EVSEPresentCurrent = float_type;
-
-	float_type.Unit = V_unitSymbolType;
-	float_type.Value = 700;
-	result->EVSEPresentVoltage = float_type;
-
-	return 0;
-}
-
-int	weldingDetection(struct WeldingDetectionReqType* param, struct WeldingDetectionResType* result)
-{
-	struct FloatingValueType float_type;
-	float_type.Multiplier = 0;
-	float_type.Unit = V_unitSymbolType;
-	float_type.Value = 0;
-
-	printf("EVSE: weldingDetection called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-
-	result->ResponseCode = OK_responseCode_WeldingDetectionType;
-
-	result->EVSEStatus.ConnectorLocked=1;
-	result->EVSEStatus.EVSEStandby=1;
-	result->EVSEStatus.FatalError=0;
-	result->EVSEStatus.PowerSwitchClosed=1;
-	result->EVSEStatus.RCD=1;
-	result->EVSEStatus.ShutDownTime=12345678;
-	result->EVSEStatus.ChargerStandby=1;
-	result->EVSEStatus.EVSEMalfunction=0;
-	result->EVSEStatus.StopCharging=0;
-
-	result->EVSEPresentVoltage=float_type;
-
-	return 0;
-}
-
-int	terminateCharging(struct TerminateChargingReqType* param, struct TerminateChargingResType* result)
-{
-	struct FloatingValueType float_type;
-	float_type.Multiplier = 	0;
-	float_type.Unit = V_unitSymbolType;
-	float_type.Value =0;
-
-	printf("EVSE: terminateCharging called\n"  );
-	printf("\tReceived data:\n");
-	printf("\t\t PEVStatus:\n\t\t\t ChargerStandby=%d\n",param->PEVStatus.ChargerStandby);
-	printf("\t\t\t ConnectorLocked=%d\n", param->PEVStatus.ConnectorLocked);
-	printf("\t\t\t ReadyToCharge=%d\n", param->PEVStatus.ReadyToCharge);
-
-	result->EVSEPresentVoltage = float_type;
-	result->ResponseCode = OK_responseCode_TerminateChargingType;
-
-
-	return 0;
-
-}

+ 5 - 5
src/transport/doIP.c

@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -19,7 +19,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -39,7 +39,7 @@
 
 #include "doIP.h"
 
-int write_doIPNack(uint8_t* outStream, uint16_t* outStreamLength, uint8_t nackCode)
+int write_doIPNack(uint8_t* outStream, uint32_t* outStreamLength, uint8_t nackCode)
 {
 /*	if(outStreamLength<DOIP_HEADER_LENGTH+1)
 		return -1;*/
@@ -53,7 +53,7 @@ int write_doIPNack(uint8_t* outStream, uint16_t* outStreamLength, uint8_t nackCo
 	return 0;
 }
 
-int write_doIPHeader(uint8_t* outStream, uint16_t* outStreamLength, uint16_t payloadType)
+int write_doIPHeader(uint8_t* outStream, uint32_t* outStreamLength, uint16_t payloadType)
 {
 
 	/* write DoIP version number 1=byte */
@@ -79,7 +79,7 @@ int write_doIPHeader(uint8_t* outStream, uint16_t* outStreamLength, uint16_t pay
 	return 0;
 }
 
-int read_doIPHeader(uint8_t* inStream, uint16_t inStreamLength, uint16_t* payloadLength)
+int read_doIPHeader(uint8_t* inStream, size_t inStreamLength, uint32_t* payloadLength)
 {
 	uint16_t payloadType=0;
 

+ 5 - 5
src/transport/doIP.h

@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2007-2011 Siemens AG
+ * Copyright (C) 2007-2010 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
@@ -19,7 +19,7 @@
 /*******************************************************************
  *
  * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.4
+ * @version 0.3
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/
@@ -55,11 +55,11 @@ extern "C" {
 
 
 /* DoIP methods */
-int write_doIPNack(uint8_t* outStream, uint16_t* outStreamLength, uint8_t nackCode);
+int write_doIPNack(uint8_t* outStream, uint32_t* outStreamLength, uint8_t nackCode);
 
-int write_doIPHeader(uint8_t* outStream, uint16_t* outStreamLength, uint16_t payloadType);
+int write_doIPHeader(uint8_t* outStream, uint32_t* outStreamLength, uint16_t payloadType);
 
-int read_doIPHeader(uint8_t* inStream, uint16_t inStreamLength, uint16_t* payloadLength);
+int read_doIPHeader(uint8_t* inStream, size_t inStreamLength, uint32_t* payloadLength);
 
 #endif /* DOIP_H_ */
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio