Pārlūkot izejas kodu

* initial check-in for 15118:2:2016
* fix for https://sourceforge.net/p/openv2g/tickets/5/

git-svn-id: https://svn.code.sf.net/p/openv2g/code/trunk@98 d9f2db14-54d0-4bde-b00c-16405c910529

daniel_peintner 8 gadi atpakaļ
vecāks
revīzija
be7e03c52e
49 mainītis faili ar 3261 papildinājumiem un 3487 dzēšanām
  1. 6 18
      Debug/src/codec/subdir.mk
  2. 30 0
      Debug/src/din/subdir.mk
  3. 30 0
      Debug/src/xmldsig/subdir.mk
  4. 9 2
      README.txt
  5. 6 18
      Release/src/codec/subdir.mk
  6. 30 0
      Release/src/din/subdir.mk
  7. 30 0
      Release/src/xmldsig/subdir.mk
  8. 7 8
      data/sessionSetupReq.xml
  9. BIN
      data/sessionSetupReq.xml.exi
  10. 7 8
      data/sessionSetupRes.xml
  11. BIN
      data/sessionSetupRes.xml.exi
  12. 1 4
      src/appHandshake/appHandEXIDatatypesDecoder.c
  13. 0 77
      src/codec/BitDecoderChannel.c
  14. 0 92
      src/codec/BitEncoderChannel.c
  15. 5 5
      src/codec/BitInputStream.c
  16. 3 3
      src/codec/BitInputStream.h
  17. 5 5
      src/codec/BitOutputStream.c
  18. 3 3
      src/codec/BitOutputStream.h
  19. 0 93
      src/codec/ByteDecoderChannel.c
  20. 0 143
      src/codec/ByteEncoderChannel.c
  21. 4 4
      src/codec/ByteStream.c
  22. 4 4
      src/codec/ByteStream.h
  23. 151 161
      src/codec/DecoderChannel.c
  24. 35 14
      src/codec/DecoderChannel.h
  25. 2 2
      src/codec/EXIConfig.h
  26. 2 2
      src/codec/EXIHeaderDecoder.c
  27. 2 2
      src/codec/EXIHeaderDecoder.h
  28. 2 2
      src/codec/EXIHeaderEncoder.c
  29. 2 2
      src/codec/EXIHeaderEncoder.h
  30. 66 66
      src/codec/EXIOptions.h
  31. 46 42
      src/codec/EXITypes.h
  32. 122 158
      src/codec/EncoderChannel.c
  33. 15 13
      src/codec/EncoderChannel.h
  34. 2 2
      src/codec/ErrorCodes.h
  35. 3 3
      src/codec/MethodsBag.c
  36. 4 4
      src/codec/MethodsBag.h
  37. 1025 533
      src/codec/v2gEXIDatatypes.c
  38. 496 497
      src/codec/v2gEXIDatatypes.h
  39. 470 369
      src/codec/v2gEXIDatatypesDecoder.c
  40. 4 4
      src/codec/v2gEXIDatatypesDecoder.h
  41. 430 291
      src/codec/v2gEXIDatatypesEncoder.c
  42. 5 5
      src/codec/v2gEXIDatatypesEncoder.h
  43. 67 268
      src/din/dinEXIDatatypesDecoder.c
  44. 5 2
      src/test/main.c
  45. 2 2
      src/test/main.h
  46. 4 4
      src/test/main_databinder.c
  47. 115 548
      src/test/main_example.c
  48. 2 2
      src/transport/v2gtp.c
  49. 2 2
      src/transport/v2gtp.h

+ 6 - 18
Debug/src/codec/subdir.mk

@@ -4,51 +4,39 @@
 
 # Add inputs and outputs from these tool invocations to the build variables 
 C_SRCS += \
-../src/codec/AbstractDecoderChannel.c \
-../src/codec/AbstractEncoderChannel.c \
-../src/codec/BitDecoderChannel.c \
-../src/codec/BitEncoderChannel.c \
 ../src/codec/BitInputStream.c \
 ../src/codec/BitOutputStream.c \
-../src/codec/ByteDecoderChannel.c \
-../src/codec/ByteEncoderChannel.c \
 ../src/codec/ByteStream.c \
+../src/codec/DecoderChannel.c \
 ../src/codec/EXIHeaderDecoder.c \
 ../src/codec/EXIHeaderEncoder.c \
+../src/codec/EncoderChannel.c \
 ../src/codec/MethodsBag.c \
 ../src/codec/v2gEXIDatatypes.c \
 ../src/codec/v2gEXIDatatypesDecoder.c \
 ../src/codec/v2gEXIDatatypesEncoder.c 
 
 OBJS += \
-./src/codec/AbstractDecoderChannel.o \
-./src/codec/AbstractEncoderChannel.o \
-./src/codec/BitDecoderChannel.o \
-./src/codec/BitEncoderChannel.o \
 ./src/codec/BitInputStream.o \
 ./src/codec/BitOutputStream.o \
-./src/codec/ByteDecoderChannel.o \
-./src/codec/ByteEncoderChannel.o \
 ./src/codec/ByteStream.o \
+./src/codec/DecoderChannel.o \
 ./src/codec/EXIHeaderDecoder.o \
 ./src/codec/EXIHeaderEncoder.o \
+./src/codec/EncoderChannel.o \
 ./src/codec/MethodsBag.o \
 ./src/codec/v2gEXIDatatypes.o \
 ./src/codec/v2gEXIDatatypesDecoder.o \
 ./src/codec/v2gEXIDatatypesEncoder.o 
 
 C_DEPS += \
-./src/codec/AbstractDecoderChannel.d \
-./src/codec/AbstractEncoderChannel.d \
-./src/codec/BitDecoderChannel.d \
-./src/codec/BitEncoderChannel.d \
 ./src/codec/BitInputStream.d \
 ./src/codec/BitOutputStream.d \
-./src/codec/ByteDecoderChannel.d \
-./src/codec/ByteEncoderChannel.d \
 ./src/codec/ByteStream.d \
+./src/codec/DecoderChannel.d \
 ./src/codec/EXIHeaderDecoder.d \
 ./src/codec/EXIHeaderEncoder.d \
+./src/codec/EncoderChannel.d \
 ./src/codec/MethodsBag.d \
 ./src/codec/v2gEXIDatatypes.d \
 ./src/codec/v2gEXIDatatypesDecoder.d \

+ 30 - 0
Debug/src/din/subdir.mk

@@ -0,0 +1,30 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+C_SRCS += \
+../src/din/dinEXIDatatypes.c \
+../src/din/dinEXIDatatypesDecoder.c \
+../src/din/dinEXIDatatypesEncoder.c 
+
+OBJS += \
+./src/din/dinEXIDatatypes.o \
+./src/din/dinEXIDatatypesDecoder.o \
+./src/din/dinEXIDatatypesEncoder.o 
+
+C_DEPS += \
+./src/din/dinEXIDatatypes.d \
+./src/din/dinEXIDatatypesDecoder.d \
+./src/din/dinEXIDatatypesEncoder.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/din/%.o: ../src/din/%.c
+	@echo 'Building file: $<'
+	@echo 'Invoking: GCC C Compiler'
+	gcc -I"../src/codec" -I"../src/din" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -O0 -g3 -Wall -c -fmessage-length=0 -ansi -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+	@echo 'Finished building: $<'
+	@echo ' '
+
+

+ 30 - 0
Debug/src/xmldsig/subdir.mk

@@ -0,0 +1,30 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+C_SRCS += \
+../src/xmldsig/xmldsigEXIDatatypes.c \
+../src/xmldsig/xmldsigEXIDatatypesDecoder.c \
+../src/xmldsig/xmldsigEXIDatatypesEncoder.c 
+
+OBJS += \
+./src/xmldsig/xmldsigEXIDatatypes.o \
+./src/xmldsig/xmldsigEXIDatatypesDecoder.o \
+./src/xmldsig/xmldsigEXIDatatypesEncoder.o 
+
+C_DEPS += \
+./src/xmldsig/xmldsigEXIDatatypes.d \
+./src/xmldsig/xmldsigEXIDatatypesDecoder.d \
+./src/xmldsig/xmldsigEXIDatatypesEncoder.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/xmldsig/%.o: ../src/xmldsig/%.c
+	@echo 'Building file: $<'
+	@echo 'Invoking: GCC C Compiler'
+	gcc -I"../src/codec" -I"../src/din" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -O0 -g3 -Wall -c -fmessage-length=0 -ansi -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+	@echo 'Finished building: $<'
+	@echo ' '
+
+

+ 9 - 2
README.txt

@@ -1,12 +1,12 @@
 -------------------------------------------------------------------------
 OpenV2G - an open source project implementing the basic functionality of the ISO IEC 15118 vehicle to grid (V2G) communication interface 
-Version 0.9.3, released February 25, 2015
+Version 1.0.0alpha, released March/April ??, 2017
 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-2015 Siemens AG
+Copyright (C) 2007-2017 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
@@ -21,6 +21,13 @@ 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.9.3:
+-------------------------------------------------------------------------
+* Support for 15118-2-2016 XML schema
+* internal coding updates  
+
 -------------------------------------------------------------------------
 CHANGES from version 0.9.2:
 -------------------------------------------------------------------------

+ 6 - 18
Release/src/codec/subdir.mk

@@ -4,51 +4,39 @@
 
 # Add inputs and outputs from these tool invocations to the build variables 
 C_SRCS += \
-../src/codec/AbstractDecoderChannel.c \
-../src/codec/AbstractEncoderChannel.c \
-../src/codec/BitDecoderChannel.c \
-../src/codec/BitEncoderChannel.c \
 ../src/codec/BitInputStream.c \
 ../src/codec/BitOutputStream.c \
-../src/codec/ByteDecoderChannel.c \
-../src/codec/ByteEncoderChannel.c \
 ../src/codec/ByteStream.c \
+../src/codec/DecoderChannel.c \
 ../src/codec/EXIHeaderDecoder.c \
 ../src/codec/EXIHeaderEncoder.c \
+../src/codec/EncoderChannel.c \
 ../src/codec/MethodsBag.c \
 ../src/codec/v2gEXIDatatypes.c \
 ../src/codec/v2gEXIDatatypesDecoder.c \
 ../src/codec/v2gEXIDatatypesEncoder.c 
 
 OBJS += \
-./src/codec/AbstractDecoderChannel.o \
-./src/codec/AbstractEncoderChannel.o \
-./src/codec/BitDecoderChannel.o \
-./src/codec/BitEncoderChannel.o \
 ./src/codec/BitInputStream.o \
 ./src/codec/BitOutputStream.o \
-./src/codec/ByteDecoderChannel.o \
-./src/codec/ByteEncoderChannel.o \
 ./src/codec/ByteStream.o \
+./src/codec/DecoderChannel.o \
 ./src/codec/EXIHeaderDecoder.o \
 ./src/codec/EXIHeaderEncoder.o \
+./src/codec/EncoderChannel.o \
 ./src/codec/MethodsBag.o \
 ./src/codec/v2gEXIDatatypes.o \
 ./src/codec/v2gEXIDatatypesDecoder.o \
 ./src/codec/v2gEXIDatatypesEncoder.o 
 
 C_DEPS += \
-./src/codec/AbstractDecoderChannel.d \
-./src/codec/AbstractEncoderChannel.d \
-./src/codec/BitDecoderChannel.d \
-./src/codec/BitEncoderChannel.d \
 ./src/codec/BitInputStream.d \
 ./src/codec/BitOutputStream.d \
-./src/codec/ByteDecoderChannel.d \
-./src/codec/ByteEncoderChannel.d \
 ./src/codec/ByteStream.d \
+./src/codec/DecoderChannel.d \
 ./src/codec/EXIHeaderDecoder.d \
 ./src/codec/EXIHeaderEncoder.d \
+./src/codec/EncoderChannel.d \
 ./src/codec/MethodsBag.d \
 ./src/codec/v2gEXIDatatypes.d \
 ./src/codec/v2gEXIDatatypesDecoder.d \

+ 30 - 0
Release/src/din/subdir.mk

@@ -0,0 +1,30 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+C_SRCS += \
+../src/din/dinEXIDatatypes.c \
+../src/din/dinEXIDatatypesDecoder.c \
+../src/din/dinEXIDatatypesEncoder.c 
+
+OBJS += \
+./src/din/dinEXIDatatypes.o \
+./src/din/dinEXIDatatypesDecoder.o \
+./src/din/dinEXIDatatypesEncoder.o 
+
+C_DEPS += \
+./src/din/dinEXIDatatypes.d \
+./src/din/dinEXIDatatypesDecoder.d \
+./src/din/dinEXIDatatypesEncoder.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/din/%.o: ../src/din/%.c
+	@echo 'Building file: $<'
+	@echo 'Invoking: GCC C Compiler'
+	gcc -I"../src/codec" -I"../src/din" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+	@echo 'Finished building: $<'
+	@echo ' '
+
+

+ 30 - 0
Release/src/xmldsig/subdir.mk

@@ -0,0 +1,30 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables 
+C_SRCS += \
+../src/xmldsig/xmldsigEXIDatatypes.c \
+../src/xmldsig/xmldsigEXIDatatypesDecoder.c \
+../src/xmldsig/xmldsigEXIDatatypesEncoder.c 
+
+OBJS += \
+./src/xmldsig/xmldsigEXIDatatypes.o \
+./src/xmldsig/xmldsigEXIDatatypesDecoder.o \
+./src/xmldsig/xmldsigEXIDatatypesEncoder.o 
+
+C_DEPS += \
+./src/xmldsig/xmldsigEXIDatatypes.d \
+./src/xmldsig/xmldsigEXIDatatypesDecoder.d \
+./src/xmldsig/xmldsigEXIDatatypesEncoder.d 
+
+
+# Each subdirectory must supply rules for building sources it contributes
+src/xmldsig/%.o: ../src/xmldsig/%.c
+	@echo 'Building file: $<'
+	@echo 'Invoking: GCC C Compiler'
+	gcc -I"../src/codec" -I"../src/din" -I"../src/xmldsig" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+	@echo 'Finished building: $<'
+	@echo ' '
+
+

+ 7 - 8
data/sessionSetupReq.xml

@@ -1,16 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<v2gci_d:V2G_Message xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
- xmlns:v2gci_t="urn:iso:15118:2:2013:MsgDataTypes"
- xmlns:v2gci_d="urn:iso:15118:2:2013:MsgDef"
- xmlns:v2gci_h="urn:iso:15118:2:2013:MsgHeader"
- xmlns:v2gci_b="urn:iso:15118:2:2013:MsgBody"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<v2gci_d:V2G_Message xmlns:v2gci_b="urn:iso:15118:2:2016:MsgBody"
+    xmlns:ns2="urn:iso:15118:2:2016:MsgDataTypes"
+    xmlns:v2gci_h="urn:iso:15118:2:2016:MsgHeader"
+    xmlns:xmlsig="http://www.w3.org/2000/09/xmldsig#"
+    xmlns:v2gci_d="urn:iso:15118:2:2016:MsgDef">
     <v2gci_d:Header>
-        <v2gci_h:SessionID>00</v2gci_h:SessionID>
+        <v2gci_h:SessionID>0000000000000000</v2gci_h:SessionID>
     </v2gci_d:Header>
     <v2gci_d:Body>
         <v2gci_b:SessionSetupReq>
             <v2gci_b:EVCCID>01</v2gci_b:EVCCID>
         </v2gci_b:SessionSetupReq>
     </v2gci_d:Body>
-</v2gci_d:V2G_Message>
+</v2gci_d:V2G_Message>

BIN
data/sessionSetupReq.xml.exi


+ 7 - 8
data/sessionSetupRes.xml

@@ -1,17 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<v2gci_d:V2G_Message xmlns:v2gci_h="urn:iso:15118:2:2013:MsgHeader"
- xmlns:v2gci_b="urn:iso:15118:2:2013:MsgBody"
- xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
- xmlns:v2gci_t="urn:iso:15118:2:2013:MsgDataTypes"
- xmlns:v2gci_d="urn:iso:15118:2:2013:MsgDef"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<v2gci_d:V2G_Message xmlns:v2gci_b="urn:iso:15118:2:2016:MsgBody"
+    xmlns:ns2="urn:iso:15118:2:2016:MsgDataTypes"
+    xmlns:v2gci_h="urn:iso:15118:2:2016:MsgHeader"
+    xmlns:xmlsig="http://www.w3.org/2000/09/xmldsig#"
+    xmlns:v2gci_d="urn:iso:15118:2:2016:MsgDef">
     <v2gci_d:Header>
-        <v2gci_h:SessionID>010203040506</v2gci_h:SessionID>
+        <v2gci_h:SessionID>0000000000000010</v2gci_h:SessionID>
     </v2gci_d:Header>
     <v2gci_d:Body>
         <v2gci_b:SessionSetupRes>
             <v2gci_b:ResponseCode>OK</v2gci_b:ResponseCode>
-            <v2gci_b:EVSEID>ABC01234</v2gci_b:EVSEID>
+            <v2gci_b:EVSEID>1234567</v2gci_b:EVSEID>
             <v2gci_b:EVSETimeStamp>123456789</v2gci_b:EVSETimeStamp>
         </v2gci_b:SessionSetupRes>
     </v2gci_d:Body>

BIN
data/sessionSetupRes.xml.exi


+ 1 - 4
src/appHandshake/appHandEXIDatatypesDecoder.c

@@ -75,13 +75,10 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &appHandAppProtocolType->ProtocolNamespace.charactersLen);
-							if (errn == 0) {
-								errn =  (appHandAppProtocolType->ProtocolNamespace.charactersLen - 2) <= appHandAppProtocolType_ProtocolNamespace_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (appHandAppProtocolType->ProtocolNamespace.charactersLen >= 2) {
 									appHandAppProtocolType->ProtocolNamespace.charactersLen = (uint16_t)(appHandAppProtocolType->ProtocolNamespace.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, appHandAppProtocolType->ProtocolNamespace.charactersLen, appHandAppProtocolType->ProtocolNamespace.characters);
+									errn = decodeCharacters(stream, appHandAppProtocolType->ProtocolNamespace.charactersLen, appHandAppProtocolType->ProtocolNamespace.characters, appHandAppProtocolType_ProtocolNamespace_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;

+ 0 - 77
src/codec/BitDecoderChannel.c

@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2007-2015 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.9.3 
- * @contact Joerg.Heuer@siemens.com
- *
- * <p>Code generated by EXIdizer</p>
- * <p>Schema: V2G_CI_MsgDef.xsd</p>
- *
- *
- ********************************************************************/
-
-
-
-#include "DecoderChannel.h"
-#include "BitInputStream.h"
-#include "EXITypes.h"
-#include "ErrorCodes.h"
-
-#ifndef BIT_DECODER_CHANNEL_C
-#define BIT_DECODER_CHANNEL_C
-
-
-#if EXI_OPTION_ALIGNMENT == BIT_PACKED
-
-int decode(bitstream_t* stream, uint8_t* b) {
-	uint32_t bb;
-	int errn =  readBits(stream, 8, &bb);
-	if (errn == 0) {
-		if (bb > 256) {
-			errn = EXI_ERROR_UNEXPECTED_BYTE_VALUE;
-		} else {
-			*b = (uint8_t)bb;
-		}
-	}
-
-	return errn;
-}
-
-int decodeBoolean(bitstream_t* stream, int* b) {
-	uint32_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 errn = 0;
-	if (nbits == 0) {
-		*uint32 = 0;
-	} else {
-		errn= readBits(stream, nbits, uint32);
-	}
-	return errn;
-}
-
-#endif
-
-#endif
-

+ 0 - 92
src/codec/BitEncoderChannel.c

@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2007-2015 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.9.3 
- * @contact Joerg.Heuer@siemens.com
- *
- * <p>Code generated by EXIdizer</p>
- * <p>Schema: V2G_CI_MsgDef.xsd</p>
- *
- *
- ********************************************************************/
-
-
-
-#include "EncoderChannel.h"
-
-#include "EXIOptions.h"
-#include "BitOutputStream.h"
-#include "EXITypes.h"
-
-#ifndef BIT_ENCODER_CHANNEL_C
-#define BIT_ENCODER_CHANNEL_C
-
-#if EXI_OPTION_ALIGNMENT == BIT_PACKED
-
-
-int encode(bitstream_t* stream, uint8_t b) {
-	return writeBits(stream, 8, b);
-}
-
-/**
- * Encode a single boolean value. A false value is encoded as bit 0 and true
- * value is encode as bit 1.
- */
-int encodeBoolean(bitstream_t* stream, int b) {
-	uint8_t val = b ? 1 : 0;
-	return writeBits(stream, 1, val);
-}
-
-
-/**
- * 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 errn = 0;
-	if (nbits > 0) {
-		errn = writeBits(stream, nbits, val);
-	}
-	return errn;
-}
-
-/**
- * Flush underlying bit output stream.
- */
-int encodeFinish(bitstream_t* stream) {
-	return flush(stream);
-}
-
-
-#endif /* alignment */
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-

+ 5 - 5
src/codec/BitInputStream.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -64,7 +64,7 @@ static 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, uint32_t* b)
 {
 	int errn = readBuffer(stream);
 	if (errn == 0) {
@@ -75,7 +75,7 @@ int readBits(bitstream_t* stream, uint16_t num_bits, uint32_t* b)
 		} else {
 			/* read bits as much as possible */
 			*b = (uint32_t)(stream->buffer & (0xff >> (BITS_IN_BYTE - stream->capacity)));
-			num_bits = (uint16_t)(num_bits - stream->capacity);
+			num_bits = (num_bits - stream->capacity);
 			stream->capacity = 0;
 
 			/* read whole bytes */
@@ -83,7 +83,7 @@ int readBits(bitstream_t* stream, uint16_t num_bits, uint32_t* b)
 			{
 				errn = readBuffer(stream);
 				*b = ((*b) << BITS_IN_BYTE) | stream->buffer;
-				num_bits = (uint16_t)(num_bits - BITS_IN_BYTE);
+				num_bits = (num_bits - BITS_IN_BYTE);
 				stream->capacity = 0;
 			}
 

+ 3 - 3
src/codec/BitInputStream.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -57,7 +57,7 @@ extern "C" {
  * \return                  	Error-Code <> 0
  *
  */
-int readBits(bitstream_t* stream, uint16_t num_bits, uint32_t* b);
+int readBits(bitstream_t* stream, size_t num_bits, uint32_t* b);
 
 
 #ifdef __cplusplus

+ 5 - 5
src/codec/BitOutputStream.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -37,7 +37,7 @@
 #ifndef BIT_OUTPUT_STREAM_C
 #define BIT_OUTPUT_STREAM_C
 
-int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t val) {
+int writeBits(bitstream_t* stream, size_t nbits, uint32_t val) {
 	int errn = 0;
 	/*  is there enough space in the buffer */
 	if (nbits <= stream->capacity) {
@@ -67,7 +67,7 @@ int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t val) {
 		stream->buffer = (uint8_t)(stream->buffer << stream->capacity) |
 				( (uint8_t)(val >> (nbits - stream->capacity)) & (uint8_t)(0xff >> (BITS_IN_BYTE - stream->capacity)) );
 
-		nbits = (uint16_t)(nbits - stream->capacity);
+		nbits = (nbits - stream->capacity);
 #if EXI_STREAM == BYTE_ARRAY
 		if ((*stream->pos) >= stream->size) {
 			errn = EXI_ERROR_OUTPUT_STREAM_EOF;
@@ -84,7 +84,7 @@ int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t val) {
 
 		/* write whole bytes */
 		while (errn == 0 && nbits >= BITS_IN_BYTE) {
-			nbits = (uint16_t)(nbits - BITS_IN_BYTE);
+			nbits = (nbits - BITS_IN_BYTE);
 #if EXI_STREAM == BYTE_ARRAY
 			if ((*stream->pos) >= stream->size) {
 				errn = EXI_ERROR_OUTPUT_STREAM_EOF;

+ 3 - 3
src/codec/BitOutputStream.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -60,7 +60,7 @@ extern "C" {
  * \return                  	Error-Code <> 0
  *
  */
-int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t bits);
+int writeBits(bitstream_t* stream, size_t nbits, uint32_t bits);
 
 
 /**

+ 0 - 93
src/codec/ByteDecoderChannel.c

@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2007-2015 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.9.3 
- * @contact Joerg.Heuer@siemens.com
- *
- * <p>Code generated by EXIdizer</p>
- * <p>Schema: V2G_CI_MsgDef.xsd</p>
- *
- *
- ********************************************************************/
-
-
-
-#include "DecoderChannel.h"
-#include "EXIOptions.h"
-#include "BitInputStream.h"
-#include "EXITypes.h"
-#include "ErrorCodes.h"
-
-#ifndef BYTE_DECODER_CHANNEL_C
-#define BYTE_DECODER_CHANNEL_C
-
-
-#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
-
-int decode(bitstream_t* stream, uint8_t* b) {
-	int errn = 0;
-#if EXI_STREAM == BYTE_ARRAY
-	if ( (*stream->pos) < stream->size ) {
-		*b = stream->data[(*stream->pos)++];
-	} else {
-		errn = EXI_ERROR_INPUT_STREAM_EOF;
-	}
-#endif /* EXI_STREAM == BYTE_ARRAY */
-#if EXI_STREAM == FILE_STREAM
-	*b = (uint8_t)(getc(stream->file));
-	/* EOF cannot be used, 0xFF valid value */
-	if ( feof(stream->file) || ferror(stream->file) ) {
-		errn = EXI_ERROR_INPUT_STREAM_EOF;
-	}
-#endif /* EXI_STREAM == FILE_STREAM */
-
-	return errn;
-}
-
-int decodeBoolean(bitstream_t* stream, int* b) {
-	uint8_t bb;
-	int errn = decode(stream, &bb);
-	*b = (bb == 0) ? 0 : 1;
-	return errn;
-}
-
-/**
- * Decodes and returns an n-bit unsigned integer using the minimum number of
- * bytes required for n bits.
- */
-int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32) {
-	uint16_t bitsRead = 0;
-	uint8_t b;
-	int errn = 0;
-	*uint32 = 0;
-
-	while (errn == 0 && bitsRead < nbits) {
-		errn = decode(stream, &b);
-		*uint32 = *uint32 + (uint32_t)(b << bitsRead);
-		bitsRead = (uint16_t)(bitsRead + 8);
-	}
-
-	return errn;
-}
-
-#endif
-
-#endif
-

+ 0 - 143
src/codec/ByteEncoderChannel.c

@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2007-2015 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.9.3 
- * @contact Joerg.Heuer@siemens.com
- *
- * <p>Code generated by EXIdizer</p>
- * <p>Schema: V2G_CI_MsgDef.xsd</p>
- *
- *
- ********************************************************************/
-
-
-
-#include "EncoderChannel.h"
-
-#include "EXIOptions.h"
-#include "BitOutputStream.h"
-#include "EXITypes.h"
-#include "MethodsBag.h"
-#include "ErrorCodes.h"
-
-#ifndef BYTE_ENCODER_CHANNEL_C
-#define BYTE_ENCODER_CHANNEL_C
-
-#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
-
-
-int encode(bitstream_t* stream, uint8_t b) {
-	int errn = 0;
-#if EXI_STREAM == BYTE_ARRAY
-	if ( (*stream->pos) < stream->size ) {
-		stream->data[(*stream->pos)++] = b;
-	} else {
-		errn = EXI_ERROR_OUTPUT_STREAM_EOF;
-	}
-#endif /* EXI_STREAM == BYTE_ARRAY */
-#if EXI_STREAM == FILE_STREAM
-	if ( putc(b, stream->file) == EOF ) {
-		errn = EXI_ERROR_OUTPUT_STREAM_EOF;
-	}
-#endif /* EXI_STREAM == FILE_STREAM */
-	return errn;
-}
-
-/**
- * Encode a single boolean value. A false value is encoded as byte 0 and true
- * value is encode as byte 1.
- */
-int encodeBoolean(bitstream_t* stream, int b) {
-	uint8_t val = b ? 1 : 0;
-	return encode(stream, val);
-}
-
-
-/**
- * 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 errn = 0;
-	if (nbits > 0) {
-		if (nbits < 9) {
-			/* 1 byte */
-			errn = encode(stream, val & 0xff);
-		} else if (nbits < 17) {
-			/* 2 bytes */
-			errn = encode(stream, val & 0x00ff);
-			if(errn == 0) {
-				errn = encode(stream, (uint8_t)((val & 0xff00) >> 8));
-			}
-		} else if (nbits < 25) {
-			/* 3 bytes */
-			errn = encode(stream, val & 0x0000ff);
-			if(errn == 0) {
-				errn = encode(stream, (uint8_t)((val & 0x00ff00) >> 8));
-				if(errn == 0) {
-					errn = encode(stream, (uint8_t)((val & 0xff0000) >> 16));
-				}
-			}
-		} else if (nbits < 33) {
-			/* 4 bytes */
-			errn = encode(stream, val & 0x000000ff);
-			if(errn == 0) {
-				errn = encode(stream, (uint8_t)((val & 0x0000ff00) >> 8));
-				if(errn == 0) {
-					errn = encode(stream, (uint8_t)((val & 0x00ff0000) >> 16));
-					if(errn == 0) {
-						errn = encode(stream, (uint8_t)((val & 0xff000000) >> 24));
-					}
-				}
-			}
-		} else {
-			/* TODO Currently not more than 4 Bytes allowed for NBitUnsignedInteger */
-			errn = EXI_UNSUPPORTED_NBIT_INTEGER_LENGTH;
-		}
-	}
-	return errn;
-}
-
-
-/**
- * Flush underlying bit output stream.
- */
-#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'stream' */
-int encodeFinish(bitstream_t* stream) {
-	/* no pending bits in byte-aligned mode */
-	return 0;
-}
-#pragma warning( default : 4100 ) /* warning unreferenced parameter 'stream' */
-
-#endif /* alignment */
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-

+ 4 - 4
src/codec/ByteStream.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -41,7 +41,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;
 	int errn = 0;
@@ -65,7 +65,7 @@ int readBytesFromFile(const char * filename, uint8_t* data, uint16_t size, uint1
 	return errn;
 }
 
-int writeBytesToFile(uint8_t* data, uint16_t len, const char * filename) {
+int writeBytesToFile(uint8_t* data, size_t len, const char * filename) {
 	size_t rlen;
 	FILE* f = fopen(filename, "wb+");
 

+ 4 - 4
src/codec/ByteStream.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -53,7 +53,7 @@ extern "C" {
  * \return                  	Error-Code <> 0
  *
  */
-int writeBytesToFile(uint8_t* data, uint16_t len, const char * filename);
+int writeBytesToFile(uint8_t* data, size_t len, const char * filename);
 
 
 /**
@@ -66,7 +66,7 @@ int writeBytesToFile(uint8_t* data, uint16_t len, const char * filename);
  * \return                  	Error-Code <> 0
  *
  */
-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);
 
 #ifdef __cplusplus
 }

+ 151 - 161
src/codec/AbstractDecoderChannel.c → src/codec/DecoderChannel.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -43,8 +43,8 @@
 #include "DynamicMemory.h"
 #endif /* DYNAMIC_ALLOCATION */
 
-#ifndef ABSTRACT_DECODER_CHANNEL_C
-#define ABSTRACT_DECODER_CHANNEL_C
+#ifndef DECODER_CHANNEL_C
+#define DECODER_CHANNEL_C
 
 /* unsigned long == 64 bits, 10 * 7bits = 70 bits */
 #define MAX_OCTETS_FOR_UNSIGNED_INTEGER_64 10
@@ -209,6 +209,38 @@ int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32) {
 	return errn;
 }
 
+int decodeUnsignedIntegerSizeT(bitstream_t* stream, size_t* sizeT) {
+	int errn = 0;
+
+	/* TODO is there a better way to detect the actual size of size_t */
+	if(SIZE_MAX == UINT16_MAX) {
+		/* 16bit */
+		uint16_t uint16;
+		errn = decodeUnsignedInteger16(stream, &uint16);
+		if(errn == 0) {
+			*sizeT = (size_t)uint16;
+		}
+	} else if(SIZE_MAX == UINT32_MAX) {
+		/* 32bit */
+		uint32_t uint32;
+		errn = decodeUnsignedInteger32(stream, &uint32);
+		if(errn == 0) {
+			*sizeT = (size_t)uint32;
+		}
+	} else {
+		/* 64bit */
+		uint64_t uint64;
+		errn = decodeUnsignedInteger64(stream, &uint64);
+		if(errn == 0) {
+			*sizeT = (size_t)uint64;
+		}
+	}
+
+	return errn;
+}
+
+
+
 /**
  * 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
@@ -360,9 +392,9 @@ int decodeDecimal(bitstream_t* stream, exi_decimal_t* d) {
 /**
  * Decode a sequence of characters for a given length.
  */
-int decodeStringOnly(bitstream_t* stream, uint16_t len, exi_string_t* s) {
+int decodeStringOnly(bitstream_t* stream, size_t len, exi_string_t* s) {
 	int errn = 0;
-	int extraChar = 0;
+	unsigned int extraChar = 0;
 #if STRING_REPRESENTATION == STRING_REPRESENTATION_ASCII
 	extraChar = 1; /* null terminator */
 #endif /* STRING_REPRESENTATION_ASCII */
@@ -378,11 +410,11 @@ int decodeStringOnly(bitstream_t* stream, uint16_t len, exi_string_t* s) {
 				return errn;
 			}
 		}
-		errn = exiAllocateDynamicStringMemory(s, s->len);
+		errn = exiAllocateDynamicStringMemory(s, (len + extraChar)); /*s->len*/
 #endif /* DYNAMIC_ALLOCATION */
 	}
 	if(errn == 0) {
-		errn = decodeCharacters(stream, len, s->characters);
+		errn = decodeCharacters(stream, len, s->characters, s->size);
 		s->len = len;
 	}
 
@@ -393,165 +425,31 @@ int decodeStringOnly(bitstream_t* stream, uint16_t len, exi_string_t* s) {
  * Decode a length prefixed sequence of characters.
  */
 int decodeString(bitstream_t* stream, exi_string_t* s) {
-	int errn = decodeUnsignedInteger16(stream, &s->len);
+	int errn = decodeUnsignedIntegerSizeT(stream, &s->len);
 	if (errn == 0) {
 		errn = decodeStringOnly(stream, s->len, s);
 	}
 	return errn;
 }
 
-static int _readStringValueLocalHit(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, uint32_t* localID) {
-	int errn;
-	uint16_t codingLength;
-
-	if( state->stringTable.sizeLocalStrings > qnameID ) {
-		errn = exiGetCodingLength(state->stringTable.numberOfLocalStrings[qnameID], &codingLength);
-		if(errn == 0) {
-			errn = decodeNBitUnsignedInteger(stream, codingLength, localID);
-		}
-	} else {
-		errn = EXI_ERROR_OUT_OF_BOUNDS;
-	}
-
-	return errn;
-}
-
-
-static int _readStringValueGlobalHit(bitstream_t* stream, exi_state_t* state, uint32_t* globalID) {
-	int errn;
-	uint16_t codingLength;
-
-	errn = exiGetCodingLength(state->stringTable.numberOfGlobalStrings, &codingLength);
-	if(errn == 0) {
-		errn = decodeNBitUnsignedInteger(stream, codingLength, globalID);
-	}
-
-	return errn;
-}
-
-int decodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_string_value_t* s) {
-	uint16_t L;
-	int errn = decodeUnsignedInteger16(stream, &L);
-	if (errn == 0) {
-		switch (L) {
-		case 0:
-			/* local value partition */
-			s->type = EXI_STRING_VALUE_LOCAL_HIT;
-			errn = _readStringValueLocalHit(stream, state, qnameID, &s->localID);
-			break;
-		case 1:
-			/* found in global value partition */
-			s->type = EXI_STRING_VALUE_GLOBAL_HIT;
-			errn = _readStringValueGlobalHit(stream, state, &s->globalID);
-			break;
-		default:
-			/* not found in global value (and local value) partition
-			 * ==> string literal is encoded as a String with the length
-			 * incremented by two */
-			s->type = EXI_STRING_VALUE_MISS;
-			s->miss.len = L = (uint16_t)(L - 2);
-			errn = decodeStringOnly(stream, L, &(s->miss));
-			if(errn == 0) {
-#if EXI_OPTION_VALUE_PARTITION_CAPACITY != 0
-#if EXI_OPTION_VALUE_MAX_LENGTH != 0
-				/* If length L is greater than zero the string S is added */
-				if(L > 0) {
-					/* After encoding the string value, it is added to both the
-					 * associated "local" value string table partition and the global
-					 * value string table partition */
-#if EXI_OPTION_VALUE_MAX_LENGTH < 0
-				errn = exiAddStringValue(&state->stringTable, &(s->miss), qnameID);
-# else /* EXI_v2gVALUE_MAX_LENGTH < 0  */
-					if (L <= EXI_OPTION_VALUE_MAX_LENGTH) {
-						errn = exiAddStringValue(&state->stringTable, &(s->miss), qnameID);
-					}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH < 0  */
-				}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH != 0 */
-#endif /* EXI_OPTION_VALUE_PARTITION_CAPACITY != 0 */
-			}
-			break;
-		}
-	}
-
-	return errn;
-}
-
-int decodeRCSStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* s) {
-	unsigned int i;
-	uint32_t cp;
-	uint16_t L;
-	int errn = decodeUnsignedInteger16(stream, &L);
-	if (errn == 0) {
-		switch (L) {
-		case 0:
-			/* local value partition */
-			s->type = EXI_STRING_VALUE_LOCAL_HIT;
-			errn = _readStringValueLocalHit(stream, state, qnameID, &s->localID);
-			break;
-		case 1:
-			/* found in global value partition */
-			s->type = EXI_STRING_VALUE_GLOBAL_HIT;
-			errn = _readStringValueGlobalHit(stream, state, &s->globalID);
-			break;
-		default:
-			/* not found in global value (and local value) partition
-			 * ==> string literal is encoded as a String with the length
-			 * incremented by two */
-			s->type = EXI_STRING_VALUE_MISS;
-			s->miss.len = L = (uint16_t)(L - 2);
-
-			if (L > s->miss.size) {
-#if MEMORY_ALLOCATION == STATIC_ALLOCATION
-				errn = EXI_ERROR_OUT_OF_STRING_BUFFER;
-#endif /* STATIC_ALLOCATION */
-#if MEMORY_ALLOCATION == DYNAMIC_ALLOCATION
-				if(s->miss.size > 0) {
-					errn = exiFreeDynamicStringMemory(&(s->miss));
-				}
-				if(errn == 0) {
-					errn = exiAllocateDynamicStringMemory(&(s->miss), L);
-				}
-#endif /* DYNAMIC_ALLOCATION */
-			}
-			if(errn == 0) {
-				for (i = 0; i < L && errn >= 0; i++) {
-					errn = decodeNBitUnsignedInteger(stream, rcs->codingLength, &cp);
-					s->miss.characters[i] = rcs->characters[cp];
-				}
-#if EXI_OPTION_VALUE_PARTITION_CAPACITY != 0
-#if EXI_OPTION_VALUE_MAX_LENGTH != 0
-				/* If length L is greater than zero the string S is added */
-				if(errn == 0 && L > 0) {
-					/* After encoding the string value, it is added to both the
-					 * associated "local" value string table partition and the global
-					 * value string table partition */
-#if EXI_OPTION_VALUE_MAX_LENGTH < 0
-					errn = exiAddStringValue(&state->stringTable, &(s->miss), qnameID);
-# else /* EXI_OPTION_VALUE_MAX_LENGTH < 0  */
-					if (L <= EXI_OPTION_VALUE_MAX_LENGTH) {
-						errn = exiAddStringValue(&state->stringTable, &(s->miss), qnameID);
-					}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH < 0  */
-				}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH != 0 */
-#endif /* EXI_OPTION_VALUE_PARTITION_CAPACITY != 0 */
-			}
-			break;
-		}
-	}
-
-	return errn;
-}
-
 /**
  * Decode a sequence of characters according to a given length.
  * 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, exi_string_character_t* chars) {
+int decodeCharacters(bitstream_t* stream, size_t len, exi_string_character_t* chars, size_t charsSize) {
 	unsigned int i;
-	int errn = 0;
+	int errn = 0;
+
+	unsigned int extraChar = 0;
+#if STRING_REPRESENTATION == STRING_REPRESENTATION_ASCII
+	extraChar = 1; /* null terminator */
+#endif /* STRING_REPRESENTATION_ASCII */
+
+	if ( (len + extraChar) > charsSize) {
+		errn = EXI_ERROR_OUT_OF_STRING_BUFFER;
+		return errn;
+	}
 
 #if STRING_REPRESENTATION == STRING_REPRESENTATION_ASCII
 	uint8_t b;
@@ -579,13 +477,20 @@ int decodeCharacters(bitstream_t* stream, uint16_t len, exi_string_character_t*
 	return errn;
 }
 
-int decodeRCSCharacters(bitstream_t* stream, uint16_t len, exi_string_character_t* chars, uint16_t rcsCodeLength, uint16_t rcsSize, const exi_string_character_t rcsSet[]) {
+int decodeRCSCharacters(bitstream_t* stream, size_t len, exi_string_character_t* chars, size_t charsSize, size_t rcsCodeLength, size_t rcsSize, const exi_string_character_t rcsSet[]) {
 	unsigned int i;
 	int errn = 0;
 	uint32_t uint32;
-#if STRING_REPRESENTATION == STRING_REPRESENTATION_ASCII
-	uint8_t b;
-#endif /* STRING_REPRESENTATION_ASCII */
+	unsigned int extraChar = 0;
+#if STRING_REPRESENTATION == STRING_REPRESENTATION_ASCII
+	uint8_t b;
+	extraChar = 1; /* null terminator */
+#endif /* STRING_REPRESENTATION_ASCII */
+
+	if ( (len + extraChar) > charsSize) {
+		errn = EXI_ERROR_OUT_OF_STRING_BUFFER;
+		return errn;
+	}
 
 
 	for (i = 0; i < len && errn == 0; i++) {
@@ -625,7 +530,7 @@ int decodeRCSCharacters(bitstream_t* stream, uint16_t len, exi_string_character_
  * Decode a binary value as a length-prefixed sequence of octets.
  */
 int decodeBinary(bitstream_t* stream, exi_bytes_t* bytes) {
-	int errn = decodeUnsignedInteger16(stream, &bytes->len);
+	int errn = decodeUnsignedIntegerSizeT(stream, &bytes->len);
 	if (errn == 0) {
 		if (bytes->len > bytes->size) {
 #if MEMORY_ALLOCATION == STATIC_ALLOCATION
@@ -646,7 +551,7 @@ int decodeBinary(bitstream_t* stream, exi_bytes_t* bytes) {
 }
 
 
-int decodeBytes(bitstream_t* stream, uint16_t len, uint8_t* data) {
+int decodeBytes(bitstream_t* stream, size_t len, uint8_t* data) {
 	unsigned int i;
 	int errn = 0;
 	uint8_t b;
@@ -738,5 +643,90 @@ int decodeDateTime(bitstream_t* stream, exi_datetime_type_t type, exi_datetime_t
 	return errn;
 }
 
+
+
+int decode(bitstream_t* stream, uint8_t* b) {
+#if EXI_OPTION_ALIGNMENT == BIT_PACKED
+	uint32_t bb;
+	int errn =  readBits(stream, 8, &bb);
+	if (errn == 0) {
+		if (bb > 256) {
+			errn = EXI_ERROR_UNEXPECTED_BYTE_VALUE;
+		} else {
+			*b = (uint8_t)bb;
+		}
+	}
+
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BIT_PACKED */
+#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
+	int errn = 0;
+#if EXI_STREAM == BYTE_ARRAY
+	if ( (*stream->pos) < stream->size ) {
+		*b = stream->data[(*stream->pos)++];
+	} else {
+		errn = EXI_ERROR_INPUT_STREAM_EOF;
+	}
+#endif /* EXI_STREAM == BYTE_ARRAY */
+#if EXI_STREAM == FILE_STREAM
+	*b = (uint8_t)(getc(stream->file));
+	/* EOF cannot be used, 0xFF valid value */
+	if ( feof(stream->file) || ferror(stream->file) ) {
+		errn = EXI_ERROR_INPUT_STREAM_EOF;
+	}
+#endif /* EXI_STREAM == FILE_STREAM */
+
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT */
+}
+
+int decodeBoolean(bitstream_t* stream, int* b) {
+#if EXI_OPTION_ALIGNMENT == BIT_PACKED
+	uint32_t ub;
+	int errn = readBits(stream, 1, &ub);
+	*b = (ub == 0) ? 0 : 1;
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BIT_PACKED */
+#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
+	uint8_t bb;
+	int errn = decode(stream, &bb);
+	*b = (bb == 0) ? 0 : 1;
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT */
+
+}
+
+/**
+ * Decodes and returns an n-bit unsigned integer using the minimum number of
+ * bytes required for n bits.
+ */
+int decodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint32_t* uint32) {
+#if EXI_OPTION_ALIGNMENT == BIT_PACKED
+	int errn = 0;
+	if (nbits == 0) {
+		*uint32 = 0;
+	} else {
+		errn= readBits(stream, nbits, uint32);
+	}
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BIT_PACKED */
+#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
+	size_t bitsRead = 0;
+	uint8_t b;
+	int errn = 0;
+	*uint32 = 0;
+
+	while (errn == 0 && bitsRead < nbits) {
+		errn = decode(stream, &b);
+		*uint32 = *uint32 + (uint32_t)(b << bitsRead);
+		bitsRead = (bitsRead + 8);
+	}
+
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT */
+}
+
+
+
 #endif
 

+ 35 - 14
src/codec/DecoderChannel.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -81,7 +81,7 @@ int decodeBoolean(bitstream_t* stream, int* b);
  * \return                  	Error-Code <> 0
  *
  */
-int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32);
+int decodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint32_t* uint32);
 
 
 /**
@@ -132,6 +132,22 @@ int decodeUnsignedInteger16(bitstream_t* stream, uint16_t* uint16);
 int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32);
 
 
+/**
+ * \brief 		Decode unsigned integer
+ *
+ * 				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.
+ *
+ * \param       stream   		Input Stream
+ * \param       sizeT			Unsigned Integer Value (out)
+ * \return                  	Error-Code <> 0
+ *
+ */
+int decodeUnsignedIntegerSizeT(bitstream_t* stream, size_t* sizeT);
+
+
 /**
  * \brief 		Decode unsigned integer
  *
@@ -258,7 +274,7 @@ int decodeDecimal(bitstream_t* stream, exi_decimal_t* d);
  * \return                  	Error-Code <> 0
  *
  */
-int decodeStringOnly(bitstream_t* stream, uint16_t len, exi_string_t* s);
+int decodeStringOnly(bitstream_t* stream, size_t len, exi_string_t* s);
 
 
 /**
@@ -284,27 +300,30 @@ int decodeString(bitstream_t* stream, exi_string_t* s);
  * 				length > 1: string literal is encoded as a String with the length incremented by two
  *
  * \param       stream   		Input Stream
- * \param       state   		Codec state
+ * \param       stringTable   	String Table
  * \param       qnameID   		Qualified Name ID
+ * \param       namespaceUriID  Qualified Namespace ID
+ * \param       localNameID  	Qualified LocalName ID
  * \param       s			   	String Value (out)
  * \return                  	Error-Code <> 0
  *
  */
-int decodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_string_value_t* s);
+int decodeStringValue(bitstream_t* stream, exi_value_string_table_t* stringTable, size_t namespaceUriID, size_t localNameID, exi_string_value_t* s);
 
 
 /**
  * \brief 		Decode Restricted characters set string value
  *
  * \param       stream   		Input Stream
- * \param       state   		Codec state
- * \param       qnameID   		Qualified Name ID
+ * \param       stringTable   	StringTable
+ * \param       namespaceUriID  qualified namespace ID
+ * \param       localNameID   	qualified localName ID
  * \param       rcs		   		Restricted character set
  * \param       s			   	String Value (out)
  * \return                  	Error-Code <> 0
  *
  */
-int decodeRCSStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* s);
+int decodeRCSStringValue(bitstream_t* stream, exi_value_string_table_t* stringTable, size_t namespaceUriID, size_t localNameID, exi_rcs_t* rcs, exi_string_value_t* s);
 
 
 /**
@@ -314,11 +333,12 @@ int decodeRCSStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qname
  *
  * \param       stream   		Input Stream
  * \param       len		   		Length
- * \param       chars   		Characters (out)
+ * \param       chars   		Characters (out)
+ * \param       charsSize		Size of possible characters
  * \return                  	Error-Code <> 0
  *
  */
-int decodeCharacters(bitstream_t* stream, uint16_t len, exi_string_character_t* chars);
+int decodeCharacters(bitstream_t* stream, size_t len, exi_string_character_t* chars, size_t charsSize);
 
 
 /**
@@ -328,14 +348,15 @@ int decodeCharacters(bitstream_t* stream, uint16_t len, exi_string_character_t*
  *
  * \param       stream   		Input Stream
  * \param       len		   		Length
- * \param       chars   		Characters (out)
+ * \param       chars   		Characters (out)
+ * \param       charsSize		Size of possible characters
  * \param       rcsCodeLength   RCS code-length
  * \param       rcsCodeLength   RCS size
  * \param       rcsCodeLength   RCS set
  * \return                  	Error-Code <> 0
  *
  */
-int decodeRCSCharacters(bitstream_t* stream, uint16_t len, exi_string_character_t* chars, uint16_t rcsCodeLength, uint16_t rcsSize, const exi_string_character_t rcsSet[]);
+int decodeRCSCharacters(bitstream_t* stream, size_t len, exi_string_character_t* chars, size_t charsSize, size_t rcsCodeLength, size_t rcsSize, const exi_string_character_t rcsSet[]);
 
 
 
@@ -362,7 +383,7 @@ int decodeBinary(bitstream_t* stream, exi_bytes_t* bytes);
  * \return                  	Error-Code <> 0
  *
  */
-int decodeBytes(bitstream_t* stream, uint16_t len, uint8_t* data);
+int decodeBytes(bitstream_t* stream, size_t len, uint8_t* data);
 
 /**
  * \brief 		Decode DateTime

+ 2 - 2
src/codec/EXIConfig.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>

+ 2 - 2
src/codec/EXIHeaderDecoder.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>

+ 2 - 2
src/codec/EXIHeaderDecoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>

+ 2 - 2
src/codec/EXIHeaderEncoder.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>

+ 2 - 2
src/codec/EXIHeaderEncoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>

+ 66 - 66
src/codec/EXIOptions.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -27,67 +27,67 @@
  *
  ********************************************************************/
 
-
-
-/**
- * \file 	EXIOptions.h
- * \brief 	EXI Options for the EXI Codec
- *
- */
-
-#ifndef EXI_OPTIONS_H
-#define EXI_OPTIONS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/** EXI alignment - Option bit-packed */
-#define BIT_PACKED 1
-/** EXI alignment - Option byte-packed */
-#define BYTE_ALIGNMENT  2
-/** EXI alignment */
-/**
- * \brief 		EXI Option 'alignment'
- *
- *				The alignment option is used to control the alignment of event codes and content items.
- *				Default Value: bit-packed
- */
-#define EXI_OPTION_ALIGNMENT BIT_PACKED
-
-
-
-/**
- * \brief 		EXI Option 'strict'
- *
- *				Strict interpretation of schemas is used to achieve better compactness.
- *				Default Value: false
- */
-#define EXI_OPTION_STRICT 0
-
-
-/**
- * \brief 		EXI Option 'valueMaxLength'
- *
- *				Specifies the maximum string length of value content items to be
- *				considered for addition to the string table.
- *				Default Value: unbounded (-1)
- */
-#define EXI_OPTION_VALUE_MAX_LENGTH -1
-
-
-/**
- * \brief 		EXI Option 'valuePartitionCapacity'
- *
- *				Specifies the total capacity of value partitions in a string table.
- *				Default Value: unbounded (-1)
- */
-#define EXI_OPTION_VALUE_PARTITION_CAPACITY 0
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* EXI_OPTIONS_H */
+
+
+/**
+ * \file 	EXIOptions.h
+ * \brief 	EXI Options for the EXI Codec
+ *
+ */
+
+#ifndef EXI_OPTIONS_H
+#define EXI_OPTIONS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** EXI alignment - Option bit-packed */
+#define BIT_PACKED 1
+/** EXI alignment - Option byte-packed */
+#define BYTE_ALIGNMENT  2
+/** EXI alignment */
+/**
+ * \brief 		EXI Option 'alignment'
+ *
+ *				The alignment option is used to control the alignment of event codes and content items.
+ *				Default Value: bit-packed
+ */
+#define EXI_OPTION_ALIGNMENT BIT_PACKED
+
+
+
+/**
+ * \brief 		EXI Option 'strict'
+ *
+ *				Strict interpretation of schemas is used to achieve better compactness.
+ *				Default Value: false
+ */
+#define EXI_OPTION_STRICT 0
+
+
+/**
+ * \brief 		EXI Option 'valueMaxLength'
+ *
+ *				Specifies the maximum string length of value content items to be
+ *				considered for addition to the string table.
+ *				Default Value: unbounded (-1)
+ */
+#define EXI_OPTION_VALUE_MAX_LENGTH -1
+
+
+/**
+ * \brief 		EXI Option 'valuePartitionCapacity'
+ *
+ *				Specifies the total capacity of value partitions in a string table.
+ *				Default Value: unbounded (-1)
+ */
+#define EXI_OPTION_VALUE_PARTITION_CAPACITY 0
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EXI_OPTIONS_H */

+ 46 - 42
src/codec/EXITypes.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -43,6 +43,7 @@ extern "C" {
 #endif
 
 #include <stdint.h>
+#include <stdio.h>
 #include "EXIConfig.h"
 #if EXI_STREAM == FILE_STREAM
 #include <stdio.h>
@@ -157,11 +158,11 @@ typedef enum {
 typedef struct {
 #if EXI_STREAM == BYTE_ARRAY
 	/**	byte array size */
-	uint16_t size;
+	size_t size;
 	/**	byte array data */
 	uint8_t* data;
 	/**	byte array next position in array */
-	uint16_t* pos;
+	size_t* pos;
 #endif
 #if EXI_STREAM == FILE_STREAM
 	/** file pointer */
@@ -275,11 +276,11 @@ typedef uint32_t exi_string_character_t;
 /** \brief Universal Character Set (UCS) strings */
 typedef struct {
 	/** container size  */
-	uint16_t size;
+	size_t size;
 	/** string character container */
 	exi_string_character_t* characters;
 	/** current string length == number of code-points, (len <= size) */
-	uint16_t len;
+	size_t len;
 } exi_string_t;
 
 
@@ -290,16 +291,16 @@ typedef struct {
 	/** miss entry */
 	exi_string_t miss;
 	/** (local) hit entry */
-	uint32_t localID;
+	size_t localID;
 	/** (global) hit entry */
-	uint32_t globalID;
+	size_t globalID;
 } exi_string_value_t;
 
 
 /** \brief Restricted Characeter Set */
 typedef struct {
 	/** size */
-	uint16_t size;
+	size_t size;
 	/** rcs codepoints */
 	exi_string_character_t* characters;
 	/** character coding length (less than 256 characters) */
@@ -310,11 +311,11 @@ typedef struct {
 /** \brief Byte value container */
 typedef struct {
 	/** bytes array size */
-	uint16_t size;
+	size_t size;
 	/** bytes array data container */
 	uint8_t* data;
 	/** bytes array length (len <= size) */
-	uint16_t len;
+	size_t len;
 } exi_bytes_t;
 
 
@@ -391,7 +392,7 @@ typedef struct {
 	/** list item type */
 	exi_datatype_t type;
 	/** number of items */
-	uint16_t len;
+	size_t len;
 	/* Special datatype: integer */
 	/* exi_integer_type_t intType;*/
 	/** Special datatype: datetime */
@@ -402,9 +403,9 @@ typedef struct {
 /** \brief Efficient qname */
 typedef struct {
 	/** namespace URI ID*/
-	uint16_t namespaceURI;
+	size_t namespaceURI;
 	/** local name ID*/
-	uint16_t localPart;
+	size_t localPart;
 } exi_eqname_t;
 
 
@@ -422,7 +423,7 @@ typedef struct {
 	/** type */
 	exi_name_entry_type_t type;
 	/** entry ID */
-	uint16_t id;
+	size_t id;
 	/** entry string */
 	exi_string_t str;
 } exi_name_entry_t;
@@ -448,9 +449,9 @@ typedef struct {
 /* URI and LocalName Entries */
 typedef struct exiNameTablePrepopulated {
 	/* number of namespaces AND length name-partitions array */
-	uint16_t len;
+	size_t len;
 	/* number of localName entries divided by URI */
-	uint16_t * localNames;
+	size_t* localNames;
 } exi_name_table_prepopulated_t;
 
 #define EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_ENTRIES 25
@@ -461,13 +462,13 @@ typedef enum {
 
 typedef struct {
 	char* uri;
-	uint16_t uriID;
+	size_t uriID;
 } exi_uri_partition_t;
 
 typedef struct {
 	char* localName;
-	uint16_t localNameID;
-	uint16_t uriID;
+	size_t localNameID;
+	size_t uriID;
 } exi_localname_partition_t;
 
 typedef struct {
@@ -487,16 +488,17 @@ typedef struct exiNameTableRuntime {
 			namePartitionsEntries[EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_ENTRIES];
 	/* uint16_t numberOfUsedNamePartitions; *//* initially zero */
 	/* added entries */
-	uint16_t addedUriEntries; /* initially zero */
-	uint16_t addedLocalNameEntries; /* initially zero */
+	size_t addedUriEntries; /* initially zero */
+	size_t addedLocalNameEntries; /* initially zero */
 } exi_name_table_runtime_t;
 
 
 /* StartTagContent grammar initially empty */
 /* ElementContent grammar has EE per default */
 typedef struct {
-	uint16_t qnameID;
-	uint16_t numberOfProductions;
+	size_t namespaceUriID;
+	size_t localNameID;
+	size_t numberOfProductions;
 	int hasXsiType; /* StartTagContent only */
 	int hasEE; /* ElementContentper default TRUE */
 } exi_runtime_element_t;
@@ -509,58 +511,60 @@ typedef struct {
 /* ==================================== */
 /* Value string table */
 typedef struct exiValueStringTableEntry {
-	/** Qualified name ID */
-	uint16_t qnameID;
+	/** Qualified namespace URI */
+	size_t namespaceUriID;
+	/** Qualified localName */
+	size_t localNameID;
 	/** Local Value ID */
-	uint16_t localValueID;
+	size_t localValueID;
 	/** String */
 	exi_string_t str;
 } exi_value_string_table_entry_t;
 
 typedef struct exiValueStringTable {
 	/** maximum number of global string table entry size */
-	uint16_t size;
+	size_t size;
 	/** string table entry array container */
 	exi_value_string_table_entry_t* strs;
 	/** current number of string table entries (len <= size) */
-	uint16_t len;
+	size_t len;
 } exi_value_string_table_t;
 
-typedef struct {
+/* typedef struct { */
 	/** number of global strings */
-	uint16_t numberOfGlobalStrings;
+	/* uint16_t numberOfGlobalStrings; */
 	/** size of local-names container */
-	uint16_t sizeLocalStrings;
+	/* uint16_t sizeLocalStrings; */
 	/** number of local strings container */
-	uint16_t* numberOfLocalStrings;
+	/* uint16_t* numberOfLocalStrings; */
 	/** string values */
-	exi_value_string_table_t* valueStringTable;
-} exi_value_table_t;
+/*	exi_value_string_table_t* valueStringTable;
+} exi_value_table_t;*/
 
 typedef struct {
 	/** stack of grammar states */
 	int16_t grammarStack[EXI_ELEMENT_STACK_SIZE];
 	/** stack of grammar elements / qnameIDs */
-	uint16_t elementStack[EXI_ELEMENT_STACK_SIZE];
+	exi_eqname_t elementStack[EXI_ELEMENT_STACK_SIZE];
 	/** stack index for both stacks */
-	uint16_t stackIndex;
+	size_t stackIndex;
 
 	/** event-code */
 	uint32_t eventCode;
 
 	/** name table entries, pre-populated */
-	exi_name_table_prepopulated_t nameTablePrepopulated;
+	exi_name_table_prepopulated_t* nameTablePrepopulated;
 	/** name table entries, at runtime */
-	exi_name_table_runtime_t nameTableRuntime;
+	exi_name_table_runtime_t* nameTableRuntime;
 
 	/** next qname ID */
-	uint16_t nextQNameID;
+	size_t nextQNameID;
 
 	/** string table entries */
-	exi_value_table_t stringTable;
+	exi_value_string_table_t* stringTable;
 
 	/** runtime built-in element grammars - numbers */
-	uint16_t numberOfRuntimeGrammars;
+	size_t numberOfRuntimeGrammars;
 	/** runtime built-in element grammars */
 	exi_runtime_element_t runtimeGrammars[MAX_NUMBER_OF_RUNTIME_ELEMENTS * 2];
 } exi_state_t;

+ 122 - 158
src/codec/AbstractEncoderChannel.c → src/codec/EncoderChannel.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -37,8 +37,8 @@
 #include "MethodsBag.h"
 /*#include "v2gEXICoder.h"*/
 
-#ifndef ABSTRACT_ENCODER_CHANNEL_C
-#define ABSTRACT_ENCODER_CHANNEL_C
+#ifndef ENCODER_CHANNEL_C
+#define ENCODER_CHANNEL_C
 
 int encodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv) {
 	int errn = 0;
@@ -359,158 +359,12 @@ int encodeString(bitstream_t* stream, exi_string_t* string) {
 	return errn;
 }
 
-static int _writeStringValueLocalHit(bitstream_t* stream, exi_state_t* state,
-		uint16_t qnameID, uint32_t localID) {
-	int errn;
-	uint16_t codingLength;
-
-	if(state->stringTable.sizeLocalStrings > qnameID) {
-		errn = exiGetCodingLength(state->stringTable.numberOfLocalStrings[qnameID],
-				&codingLength);
-		if (errn == 0) {
-			errn = encodeNBitUnsignedInteger(stream, codingLength, localID);
-		}
-	} else {
-		errn = EXI_ERROR_OUT_OF_BOUNDS;
-	}
-
-	return errn;
-}
-
-static int _writeStringValueGlobalHit(bitstream_t* stream, exi_state_t* state,
-		uint32_t globalID) {
-	int errn;
-	uint16_t codingLength;
-
-	errn = exiGetCodingLength(state->stringTable.numberOfGlobalStrings, &codingLength);
-	if (errn == 0) {
-		errn = encodeNBitUnsignedInteger(stream, codingLength, globalID);
-	}
-
-	return errn;
-}
-
-int encodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
-		exi_string_value_t* string) {
-	int errn;
-
-	switch (string->type) {
-	case EXI_STRING_VALUE_LOCAL_HIT:
-		errn = encodeUnsignedInteger32(stream, 0);
-		if (errn == 0) {
-			errn = _writeStringValueLocalHit(stream, state, qnameID,
-					string->localID);
-		}
-		break;
-	case EXI_STRING_VALUE_GLOBAL_HIT:
-		errn = encodeUnsignedInteger32(stream, 1);
-		if (errn == 0) {
-			errn = _writeStringValueGlobalHit(stream, state, string->globalID);
-		}
-		break;
-	case EXI_STRING_VALUE_MISS:
-		/* encode string as string table miss */
-		errn = encodeUnsignedInteger32(stream, (uint32_t)(string->miss.len + 2));
-		if (errn == 0) {
-			errn = encodeCharacters(stream, string->miss.characters,
-					string->miss.len);
-			if (errn == 0) {
-#if EXI_OPTION_VALUE_PARTITION_CAPACITY != 0
-#if EXI_OPTION_VALUE_MAX_LENGTH != 0
-				/* If length L is greater than zero the string S is added */
-				if (string->miss.len > 0) {
-					/* After encoding the string value, it is added to both the
-					 * associated "local" value string table partition and the global
-					 * value string table partition */
-#if EXI_OPTION_VALUE_MAX_LENGTH < 0
-			errn = exiAddStringValue(&state->stringTable, &(string->miss), qnameID);
-# else /* EXI_OPTION_VALUE_MAX_LENGTH < 0  */
-					if (string->miss.len <= EXI_OPTION_VALUE_MAX_LENGTH) {
-						errn = exiAddStringValue(&state->stringTable, &(string->miss),
-								qnameID);
-					}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH < 0  */
-				}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH != 0 */
-#endif /* EXI_OPTION_VALUE_PARTITION_CAPACITY != 0 */
-			}
-		}
-		break;
-	default:
-		errn = EXI_UNSUPPORTED_STRING_VALUE_TYPE;
-		break;
-	}
-
-	return errn;
-}
-
-int encodeRCSStringValue(bitstream_t* stream, exi_state_t* state,
-		uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* string) {
-	unsigned int i;
-	int errn;
-	uint32_t k;
-
-	switch (string->type) {
-	case EXI_STRING_VALUE_LOCAL_HIT:
-		errn = encodeUnsignedInteger32(stream, 0);
-		if (errn == 0) {
-			errn = _writeStringValueLocalHit(stream, state, qnameID,
-					string->localID);
-		}
-		break;
-	case EXI_STRING_VALUE_GLOBAL_HIT:
-		errn = encodeUnsignedInteger32(stream, 1);
-		if (errn == 0) {
-			errn = _writeStringValueGlobalHit(stream, state, string->globalID);
-		}
-		break;
-	case EXI_STRING_VALUE_MISS:
-		/* encode string as string table miss */
-		errn = encodeUnsignedInteger32(stream, (uint32_t)(string->miss.len + 2));
-		if (errn == 0) {
-			for (i = 0; i < string->miss.len && errn == 0; i++) {
-				for (k = 0; k < rcs->size && errn == 0; k++) {
-					if (rcs->characters[k] == string->miss.characters[i]) {
-						errn = encodeNBitUnsignedInteger(stream, rcs->codingLength,
-								k);
-						break; /* break inner for loop */
-					}
-				}
-			}
-#if EXI_OPTION_VALUE_PARTITION_CAPACITY != 0
-#if EXI_OPTION_VALUE_MAX_LENGTH != 0
-			/* If length L is greater than zero the string S is added */
-			if (errn == 0 && string->miss.len > 0) {
-				/* After encoding the string value, it is added to both the
-				 * associated "local" value string table partition and the global
-				 * value string table partition */
-#if EXI_OPTION_VALUE_MAX_LENGTH < 0
-				errn = exiAddStringValue(&state->stringTable, &(string->miss), qnameID);
-#else /* EXI_OPTION_VALUE_MAX_LENGTH < 0 */
-				if (string->miss.len <= EXI_OPTION_VALUE_MAX_LENGTH) {
-					errn = exiAddStringValue(&state->stringTable, &(string->miss),
-							qnameID);
-				}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH < 0 */
-			}
-#endif /* EXI_OPTION_VALUE_MAX_LENGTH != 0 */
-#endif /* EXI_OPTION_VALUE_PARTITION_CAPACITY != 0 */
-		}
-		break;
-	default:
-		errn = EXI_UNSUPPORTED_STRING_VALUE_TYPE;
-		break;
-	}
-
-	return errn;
-}
-
 /**
  * Encode a sequence of characters according to a given length.
  * Each character is represented by its UCS [ISO/IEC 10646]
  * code point encoded as an Unsigned Integer
  */
-int encodeCharacters(bitstream_t* stream, exi_string_character_t* chars, uint16_t len) {
+int encodeCharacters(bitstream_t* stream, exi_string_character_t* chars, size_t len) {
 	unsigned int i;
 	int errn = 0;
 	for (i = 0; i < len && errn == 0; i++) {
@@ -525,22 +379,22 @@ int encodeCharacters(bitstream_t* stream, exi_string_character_t* chars, uint16_
 }
 
 
-int encodeRCSCharacters(bitstream_t* stream, exi_string_character_t* chars, uint16_t len, uint16_t rcsCodeLength, uint16_t rcsSize, const exi_string_character_t rcsSet[]) {
+int encodeRCSCharacters(bitstream_t* stream, exi_string_character_t* chars, size_t len, size_t rcsCodeLength, size_t rcsSize, const exi_string_character_t rcsSet[]) {
 	unsigned int i;
-	int k;
+	unsigned int k;
 	int errn = 0;
-	int rcsCode = -1;
+	size_t rcsCode = SIZE_MAX;
 
 	for (i = 0; i < len && errn == 0; i++) {
 		/* try to find short code */
-		rcsCode = -1;
-		for(k=0; k<rcsSize && rcsCode < 0; k++) {
+		rcsCode = SIZE_MAX;
+		for(k=0; k<rcsSize && rcsCode == SIZE_MAX; k++) {
 			if(rcsSet[k] == chars[i]) {
 				rcsCode = k;
 			}
 		}
 
-		if( rcsCode < 0) {
+		if( rcsCode == SIZE_MAX) {
 			/* RCS mis-match */
 			errn = encodeNBitUnsignedInteger(stream, rcsCodeLength, rcsSize);
 #if STRING_REPRESENTATION == STRING_REPRESENTATION_ASCII
@@ -571,7 +425,7 @@ int encodeBinary(bitstream_t* stream, exi_bytes_t* bytes) {
 	return errn;
 }
 
-int encodeBytes(bitstream_t* stream, uint8_t* data, uint16_t len) {
+int encodeBytes(bitstream_t* stream, uint8_t* data, size_t len) {
 	unsigned int i;
 	int errn = 0;
 
@@ -649,5 +503,115 @@ int encodeDateTime(bitstream_t* stream, exi_datetime_t* datetime) {
 	return errn;
 }
 
+
+
+
+int encode(bitstream_t* stream, uint8_t b) {
+#if EXI_OPTION_ALIGNMENT == BIT_PACKED
+	return writeBits(stream, 8, b);
+#endif /* EXI_OPTION_ALIGNMENT == BIT_PACKED */
+#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
+	int errn = 0;
+#if EXI_STREAM == BYTE_ARRAY
+	if ( (*stream->pos) < stream->size ) {
+		stream->data[(*stream->pos)++] = b;
+	} else {
+		errn = EXI_ERROR_OUTPUT_STREAM_EOF;
+	}
+#endif /* EXI_STREAM == BYTE_ARRAY */
+#if EXI_STREAM == FILE_STREAM
+	if ( putc(b, stream->file) == EOF ) {
+		errn = EXI_ERROR_OUTPUT_STREAM_EOF;
+	}
+#endif /* EXI_STREAM == FILE_STREAM */
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT */
+}
+
+/**
+ * Encode a single boolean value. A false value is encoded as bit 0 and true
+ * value is encode as bit 1.
+ */
+int encodeBoolean(bitstream_t* stream, int b) {
+#if EXI_OPTION_ALIGNMENT == BIT_PACKED
+	uint8_t val = b ? 1 : 0;
+	return writeBits(stream, 1, val);
+#endif /* EXI_OPTION_ALIGNMENT == BIT_PACKED */
+#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
+	uint8_t val = b ? 1 : 0;
+	return encode(stream, val);
+#endif /* EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT */
+}
+
+
+/**
+ * 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, size_t nbits, uint32_t val)  {
+#if EXI_OPTION_ALIGNMENT == BIT_PACKED
+	int errn = 0;
+	if (nbits > 0) {
+		errn = writeBits(stream, nbits, val);
+	}
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BIT_PACKED */
+#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
+	int errn = 0;
+	if (nbits > 0) {
+		if (nbits < 9) {
+			/* 1 byte */
+			errn = encode(stream, val & 0xff);
+		} else if (nbits < 17) {
+			/* 2 bytes */
+			errn = encode(stream, val & 0x00ff);
+			if(errn == 0) {
+				errn = encode(stream, (uint8_t)((val & 0xff00) >> 8));
+			}
+		} else if (nbits < 25) {
+			/* 3 bytes */
+			errn = encode(stream, val & 0x0000ff);
+			if(errn == 0) {
+				errn = encode(stream, (uint8_t)((val & 0x00ff00) >> 8));
+				if(errn == 0) {
+					errn = encode(stream, (uint8_t)((val & 0xff0000) >> 16));
+				}
+			}
+		} else if (nbits < 33) {
+			/* 4 bytes */
+			errn = encode(stream, val & 0x000000ff);
+			if(errn == 0) {
+				errn = encode(stream, (uint8_t)((val & 0x0000ff00) >> 8));
+				if(errn == 0) {
+					errn = encode(stream, (uint8_t)((val & 0x00ff0000) >> 16));
+					if(errn == 0) {
+						errn = encode(stream, (uint8_t)((val & 0xff000000) >> 24));
+					}
+				}
+			}
+		} else {
+			/* TODO Currently not more than 4 Bytes allowed for NBitUnsignedInteger */
+			errn = EXI_UNSUPPORTED_NBIT_INTEGER_LENGTH;
+		}
+	}
+	return errn;
+#endif /* EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT */
+}
+
+/**
+ * Flush underlying output stream.
+ */
+int encodeFinish(bitstream_t* stream) {
+#if EXI_OPTION_ALIGNMENT == BIT_PACKED
+#endif /* EXI_OPTION_ALIGNMENT == BIT_PACKED */
+	return flush(stream);
+#if EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT
+	/* no pending bits in byte-aligned mode */
+	return 0;
+#endif /* EXI_OPTION_ALIGNMENT == BYTE_ALIGNMENT */
+}
+
+
+
 #endif
 

+ 15 - 13
src/codec/EncoderChannel.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -81,7 +81,7 @@ int encodeBoolean(bitstream_t* stream, int b);
  * \return                  	Error-Code <> 0
  *
  */
-int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val);
+int encodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint32_t val);
 
 
 /**
@@ -267,13 +267,14 @@ int encodeString(bitstream_t* stream, exi_string_t* string);
  * 				 in the sense of string tables
  *
  * \param       stream   		Output Stream
- * \param       state   		Codec state
- * \param       qnameID   		Qualified Name ID
+ * \param       stringTable   	String Table
+ * \param       namespaceUriID  Qualified Namespace ID
+ * \param       localNameID  	Qualified LocalName ID
  * \param       string		   	String value
  * \return                  	Error-Code <> 0
  *
  */
-int encodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
+int encodeStringValue(bitstream_t* stream, exi_value_string_table_t* stringTable, size_t namespaceUriID, size_t localNameID,
 		exi_string_value_t* string);
 
 
@@ -284,15 +285,16 @@ int encodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
  * 				 in the sense of string tables
  *
  * \param       stream   		Output Stream
- * \param       state   		Codec state
- * \param       qnameID   		Qualified Name ID
+ * \param       StringTable   	StringTable
+ * \param       namespaceUriID  Qualified Namespace ID
+ * \param       localNameID  	Qualified LocalName ID
  * \param       rcs   			Restricted character set
  * \param       string		   	String value
  * \return                  	Error-Code <> 0
  *
  */
-int encodeRCSStringValue(bitstream_t* stream, exi_state_t* state,
-		uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* string);
+int encodeRCSStringValue(bitstream_t* stream, exi_value_string_table_t* stringTable,
+		size_t namespaceUriID, size_t localNameID, exi_rcs_t* rcs, exi_string_value_t* string);
 
 
 /**
@@ -308,7 +310,7 @@ int encodeRCSStringValue(bitstream_t* stream, exi_state_t* state,
  * \return                  	Error-Code <> 0
  *
  */
-int encodeCharacters(bitstream_t* stream, exi_string_character_t* chars, uint16_t len);
+int encodeCharacters(bitstream_t* stream, exi_string_character_t* chars, size_t len);
 
 
 /**
@@ -327,7 +329,7 @@ int encodeCharacters(bitstream_t* stream, exi_string_character_t* chars, uint16_
  * \return                  	Error-Code <> 0
  *
  */
-int encodeRCSCharacters(bitstream_t* stream, exi_string_character_t* chars, uint16_t len, uint16_t rcsCodeLength, uint16_t rcsSize, const exi_string_character_t rcsSet[]);
+int encodeRCSCharacters(bitstream_t* stream, exi_string_character_t* chars, size_t len, size_t rcsCodeLength, size_t rcsSize, const exi_string_character_t rcsSet[]);
 
 
 
@@ -355,7 +357,7 @@ int encodeBinary(bitstream_t* stream, exi_bytes_t* bytes);
  * \return                  	Error-Code <> 0
  *
  */
-int encodeBytes(bitstream_t* stream, uint8_t* data, uint16_t len);
+int encodeBytes(bitstream_t* stream, uint8_t* data, size_t len);
 
 /**
  * \brief 		Encode datetime

+ 2 - 2
src/codec/ErrorCodes.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>

+ 3 - 3
src/codec/MethodsBag.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -38,7 +38,7 @@
 static const uint16_t smallLengths[] = { 0, 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4,
 		4, 4, 4 };
 
-int exiGetCodingLength(uint16_t characteristics, uint16_t* codingLength) {
+int exiGetCodingLength(size_t characteristics, size_t* codingLength) {
 	/* Note: we could use range expressions in switch statements but those are non-standard */
 	/* e.g., case 1 ... 5: */
 	int errn = 0;

+ 4 - 4
src/codec/MethodsBag.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -41,7 +41,7 @@
 
 
 #include <stdint.h>
-
+#include <stddef.h>
 
 /**
  * \brief  	Returns the number of bits to identify the characteristics.
@@ -51,7 +51,7 @@
  * \return                  	Error-Code <> 0
  *
  */
-int exiGetCodingLength(uint16_t characteristics, uint16_t* codingLength);
+int exiGetCodingLength(size_t characteristics, size_t* codingLength);
 
 
 /**

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1025 - 533
src/codec/v2gEXIDatatypes.c


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 496 - 497
src/codec/v2gEXIDatatypes.h


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 470 - 369
src/codec/v2gEXIDatatypesDecoder.c


+ 4 - 4
src/codec/v2gEXIDatatypesDecoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -50,10 +50,10 @@ extern "C" {
 #include "v2gEXIDatatypes.h"
 
 int decode_v2gExiDocument(bitstream_t* stream, struct v2gEXIDocument* exiDoc);
-
+
 #if DEPLOY_ISO_CODEC_FRAGMENT == SUPPORT_YES
 int decode_v2gExiFragment(bitstream_t* stream, struct v2gEXIFragment* exiFrag);
-#endif /* DEPLOY_ISO_CODEC_FRAGMENT */
+#endif /* DEPLOY_ISO_CODEC_FRAGMENT */
 
 #endif /* DEPLOY_ISO_CODEC */
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 430 - 291
src/codec/v2gEXIDatatypesEncoder.c


+ 5 - 5
src/codec/v2gEXIDatatypesEncoder.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3 
+ * @version 2017-03-02 
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -51,10 +51,10 @@ extern "C" {
 
 
 int encode_v2gExiDocument(bitstream_t* stream, struct v2gEXIDocument* exiDoc);
-
+
 #if DEPLOY_ISO_CODEC_FRAGMENT == SUPPORT_YES
-int encode_v2gExiFragment(bitstream_t* stream, struct v2gEXIFragment* exiFrag);
-#endif /* DEPLOY_ISO_CODEC_FRAGMENT */
+int encode_v2gExiFragment(bitstream_t* stream, struct v2gEXIFragment* exiFrag);
+#endif /* DEPLOY_ISO_CODEC_FRAGMENT */
 
 
 #endif /* DEPLOY_ISO_CODEC */

+ 67 - 268
src/din/dinEXIDatatypesDecoder.c

@@ -470,13 +470,10 @@ static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinC
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinCanonicalizationMethodType->Algorithm.charactersLen);
-					if (errn == 0) {
-						errn =  (dinCanonicalizationMethodType->Algorithm.charactersLen - 2) <= dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinCanonicalizationMethodType->Algorithm.charactersLen >= 2) {
 							dinCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(dinCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.charactersLen, dinCanonicalizationMethodType->Algorithm.characters);
+							errn = decodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.charactersLen, dinCanonicalizationMethodType->Algorithm.characters, dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -1519,13 +1516,10 @@ static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* d
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinManifestType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinManifestType->Id.charactersLen - 2) <= dinManifestType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinManifestType->Id.charactersLen >= 2) {
 							dinManifestType->Id.charactersLen = (uint16_t)(dinManifestType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinManifestType->Id.charactersLen, dinManifestType->Id.characters);
+							errn = decodeCharacters(stream, dinManifestType->Id.charactersLen, dinManifestType->Id.characters, dinManifestType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -1965,13 +1959,10 @@ static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMetho
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinDigestMethodType->Algorithm.charactersLen);
-					if (errn == 0) {
-						errn =  (dinDigestMethodType->Algorithm.charactersLen - 2) <= dinDigestMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinDigestMethodType->Algorithm.charactersLen >= 2) {
 							dinDigestMethodType->Algorithm.charactersLen = (uint16_t)(dinDigestMethodType->Algorithm.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinDigestMethodType->Algorithm.charactersLen, dinDigestMethodType->Algorithm.characters);
+							errn = decodeCharacters(stream, dinDigestMethodType->Algorithm.charactersLen, dinDigestMethodType->Algorithm.characters, dinDigestMethodType_Algorithm_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -2058,13 +2049,10 @@ static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffT
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSalesTariffType->Id.charactersLen - 2) <= dinSalesTariffType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSalesTariffType->Id.charactersLen >= 2) {
 							dinSalesTariffType->Id.charactersLen = (uint16_t)(dinSalesTariffType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSalesTariffType->Id.charactersLen, dinSalesTariffType->Id.characters);
+							errn = decodeCharacters(stream, dinSalesTariffType->Id.charactersLen, dinSalesTariffType->Id.characters, dinSalesTariffType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -2121,13 +2109,10 @@ static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffT
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->SalesTariffDescription.charactersLen);
-							if (errn == 0) {
-								errn =  (dinSalesTariffType->SalesTariffDescription.charactersLen - 2) <= dinSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinSalesTariffType->SalesTariffDescription.charactersLen >= 2) {
 									dinSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.charactersLen, dinSalesTariffType->SalesTariffDescription.characters);
+									errn = decodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.charactersLen, dinSalesTariffType->SalesTariffDescription.characters, dinSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -2582,13 +2567,10 @@ static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertiesType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignaturePropertiesType->Id.charactersLen - 2) <= dinSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignaturePropertiesType->Id.charactersLen >= 2) {
 							dinSignaturePropertiesType->Id.charactersLen = (uint16_t)(dinSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignaturePropertiesType->Id.charactersLen, dinSignaturePropertiesType->Id.characters);
+							errn = decodeCharacters(stream, dinSignaturePropertiesType->Id.charactersLen, dinSignaturePropertiesType->Id.characters, dinSignaturePropertiesType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -3016,13 +2998,10 @@ static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificatio
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinNotificationType->FaultMsg.charactersLen);
-							if (errn == 0) {
-								errn =  (dinNotificationType->FaultMsg.charactersLen - 2) <= dinNotificationType_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinNotificationType->FaultMsg.charactersLen >= 2) {
 									dinNotificationType->FaultMsg.charactersLen = (uint16_t)(dinNotificationType->FaultMsg.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinNotificationType->FaultMsg.charactersLen, dinNotificationType->FaultMsg.characters);
+									errn = decodeCharacters(stream, dinNotificationType->FaultMsg.charactersLen, dinNotificationType->FaultMsg.characters, dinNotificationType_FaultMsg_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -3096,13 +3075,10 @@ static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct d
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinContractAuthenticationReqType->Id.charactersLen - 2) <= dinContractAuthenticationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinContractAuthenticationReqType->Id.charactersLen >= 2) {
 							dinContractAuthenticationReqType->Id.charactersLen = (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinContractAuthenticationReqType->Id.charactersLen, dinContractAuthenticationReqType->Id.characters);
+							errn = decodeCharacters(stream, dinContractAuthenticationReqType->Id.charactersLen, dinContractAuthenticationReqType->Id.characters, dinContractAuthenticationReqType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -3117,13 +3093,10 @@ static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct d
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen);
-							if (errn == 0) {
-								errn =  (dinContractAuthenticationReqType->GenChallenge.charactersLen - 2) <= dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) {
 									dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters);
+									errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -3166,13 +3139,10 @@ static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct d
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen);
-							if (errn == 0) {
-								errn =  (dinContractAuthenticationReqType->GenChallenge.charactersLen - 2) <= dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) {
 									dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters);
+									errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -4166,13 +4136,10 @@ static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType*
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSignatureType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignatureType->Id.charactersLen - 2) <= dinSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignatureType->Id.charactersLen >= 2) {
 							dinSignatureType->Id.charactersLen = (uint16_t)(dinSignatureType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignatureType->Id.charactersLen, dinSignatureType->Id.characters);
+							errn = decodeCharacters(stream, dinSignatureType->Id.charactersLen, dinSignatureType->Id.characters, dinSignatureType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -4399,13 +4366,10 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType*
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinParameterType->Name.charactersLen);
-					if (errn == 0) {
-						errn =  (dinParameterType->Name.charactersLen - 2) <= dinParameterType_Name_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinParameterType->Name.charactersLen >= 2) {
 							dinParameterType->Name.charactersLen = (uint16_t)(dinParameterType->Name.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinParameterType->Name.charactersLen, dinParameterType->Name.characters);
+							errn = decodeCharacters(stream, dinParameterType->Name.charactersLen, dinParameterType->Name.characters, dinParameterType_Name_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -4540,13 +4504,10 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType*
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinParameterType->stringValue.charactersLen);
-							if (errn == 0) {
-								errn =  (dinParameterType->stringValue.charactersLen - 2) <= dinParameterType_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinParameterType->stringValue.charactersLen >= 2) {
 									dinParameterType->stringValue.charactersLen = (uint16_t)(dinParameterType->stringValue.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinParameterType->stringValue.charactersLen, dinParameterType->stringValue.characters);
+									errn = decodeCharacters(stream, dinParameterType->stringValue.charactersLen, dinParameterType->stringValue.characters, dinParameterType_stringValue_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -4616,13 +4577,10 @@ static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignat
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignaturePropertyType->Id.charactersLen - 2) <= dinSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignaturePropertyType->Id.charactersLen >= 2) {
 							dinSignaturePropertyType->Id.charactersLen = (uint16_t)(dinSignaturePropertyType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignaturePropertyType->Id.charactersLen, dinSignaturePropertyType->Id.characters);
+							errn = decodeCharacters(stream, dinSignaturePropertyType->Id.charactersLen, dinSignaturePropertyType->Id.characters, dinSignaturePropertyType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -4633,13 +4591,10 @@ static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignat
 					break;
 				case 1:
 					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignaturePropertyType->Target.charactersLen - 2) <= dinSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignaturePropertyType->Target.charactersLen >= 2) {
 							dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters);
+							errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType_Target_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -4660,13 +4615,10 @@ static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignat
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignaturePropertyType->Target.charactersLen - 2) <= dinSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignaturePropertyType->Target.charactersLen >= 2) {
 							dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters);
+							errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType_Target_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -5808,13 +5760,10 @@ static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinCertificateInstallationReqType->Id.charactersLen - 2) <= dinCertificateInstallationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinCertificateInstallationReqType->Id.charactersLen >= 2) {
 							dinCertificateInstallationReqType->Id.charactersLen = (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinCertificateInstallationReqType->Id.charactersLen, dinCertificateInstallationReqType->Id.characters);
+							errn = decodeCharacters(stream, dinCertificateInstallationReqType->Id.charactersLen, dinCertificateInstallationReqType->Id.characters, dinCertificateInstallationReqType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -5989,13 +5938,10 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType*
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinTransformType->Algorithm.charactersLen);
-					if (errn == 0) {
-						errn =  (dinTransformType->Algorithm.charactersLen - 2) <= dinTransformType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinTransformType->Algorithm.charactersLen >= 2) {
 							dinTransformType->Algorithm.charactersLen = (uint16_t)(dinTransformType->Algorithm.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinTransformType->Algorithm.charactersLen, dinTransformType->Algorithm.characters);
+							errn = decodeCharacters(stream, dinTransformType->Algorithm.charactersLen, dinTransformType->Algorithm.characters, dinTransformType_Algorithm_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6021,13 +5967,10 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType*
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2) <= dinTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) {
 										dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters);
+										errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters, dinTransformType_XPath_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6082,13 +6025,10 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType*
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2) <= dinTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) {
 										dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters);
+										errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters, dinTransformType_XPath_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6254,13 +6194,10 @@ static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrieva
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->Type.charactersLen);
-					if (errn == 0) {
-						errn =  (dinRetrievalMethodType->Type.charactersLen - 2) <= dinRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinRetrievalMethodType->Type.charactersLen >= 2) {
 							dinRetrievalMethodType->Type.charactersLen = (uint16_t)(dinRetrievalMethodType->Type.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinRetrievalMethodType->Type.charactersLen, dinRetrievalMethodType->Type.characters);
+							errn = decodeCharacters(stream, dinRetrievalMethodType->Type.charactersLen, dinRetrievalMethodType->Type.characters, dinRetrievalMethodType_Type_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6271,13 +6208,10 @@ static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrieva
 					break;
 				case 1:
 					errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen);
-					if (errn == 0) {
-						errn =  (dinRetrievalMethodType->URI.charactersLen - 2) <= dinRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinRetrievalMethodType->URI.charactersLen >= 2) {
 							dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters);
+							errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType_URI_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6308,13 +6242,10 @@ static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrieva
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen);
-					if (errn == 0) {
-						errn =  (dinRetrievalMethodType->URI.charactersLen - 2) <= dinRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinRetrievalMethodType->URI.charactersLen >= 2) {
 							dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters);
+							errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType_URI_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6644,13 +6575,10 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType*
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinReferenceType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinReferenceType->Id.charactersLen - 2) <= dinReferenceType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinReferenceType->Id.charactersLen >= 2) {
 							dinReferenceType->Id.charactersLen = (uint16_t)(dinReferenceType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinReferenceType->Id.charactersLen, dinReferenceType->Id.characters);
+							errn = decodeCharacters(stream, dinReferenceType->Id.charactersLen, dinReferenceType->Id.characters, dinReferenceType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6661,13 +6589,10 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType*
 					break;
 				case 1:
 					errn = decodeUnsignedInteger16(stream, &dinReferenceType->Type.charactersLen);
-					if (errn == 0) {
-						errn =  (dinReferenceType->Type.charactersLen - 2) <= dinReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinReferenceType->Type.charactersLen >= 2) {
 							dinReferenceType->Type.charactersLen = (uint16_t)(dinReferenceType->Type.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters);
+							errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters, dinReferenceType_Type_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6678,13 +6603,10 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType*
 					break;
 				case 2:
 					errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen);
-					if (errn == 0) {
-						errn =  (dinReferenceType->URI.charactersLen - 2) <= dinReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinReferenceType->URI.charactersLen >= 2) {
 							dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters);
+							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters, dinReferenceType_URI_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6715,13 +6637,10 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType*
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinReferenceType->Type.charactersLen);
-					if (errn == 0) {
-						errn =  (dinReferenceType->Type.charactersLen - 2) <= dinReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinReferenceType->Type.charactersLen >= 2) {
 							dinReferenceType->Type.charactersLen = (uint16_t)(dinReferenceType->Type.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters);
+							errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters, dinReferenceType_Type_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6732,13 +6651,10 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType*
 					break;
 				case 1:
 					errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen);
-					if (errn == 0) {
-						errn =  (dinReferenceType->URI.charactersLen - 2) <= dinReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinReferenceType->URI.charactersLen >= 2) {
 							dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters);
+							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters, dinReferenceType_URI_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6769,13 +6685,10 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType*
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen);
-					if (errn == 0) {
-						errn =  (dinReferenceType->URI.charactersLen - 2) <= dinReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinReferenceType->URI.charactersLen >= 2) {
 							dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters);
+							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters, dinReferenceType_URI_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6982,13 +6895,10 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinObjectType->Encoding.charactersLen);
-					if (errn == 0) {
-						errn =  (dinObjectType->Encoding.charactersLen - 2) <= dinObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinObjectType->Encoding.charactersLen >= 2) {
 							dinObjectType->Encoding.charactersLen = (uint16_t)(dinObjectType->Encoding.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinObjectType->Encoding.charactersLen, dinObjectType->Encoding.characters);
+							errn = decodeCharacters(stream, dinObjectType->Encoding.charactersLen, dinObjectType->Encoding.characters, dinObjectType_Encoding_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -6999,13 +6909,10 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb
 					break;
 				case 1:
 					errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinObjectType->Id.charactersLen - 2) <= dinObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinObjectType->Id.charactersLen >= 2) {
 							dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters);
+							errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters, dinObjectType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -7016,13 +6923,10 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb
 					break;
 				case 2:
 					errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen);
-					if (errn == 0) {
-						errn =  (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinObjectType->MimeType.charactersLen >= 2) {
 							dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters);
+							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters, dinObjectType_MimeType_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -7056,13 +6960,10 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinObjectType->Id.charactersLen - 2) <= dinObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinObjectType->Id.charactersLen >= 2) {
 							dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters);
+							errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters, dinObjectType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -7073,13 +6974,10 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb
 					break;
 				case 1:
 					errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen);
-					if (errn == 0) {
-						errn =  (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinObjectType->MimeType.charactersLen >= 2) {
 							dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters);
+							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters, dinObjectType_MimeType_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -7113,13 +7011,10 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen);
-					if (errn == 0) {
-						errn =  (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinObjectType->MimeType.charactersLen >= 2) {
 							dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters);
+							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters, dinObjectType_MimeType_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -7219,13 +7114,10 @@ static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignature
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignatureValueType->Id.charactersLen - 2) <= dinSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignatureValueType->Id.charactersLen >= 2) {
 							dinSignatureValueType->Id.charactersLen = (uint16_t)(dinSignatureValueType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignatureValueType->Id.charactersLen, dinSignatureValueType->Id.characters);
+							errn = decodeCharacters(stream, dinSignatureValueType->Id.charactersLen, dinSignatureValueType->Id.characters, dinSignatureValueType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -7658,13 +7550,10 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinMeteringReceiptReqType->Id.charactersLen - 2) <= dinMeteringReceiptReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinMeteringReceiptReqType->Id.charactersLen >= 2) {
 							dinMeteringReceiptReqType->Id.charactersLen = (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinMeteringReceiptReqType->Id.charactersLen, dinMeteringReceiptReqType->Id.characters);
+							errn = decodeCharacters(stream, dinMeteringReceiptReqType->Id.charactersLen, dinMeteringReceiptReqType->Id.characters, dinMeteringReceiptReqType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8541,13 +8430,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinKeyInfoType->Id.charactersLen - 2) <= dinKeyInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinKeyInfoType->Id.charactersLen >= 2) {
 							dinKeyInfoType->Id.charactersLen = (uint16_t)(dinKeyInfoType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinKeyInfoType->Id.charactersLen, dinKeyInfoType->Id.characters);
+							errn = decodeCharacters(stream, dinKeyInfoType->Id.charactersLen, dinKeyInfoType->Id.characters, dinKeyInfoType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8563,13 +8449,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8641,13 +8524,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8698,13 +8578,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8776,13 +8653,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8833,13 +8707,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8911,13 +8782,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -8972,13 +8840,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -9050,13 +8915,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
 										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters);
+										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -9378,13 +9240,10 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinPaymentDetailsResType->GenChallenge.charactersLen);
-							if (errn == 0) {
-								errn =  (dinPaymentDetailsResType->GenChallenge.charactersLen - 2) <= dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinPaymentDetailsResType->GenChallenge.charactersLen >= 2) {
 									dinPaymentDetailsResType->GenChallenge.charactersLen = (uint16_t)(dinPaymentDetailsResType->GenChallenge.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinPaymentDetailsResType->GenChallenge.charactersLen, dinPaymentDetailsResType->GenChallenge.characters);
+									errn = decodeCharacters(stream, dinPaymentDetailsResType->GenChallenge.charactersLen, dinPaymentDetailsResType->GenChallenge.characters, dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -9524,13 +9383,10 @@ static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymen
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinPaymentDetailsReqType->ContractID.charactersLen);
-							if (errn == 0) {
-								errn =  (dinPaymentDetailsReqType->ContractID.charactersLen - 2) <= dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinPaymentDetailsReqType->ContractID.charactersLen >= 2) {
 									dinPaymentDetailsReqType->ContractID.charactersLen = (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinPaymentDetailsReqType->ContractID.charactersLen, dinPaymentDetailsReqType->ContractID.characters);
+									errn = decodeCharacters(stream, dinPaymentDetailsReqType->ContractID.charactersLen, dinPaymentDetailsReqType->ContractID.characters, dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -9650,13 +9506,10 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceName.charactersLen);
-							if (errn == 0) {
-								errn =  (dinServiceTagType->ServiceName.charactersLen - 2) <= dinServiceTagType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinServiceTagType->ServiceName.charactersLen >= 2) {
 									dinServiceTagType->ServiceName.charactersLen = (uint16_t)(dinServiceTagType->ServiceName.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinServiceTagType->ServiceName.charactersLen, dinServiceTagType->ServiceName.characters);
+									errn = decodeCharacters(stream, dinServiceTagType->ServiceName.charactersLen, dinServiceTagType->ServiceName.characters, dinServiceTagType_ServiceName_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -9750,13 +9603,10 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceScope.charactersLen);
-							if (errn == 0) {
-								errn =  (dinServiceTagType->ServiceScope.charactersLen - 2) <= dinServiceTagType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinServiceTagType->ServiceScope.charactersLen >= 2) {
 									dinServiceTagType->ServiceScope.charactersLen = (uint16_t)(dinServiceTagType->ServiceScope.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinServiceTagType->ServiceScope.charactersLen, dinServiceTagType->ServiceScope.characters);
+									errn = decodeCharacters(stream, dinServiceTagType->ServiceScope.charactersLen, dinServiceTagType->ServiceScope.characters, dinServiceTagType_ServiceScope_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -10025,13 +9875,10 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinServiceDiscoveryReqType->ServiceScope.charactersLen);
-							if (errn == 0) {
-								errn =  (dinServiceDiscoveryReqType->ServiceScope.charactersLen - 2) <= dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinServiceDiscoveryReqType->ServiceScope.charactersLen >= 2) {
 									dinServiceDiscoveryReqType->ServiceScope.charactersLen = (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.charactersLen, dinServiceDiscoveryReqType->ServiceScope.characters);
+									errn = decodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.charactersLen, dinServiceDiscoveryReqType->ServiceScope.characters, dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -10264,13 +10111,10 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinCertificateUpdateReqType->Id.charactersLen - 2) <= dinCertificateUpdateReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinCertificateUpdateReqType->Id.charactersLen >= 2) {
 							dinCertificateUpdateReqType->Id.charactersLen = (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinCertificateUpdateReqType->Id.charactersLen, dinCertificateUpdateReqType->Id.characters);
+							errn = decodeCharacters(stream, dinCertificateUpdateReqType->Id.charactersLen, dinCertificateUpdateReqType->Id.characters, dinCertificateUpdateReqType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -10315,13 +10159,10 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->ContractID.charactersLen);
-							if (errn == 0) {
-								errn =  (dinCertificateUpdateReqType->ContractID.charactersLen - 2) <= dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinCertificateUpdateReqType->ContractID.charactersLen >= 2) {
 									dinCertificateUpdateReqType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinCertificateUpdateReqType->ContractID.charactersLen, dinCertificateUpdateReqType->ContractID.characters);
+									errn = decodeCharacters(stream, dinCertificateUpdateReqType->ContractID.charactersLen, dinCertificateUpdateReqType->ContractID.characters, dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -10505,13 +10346,10 @@ static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoTyp
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSignedInfoType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignedInfoType->Id.charactersLen - 2) <= dinSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignedInfoType->Id.charactersLen >= 2) {
 							dinSignedInfoType->Id.charactersLen = (uint16_t)(dinSignedInfoType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignedInfoType->Id.charactersLen, dinSignedInfoType->Id.characters);
+							errn = decodeCharacters(stream, dinSignedInfoType->Id.charactersLen, dinSignedInfoType->Id.characters, dinSignedInfoType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -11477,13 +11315,10 @@ static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType*
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->MeterID.charactersLen);
-							if (errn == 0) {
-								errn =  (dinMeterInfoType->MeterID.charactersLen - 2) <= dinMeterInfoType_MeterID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinMeterInfoType->MeterID.charactersLen >= 2) {
 									dinMeterInfoType->MeterID.charactersLen = (uint16_t)(dinMeterInfoType->MeterID.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinMeterInfoType->MeterID.charactersLen, dinMeterInfoType->MeterID.characters);
+									errn = decodeCharacters(stream, dinMeterInfoType->MeterID.charactersLen, dinMeterInfoType->MeterID.characters, dinMeterInfoType_MeterID_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -11827,13 +11662,10 @@ static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinCertificateInstallationResType->Id.charactersLen - 2) <= dinCertificateInstallationResType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinCertificateInstallationResType->Id.charactersLen >= 2) {
 							dinCertificateInstallationResType->Id.charactersLen = (uint16_t)(dinCertificateInstallationResType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinCertificateInstallationResType->Id.charactersLen, dinCertificateInstallationResType->Id.characters);
+							errn = decodeCharacters(stream, dinCertificateInstallationResType->Id.charactersLen, dinCertificateInstallationResType->Id.characters, dinCertificateInstallationResType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -11982,13 +11814,10 @@ static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractID.charactersLen);
-							if (errn == 0) {
-								errn =  (dinCertificateInstallationResType->ContractID.charactersLen - 2) <= dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinCertificateInstallationResType->ContractID.charactersLen >= 2) {
 									dinCertificateInstallationResType->ContractID.charactersLen = (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinCertificateInstallationResType->ContractID.charactersLen, dinCertificateInstallationResType->ContractID.characters);
+									errn = decodeCharacters(stream, dinCertificateInstallationResType->ContractID.charactersLen, dinCertificateInstallationResType->ContractID.characters, dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -12181,13 +12010,10 @@ static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509Iss
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinX509IssuerSerialType->X509IssuerName.charactersLen);
-							if (errn == 0) {
-								errn =  (dinX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinX509IssuerSerialType->X509IssuerName.charactersLen >= 2) {
 									dinX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.charactersLen, dinX509IssuerSerialType->X509IssuerName.characters);
+									errn = decodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.charactersLen, dinX509IssuerSerialType->X509IssuerName.characters, dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -12553,13 +12379,10 @@ static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* d
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= dinX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) {
 										dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters);
+										errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters, dinX509DataType_X509SubjectName_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -12711,13 +12534,10 @@ static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* d
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= dinX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) {
 										dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters);
+										errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters, dinX509DataType_X509SubjectName_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -13367,13 +13187,10 @@ static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCer
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->Id.charactersLen);
-					if (errn == 0) {
-						errn =  (dinCertificateUpdateResType->Id.charactersLen - 2) <= dinCertificateUpdateResType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinCertificateUpdateResType->Id.charactersLen >= 2) {
 							dinCertificateUpdateResType->Id.charactersLen = (uint16_t)(dinCertificateUpdateResType->Id.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinCertificateUpdateResType->Id.charactersLen, dinCertificateUpdateResType->Id.characters);
+							errn = decodeCharacters(stream, dinCertificateUpdateResType->Id.charactersLen, dinCertificateUpdateResType->Id.characters, dinCertificateUpdateResType_Id_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -13522,13 +13339,10 @@ static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCer
 					if(errn == 0) {
 						if(eventCode == 0) {
 							errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractID.charactersLen);
-							if (errn == 0) {
-								errn =  (dinCertificateUpdateResType->ContractID.charactersLen - 2) <= dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-							}
 							if (errn == 0) {
 								if (dinCertificateUpdateResType->ContractID.charactersLen >= 2) {
 									dinCertificateUpdateResType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen - 2); /* string table miss */
-									errn = decodeCharacters(stream, dinCertificateUpdateResType->ContractID.charactersLen, dinCertificateUpdateResType->ContractID.characters);
+									errn = decodeCharacters(stream, dinCertificateUpdateResType->ContractID.charactersLen, dinCertificateUpdateResType->ContractID.characters, dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE);
 								} else {
 									/* string table hit */
 									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -13760,13 +13574,10 @@ static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct di
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2) <= dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) {
 										dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters);
+										errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters, dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -13809,13 +13620,10 @@ static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct di
 						if(errn == 0) {
 							if(eventCode == 0) {
 								errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen);
-								if (errn == 0) {
-									errn =  (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2) <= dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-								}
 								if (errn == 0) {
 									if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) {
 										dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */
-										errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters);
+										errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters, dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE);
 									} else {
 										/* string table hit */
 										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -13877,13 +13685,10 @@ static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatur
 				switch(eventCode) {
 				case 0:
 					errn = decodeUnsignedInteger16(stream, &dinSignatureMethodType->Algorithm.charactersLen);
-					if (errn == 0) {
-						errn =  (dinSignatureMethodType->Algorithm.charactersLen - 2) <= dinSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-					}
 					if (errn == 0) {
 						if (dinSignatureMethodType->Algorithm.charactersLen >= 2) {
 							dinSignatureMethodType->Algorithm.charactersLen = (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */
-							errn = decodeCharacters(stream, dinSignatureMethodType->Algorithm.charactersLen, dinSignatureMethodType->Algorithm.characters);
+							errn = decodeCharacters(stream, dinSignatureMethodType->Algorithm.charactersLen, dinSignatureMethodType->Algorithm.characters, dinSignatureMethodType_Algorithm_CHARACTERS_SIZE);
 						} else {
 							/* string table hit */
 							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -14225,13 +14030,10 @@ int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) {
 				if(errn == 0) {
 					if(eventCode == 0) {
 						errn = decodeUnsignedInteger16(stream, &exiDoc->KeyName.charactersLen);
-						if (errn == 0) {
-							errn =  (exiDoc->KeyName.charactersLen - 2) <= EXIDocument_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-						}
 						if (errn == 0) {
 							if (exiDoc->KeyName.charactersLen >= 2) {
 								exiDoc->KeyName.charactersLen = (uint16_t)(exiDoc->KeyName.charactersLen - 2); /* string table miss */
-								errn = decodeCharacters(stream, exiDoc->KeyName.charactersLen, exiDoc->KeyName.characters);
+								errn = decodeCharacters(stream, exiDoc->KeyName.charactersLen, exiDoc->KeyName.characters, EXIDocument_KeyName_CHARACTERS_SIZE);
 							} else {
 								/* string table hit */
 								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
@@ -14271,13 +14073,10 @@ int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) {
 				if(errn == 0) {
 					if(eventCode == 0) {
 						errn = decodeUnsignedInteger16(stream, &exiDoc->MgmtData.charactersLen);
-						if (errn == 0) {
-							errn =  (exiDoc->MgmtData.charactersLen - 2) <= EXIDocument_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND;
-						}
 						if (errn == 0) {
 							if (exiDoc->MgmtData.charactersLen >= 2) {
 								exiDoc->MgmtData.charactersLen = (uint16_t)(exiDoc->MgmtData.charactersLen - 2); /* string table miss */
-								errn = decodeCharacters(stream, exiDoc->MgmtData.charactersLen, exiDoc->MgmtData.characters);
+								errn = decodeCharacters(stream, exiDoc->MgmtData.charactersLen, exiDoc->MgmtData.characters, EXIDocument_MgmtData_CHARACTERS_SIZE);
 							} else {
 								/* string table hit */
 								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;

+ 5 - 2
src/test/main.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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@siemens.com
- * @version 0.9.3
+ * @version 1.0.0alpha
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Switch for sample programs: EXI codec only or for entire V2G example</p>
@@ -32,6 +32,9 @@
 #include "main.h"
 
 int main(int argc, char *argv[]) {
+    /* disable buffering of output, especially when piped or redirected */
+    setvbuf(stdout, NULL, _IONBF, 0);
+
 #if CODE_VERSION == CODE_VERSION_EXI
 	/* EXI codec only */
 	return main_databinder(argc, argv);

+ 2 - 2
src/test/main.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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@siemens.com
- * @version 0.9.3
+ * @version 1.0.0alpha
  * @contact Joerg.Heuer@siemens.com
  *
  *

+ 4 - 4
src/test/main_databinder.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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.9.3
+ * @version 1.0.0alpha
  * @contact Joerg.Heuer@siemens.com
  *
  * <p>Code generated by EXIdizer</p>
@@ -72,8 +72,8 @@ int main_databinder(int argc, char *argv[]) {
 	bitstream_t iStream, oStream;
 
 #if EXI_STREAM == BYTE_ARRAY
-	uint16_t posDecode;
-	uint16_t posEncode;
+	size_t posDecode;
+	size_t posEncode;
 #endif /* EXI_STREAM == BYTE_ARRAY */
 
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 115 - 548
src/test/main_example.c


+ 2 - 2
src/transport/v2gtp.c

@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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
@@ -20,7 +20,7 @@
  *
  * @author Sebastian.Kaebisch@siemens.com
  * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.9.3
+ * @version 1.0.0alpha
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

+ 2 - 2
src/transport/v2gtp.h

@@ -1,6 +1,6 @@
 
 /*
- * Copyright (C) 2007-2015 Siemens AG
+ * Copyright (C) 2007-2017 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@siemens.com
- * @version 0.9.3
+ * @version 1.0.0alpha
  * @contact Joerg.Heuer@siemens.com
  *
  ********************************************************************/

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels