diff --git a/.cproject b/.cproject index c52baed..5dccf5b 100644 --- a/.cproject +++ b/.cproject @@ -5,16 +5,16 @@ + - - + @@ -31,6 +31,7 @@ + @@ -65,16 +66,16 @@ + - - + @@ -91,6 +92,7 @@ + @@ -125,10 +127,10 @@ - + - + diff --git a/Debug/makefile b/Debug/makefile index b51a391..ac91ab0 100644 --- a/Debug/makefile +++ b/Debug/makefile @@ -8,6 +8,7 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk +-include src/xmldsig/subdir.mk -include src/transport/subdir.mk -include src/test/subdir.mk -include src/din/subdir.mk @@ -39,7 +40,7 @@ OpenV2G.exe: $(OBJS) $(USER_OBJS) # Other Targets clean: - -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) OpenV2G.exe + -$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) OpenV2G.exe -@echo ' ' .PHONY: all clean dependents diff --git a/Debug/sources.mk b/Debug/sources.mk index 65bd3c3..b63f33f 100644 --- a/Debug/sources.mk +++ b/Debug/sources.mk @@ -2,17 +2,18 @@ # Automatically-generated file. Do not edit! ################################################################################ -O_SRCS := -C_SRCS := -S_UPPER_SRCS := OBJ_SRCS := ASM_SRCS := +C_SRCS := +S_UPPER_SRCS := +O_SRCS := +EXECUTABLES := OBJS := C_DEPS := -EXECUTABLES := # Every subdirectory with source files must be described here SUBDIRS := \ +src/xmldsig \ src/transport \ src/test \ src/din \ diff --git a/Debug/src/appHandshake/subdir.mk b/Debug/src/appHandshake/subdir.mk index b30d8ce..508d95f 100644 --- a/Debug/src/appHandshake/subdir.mk +++ b/Debug/src/appHandshake/subdir.mk @@ -23,7 +23,7 @@ C_DEPS += \ src/appHandshake/%.o: ../src/appHandshake/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -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 "$@" "$<" + 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 ' ' diff --git a/Debug/src/codec/subdir.mk b/Debug/src/codec/subdir.mk index a48128b..fc8591e 100644 --- a/Debug/src/codec/subdir.mk +++ b/Debug/src/codec/subdir.mk @@ -59,7 +59,7 @@ C_DEPS += \ src/codec/%.o: ../src/codec/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -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 "$@" "$<" + 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 ' ' diff --git a/Debug/src/test/subdir.mk b/Debug/src/test/subdir.mk index 6e210c8..53a2e42 100644 --- a/Debug/src/test/subdir.mk +++ b/Debug/src/test/subdir.mk @@ -23,7 +23,7 @@ C_DEPS += \ src/test/%.o: ../src/test/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -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 "$@" "$<" + 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 ' ' diff --git a/Debug/src/transport/subdir.mk b/Debug/src/transport/subdir.mk index f55e849..ccc078a 100644 --- a/Debug/src/transport/subdir.mk +++ b/Debug/src/transport/subdir.mk @@ -17,7 +17,7 @@ C_DEPS += \ src/transport/%.o: ../src/transport/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -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 "$@" "$<" + 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 ' ' diff --git a/README.txt b/README.txt index ee7ad6b..f3bb93d 100644 --- a/README.txt +++ b/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.2, released September 12, 2014 +Version 0.9.3, released February 25, 2015 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-2014 Siemens AG +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 @@ -21,6 +21,18 @@ 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 . +------------------------------------------------------------------------- +CHANGES from version 0.9.2: +------------------------------------------------------------------------- +* resolves XML signature interoperability issue + Note: To make use of xmldsig the following defines have to be set. + in "xmldsigEXIDatatypes.h" + #define DEPLOY_XMLDSIG_CODEC SUPPORT_YES + #define DEPLOY_XMLDSIG_CODEC_FRAGMENT SUPPORT_YES + in "v2gEXIDatatypes.h" + #define DEPLOY_ISO_CODEC_FRAGMENT SUPPORT_YES + Otherwise the code is turned off. + ------------------------------------------------------------------------- CHANGES from version 0.9.1: ------------------------------------------------------------------------- diff --git a/Release/makefile b/Release/makefile index b51a391..ac91ab0 100644 --- a/Release/makefile +++ b/Release/makefile @@ -8,6 +8,7 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk +-include src/xmldsig/subdir.mk -include src/transport/subdir.mk -include src/test/subdir.mk -include src/din/subdir.mk @@ -39,7 +40,7 @@ OpenV2G.exe: $(OBJS) $(USER_OBJS) # Other Targets clean: - -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) OpenV2G.exe + -$(RM) $(EXECUTABLES)$(OBJS)$(C_DEPS) OpenV2G.exe -@echo ' ' .PHONY: all clean dependents diff --git a/Release/sources.mk b/Release/sources.mk index 65bd3c3..b63f33f 100644 --- a/Release/sources.mk +++ b/Release/sources.mk @@ -2,17 +2,18 @@ # Automatically-generated file. Do not edit! ################################################################################ -O_SRCS := -C_SRCS := -S_UPPER_SRCS := OBJ_SRCS := ASM_SRCS := +C_SRCS := +S_UPPER_SRCS := +O_SRCS := +EXECUTABLES := OBJS := C_DEPS := -EXECUTABLES := # Every subdirectory with source files must be described here SUBDIRS := \ +src/xmldsig \ src/transport \ src/test \ src/din \ diff --git a/Release/src/appHandshake/subdir.mk b/Release/src/appHandshake/subdir.mk index 7a51464..8f3e86d 100644 --- a/Release/src/appHandshake/subdir.mk +++ b/Release/src/appHandshake/subdir.mk @@ -23,7 +23,7 @@ C_DEPS += \ src/appHandshake/%.o: ../src/appHandshake/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + 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 ' ' diff --git a/Release/src/codec/subdir.mk b/Release/src/codec/subdir.mk index 6271be5..ea56d80 100644 --- a/Release/src/codec/subdir.mk +++ b/Release/src/codec/subdir.mk @@ -59,7 +59,7 @@ C_DEPS += \ src/codec/%.o: ../src/codec/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + 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 ' ' diff --git a/Release/src/test/subdir.mk b/Release/src/test/subdir.mk index 0c36dd6..f197a54 100644 --- a/Release/src/test/subdir.mk +++ b/Release/src/test/subdir.mk @@ -23,7 +23,7 @@ C_DEPS += \ src/test/%.o: ../src/test/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + 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 ' ' diff --git a/Release/src/transport/subdir.mk b/Release/src/transport/subdir.mk index 6af4b8b..412b981 100644 --- a/Release/src/transport/subdir.mk +++ b/Release/src/transport/subdir.mk @@ -17,7 +17,7 @@ C_DEPS += \ src/transport/%.o: ../src/transport/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - gcc -I"../src/codec" -I"../src/din" -I"../src/appHandshake" -I"../src/transport" -I"../src/test" -Os -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + 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 ' ' diff --git a/src/appHandshake/appHandEXIDatatypes.c b/src/appHandshake/appHandEXIDatatypes.c index a4d6ada..ba88d80 100644 --- a/src/appHandshake/appHandEXIDatatypes.c +++ b/src/appHandshake/appHandEXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/appHandshake/appHandEXIDatatypes.h b/src/appHandshake/appHandEXIDatatypes.h index 4e9cbdb..9eebcf4 100644 --- a/src/appHandshake/appHandEXIDatatypes.h +++ b/src/appHandshake/appHandEXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/appHandshake/appHandEXIDatatypesDecoder.c b/src/appHandshake/appHandEXIDatatypesDecoder.c index 61e5fdc..0733731 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.c +++ b/src/appHandshake/appHandEXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/appHandshake/appHandEXIDatatypesDecoder.h b/src/appHandshake/appHandEXIDatatypesDecoder.h index 8451d3f..bd43109 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.h +++ b/src/appHandshake/appHandEXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.c b/src/appHandshake/appHandEXIDatatypesEncoder.c index 28eb832..633dc4a 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.c +++ b/src/appHandshake/appHandEXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.h b/src/appHandshake/appHandEXIDatatypesEncoder.h index f9c243f..ce428e2 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.h +++ b/src/appHandshake/appHandEXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/AbstractDecoderChannel.c b/src/codec/AbstractDecoderChannel.c index 3405329..595c770 100644 --- a/src/codec/AbstractDecoderChannel.c +++ b/src/codec/AbstractDecoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/AbstractEncoderChannel.c b/src/codec/AbstractEncoderChannel.c index b0700c7..f556626 100644 --- a/src/codec/AbstractEncoderChannel.c +++ b/src/codec/AbstractEncoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/BitDecoderChannel.c b/src/codec/BitDecoderChannel.c index 18c9457..554fc51 100644 --- a/src/codec/BitDecoderChannel.c +++ b/src/codec/BitDecoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/BitEncoderChannel.c b/src/codec/BitEncoderChannel.c index 6776436..4c4345a 100644 --- a/src/codec/BitEncoderChannel.c +++ b/src/codec/BitEncoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/BitInputStream.c b/src/codec/BitInputStream.c index 64dd3d8..a5969a9 100644 --- a/src/codec/BitInputStream.c +++ b/src/codec/BitInputStream.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/BitInputStream.h b/src/codec/BitInputStream.h index 218c54b..b113ea6 100644 --- a/src/codec/BitInputStream.h +++ b/src/codec/BitInputStream.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/BitOutputStream.c b/src/codec/BitOutputStream.c index abc98da..ea84190 100644 --- a/src/codec/BitOutputStream.c +++ b/src/codec/BitOutputStream.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/BitOutputStream.h b/src/codec/BitOutputStream.h index 5a647f0..6b05876 100644 --- a/src/codec/BitOutputStream.h +++ b/src/codec/BitOutputStream.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/ByteDecoderChannel.c b/src/codec/ByteDecoderChannel.c index 5b6b97e..fb9c2fd 100644 --- a/src/codec/ByteDecoderChannel.c +++ b/src/codec/ByteDecoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/ByteEncoderChannel.c b/src/codec/ByteEncoderChannel.c index 544e44a..bf70603 100644 --- a/src/codec/ByteEncoderChannel.c +++ b/src/codec/ByteEncoderChannel.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/ByteStream.c b/src/codec/ByteStream.c index 5c845ae..c4d4d22 100644 --- a/src/codec/ByteStream.c +++ b/src/codec/ByteStream.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/ByteStream.h b/src/codec/ByteStream.h index ff4deef..578288f 100644 --- a/src/codec/ByteStream.h +++ b/src/codec/ByteStream.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/DecoderChannel.h b/src/codec/DecoderChannel.h index c84b605..bf489ad 100644 --- a/src/codec/DecoderChannel.h +++ b/src/codec/DecoderChannel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/EXIConfig.h b/src/codec/EXIConfig.h index 6c3af6b..635fa53 100644 --- a/src/codec/EXIConfig.h +++ b/src/codec/EXIConfig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -79,7 +79,7 @@ extern "C" { * * ASCII or UCS * */ -#define STRING_REPRESENTATION STRING_REPRESENTATION_UCS +#define STRING_REPRESENTATION STRING_REPRESENTATION_ASCII diff --git a/src/codec/EXIHeaderDecoder.c b/src/codec/EXIHeaderDecoder.c index 6faf8cc..e231f26 100644 --- a/src/codec/EXIHeaderDecoder.c +++ b/src/codec/EXIHeaderDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/EXIHeaderDecoder.h b/src/codec/EXIHeaderDecoder.h index 6510bf1..7f15162 100644 --- a/src/codec/EXIHeaderDecoder.h +++ b/src/codec/EXIHeaderDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/EXIHeaderEncoder.c b/src/codec/EXIHeaderEncoder.c index d37629e..f4120b8 100644 --- a/src/codec/EXIHeaderEncoder.c +++ b/src/codec/EXIHeaderEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/EXIHeaderEncoder.h b/src/codec/EXIHeaderEncoder.h index abae916..34cc8f7 100644 --- a/src/codec/EXIHeaderEncoder.h +++ b/src/codec/EXIHeaderEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/EXIOptions.h b/src/codec/EXIOptions.h index f8d8f36..919b9fa 100644 --- a/src/codec/EXIOptions.h +++ b/src/codec/EXIOptions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/EXITypes.h b/src/codec/EXITypes.h index 98a6dd6..b0e34db 100644 --- a/src/codec/EXITypes.h +++ b/src/codec/EXITypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/EncoderChannel.h b/src/codec/EncoderChannel.h index 6d5b85b..dfdb802 100644 --- a/src/codec/EncoderChannel.h +++ b/src/codec/EncoderChannel.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/ErrorCodes.h b/src/codec/ErrorCodes.h index 368215d..e574a45 100644 --- a/src/codec/ErrorCodes.h +++ b/src/codec/ErrorCodes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -91,6 +91,7 @@ extern "C" { #define EXI_UNSUPPORTED_STRING_VALUE_TYPE -141 #define EXI_UNSUPPORTED_INTEGER_VALUE_TYPE -142 #define EXI_UNSUPPORTED_DATETIME_TYPE -143 +#define EXI_UNSUPPORTED_FRAGMENT_ELEMENT -144 #define EXI_UNSUPPORTED_GRAMMAR_LEARNING_CH -150 diff --git a/src/codec/MethodsBag.c b/src/codec/MethodsBag.c index cd34fd9..b637bb6 100644 --- a/src/codec/MethodsBag.c +++ b/src/codec/MethodsBag.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/MethodsBag.h b/src/codec/MethodsBag.h index 6f7413a..9dce9c5 100644 --- a/src/codec/MethodsBag.h +++ b/src/codec/MethodsBag.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/codec/v2gEXIDatatypes.c b/src/codec/v2gEXIDatatypes.c index 8836874..a4070d0 100644 --- a/src/codec/v2gEXIDatatypes.c +++ b/src/codec/v2gEXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -124,252 +124,316 @@ void init_v2gEXIDocument(struct v2gEXIDocument* exiDoc) { exiDoc->Object_isUsed = 0u; } -void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType) { - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 0u; -} - -void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { -} - -void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { - v2gServiceDiscoveryReqType->ServiceScope_isUsed = 0u; - v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; -} - -void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType) { - v2gSignatureType->Id_isUsed = 0u; - v2gSignatureType->KeyInfo_isUsed = 0u; - v2gSignatureType->Object.arrayLen = 0u; -} - -void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType) { - v2gNotificationType->FaultMsg_isUsed = 0u; -} - -void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { -} - -void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { -} - -void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - v2gSignaturePropertyType->Id_isUsed = 0u; -} - -void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType) { - v2gReferenceType->Id_isUsed = 0u; - v2gReferenceType->URI_isUsed = 0u; - v2gReferenceType->Type_isUsed = 0u; - v2gReferenceType->Transforms_isUsed = 0u; -} - -void init_v2gManifestType(struct v2gManifestType* v2gManifestType) { - v2gManifestType->Id_isUsed = 0u; - v2gManifestType->Reference.arrayLen = 0u; -} - -void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType) { - v2gSelectedServiceType->ParameterSetID_isUsed = 0u; -} - -void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType) { - v2gEVChargeParameterType->DepartureTime_isUsed = 0u; +#if DEPLOY_ISO_CODEC_FRAGMENT == SUPPORT_YES +void init_v2gEXIFragment(struct v2gEXIFragment* exiFrag) { + exiFrag->RSAKeyValue_isUsed = 0u; + exiFrag->ServiceDetailReq_isUsed = 0u; + exiFrag->EVSEEnergyToBeDelivered_isUsed = 0u; + exiFrag->CableCheckRes_isUsed = 0u; + exiFrag->EVMaxVoltage_isUsed = 0u; + exiFrag->RemainingTimeToBulkSoC_isUsed = 0u; + exiFrag->Notification_isUsed = 0u; + exiFrag->Parameter_isUsed = 0u; + exiFrag->amountMultiplier_isUsed = 0u; + exiFrag->EVSEMaximumVoltageLimit_isUsed = 0u; + exiFrag->ChargeParameterDiscoveryRes_isUsed = 0u; + exiFrag->FaultCode_isUsed = 0u; + exiFrag->ChargingProfile_isUsed = 0u; + exiFrag->EVSEStatusCode_isUsed = 0u; + exiFrag->Exponent_isUsed = 0u; + exiFrag->ServiceDetailRes_isUsed = 0u; + exiFrag->PreChargeReq_isUsed = 0u; + exiFrag->EVSEMaximumPowerLimit_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 0u; + exiFrag->J_isUsed = 0u; + exiFrag->RelativeTimeInterval_isUsed = 0u; + exiFrag->CertificateUpdateReq_isUsed = 0u; + exiFrag->Transforms_isUsed = 0u; + exiFrag->X509CRL_isUsed = 0u; + exiFrag->Manifest_isUsed = 0u; + exiFrag->BulkChargingComplete_isUsed = 0u; + exiFrag->ChargingComplete_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->EVSENotification_isUsed = 0u; + exiFrag->EVSEPowerLimitAchieved_isUsed = 0u; + exiFrag->ServiceScope_isUsed = 0u; + exiFrag->EVSETimeStamp_isUsed = 0u; + exiFrag->EVSETimeStamp_isUsed = 0u; + exiFrag->OEMProvisioningCert_isUsed = 0u; + exiFrag->MeterID_isUsed = 0u; + exiFrag->SalesTariffID_isUsed = 0u; + exiFrag->TMeter_isUsed = 0u; + exiFrag->byteValue_isUsed = 0u; + exiFrag->DigestMethod_isUsed = 0u; + exiFrag->FaultMsg_isUsed = 0u; + exiFrag->FullSOC_isUsed = 0u; + exiFrag->WeldingDetectionReq_isUsed = 0u; + exiFrag->BulkChargingComplete_isUsed = 0u; + exiFrag->SAScheduleList_isUsed = 0u; + exiFrag->eMAID_isUsed = 0u; + exiFrag->eMAID_isUsed = 0u; + exiFrag->eMAID_isUsed = 0u; + exiFrag->eMAID_isUsed = 0u; + exiFrag->ServiceDiscoveryReq_isUsed = 0u; + exiFrag->EVMaxCurrent_isUsed = 0u; + exiFrag->X509IssuerSerial_isUsed = 0u; + exiFrag->BodyElement_isUsed = 0u; + exiFrag->EVSEChargeParameter_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->EVSEPresentCurrent_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->ServiceCategory_isUsed = 0u; + exiFrag->EVPowerDeliveryParameter_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->PaymentOption_isUsed = 0u; + exiFrag->CertificateInstallationRes_isUsed = 0u; + exiFrag->PgenCounter_isUsed = 0u; + exiFrag->EVMaximumPowerLimit_isUsed = 0u; + exiFrag->X509SerialNumber_isUsed = 0u; + exiFrag->Body_isUsed = 0u; + exiFrag->EVTargetVoltage_isUsed = 0u; + exiFrag->EPriceLevel_isUsed = 0u; + exiFrag->EVTargetVoltage_isUsed = 0u; + exiFrag->FreeService_isUsed = 0u; + exiFrag->Reference_isUsed = 0u; + exiFrag->CurrentDemandReq_isUsed = 0u; + exiFrag->SignedInfo_isUsed = 0u; + exiFrag->TimeInterval_isUsed = 0u; + exiFrag->ChargeService_isUsed = 0u; + exiFrag->Service_isUsed = 0u; + exiFrag->boolValue_isUsed = 0u; + exiFrag->MeteringReceiptReq_isUsed = 0u; + exiFrag->EVSEID_isUsed = 0u; + exiFrag->MeterInfo_isUsed = 0u; + exiFrag->KeyValue_isUsed = 0u; + exiFrag->EVSEID_isUsed = 0u; + exiFrag->MeterInfo_isUsed = 0u; + exiFrag->EVSEID_isUsed = 0u; + exiFrag->MeterInfo_isUsed = 0u; + exiFrag->stringValue_isUsed = 0u; + exiFrag->EVSEMaxCurrent_isUsed = 0u; + exiFrag->ContractSignatureEncryptedPrivateKey_isUsed = 0u; + exiFrag->ContractSignatureEncryptedPrivateKey_isUsed = 0u; + exiFrag->PMax_isUsed = 0u; + exiFrag->RemainingTimeToFullSoC_isUsed = 0u; + exiFrag->EVSEStatus_isUsed = 0u; + exiFrag->Unit_isUsed = 0u; + exiFrag->Y_isUsed = 0u; + exiFrag->RequestedEnergyTransferMode_isUsed = 0u; + exiFrag->EVSEPeakCurrentRipple_isUsed = 0u; + exiFrag->EAmount_isUsed = 0u; + exiFrag->EVSEPresentVoltage_isUsed = 0u; + exiFrag->EVSEPresentVoltage_isUsed = 0u; + exiFrag->EVSEPresentVoltage_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->AC_EVSEChargeParameter_isUsed = 0u; + exiFrag->SignatureMethod_isUsed = 0u; + exiFrag->AC_EVSEStatus_isUsed = 0u; + exiFrag->ReceiptRequired_isUsed = 0u; + exiFrag->AC_EVSEStatus_isUsed = 0u; + exiFrag->ReceiptRequired_isUsed = 0u; + exiFrag->ChargingProfileEntryStart_isUsed = 0u; + exiFrag->CurrentDemandRes_isUsed = 0u; + exiFrag->ConsumptionCost_isUsed = 0u; + exiFrag->ServiceParameterList_isUsed = 0u; + exiFrag->EVSEMaximumCurrentLimit_isUsed = 0u; + exiFrag->X509Data_isUsed = 0u; + exiFrag->Seed_isUsed = 0u; + exiFrag->SalesTariffDescription_isUsed = 0u; + exiFrag->Modulus_isUsed = 0u; + exiFrag->EVMaximumVoltageLimit_isUsed = 0u; + exiFrag->Certificate_isUsed = 0u; + exiFrag->Certificate_isUsed = 0u; + exiFrag->CableCheckReq_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->Multiplier_isUsed = 0u; + exiFrag->KeyInfo_isUsed = 0u; + exiFrag->EVTargetCurrent_isUsed = 0u; + exiFrag->EVTargetCurrent_isUsed = 0u; + exiFrag->PowerDeliveryReq_isUsed = 0u; + exiFrag->X509IssuerName_isUsed = 0u; + exiFrag->SessionStopReq_isUsed = 0u; + exiFrag->X509SubjectName_isUsed = 0u; + exiFrag->PMaxScheduleEntry_isUsed = 0u; + exiFrag->ChargeProgress_isUsed = 0u; + exiFrag->SelectedPaymentOption_isUsed = 0u; + exiFrag->MgmtData_isUsed = 0u; + exiFrag->AC_EVChargeParameter_isUsed = 0u; + exiFrag->EVSEMinimumCurrentLimit_isUsed = 0u; + exiFrag->WeldingDetectionRes_isUsed = 0u; + exiFrag->physicalValue_isUsed = 0u; + exiFrag->ServiceName_isUsed = 0u; + exiFrag->NumEPriceLevels_isUsed = 0u; + exiFrag->EVSEProcessing_isUsed = 0u; + exiFrag->EVSEProcessing_isUsed = 0u; + exiFrag->EVSEProcessing_isUsed = 0u; + exiFrag->PGPKeyID_isUsed = 0u; + exiFrag->startValue_isUsed = 0u; + exiFrag->MeteringReceiptRes_isUsed = 0u; + exiFrag->EVEnergyRequest_isUsed = 0u; + exiFrag->MaxEntriesSAScheduleTuple_isUsed = 0u; + exiFrag->EVReady_isUsed = 0u; + exiFrag->X509SKI_isUsed = 0u; + exiFrag->EVSEMaximumVoltageLimit_isUsed = 0u; + exiFrag->SignatureProperties_isUsed = 0u; + exiFrag->P_isUsed = 0u; + exiFrag->SignatureValue_isUsed = 0u; + exiFrag->MeterStatus_isUsed = 0u; + exiFrag->DC_EVSEChargeParameter_isUsed = 0u; + exiFrag->SalesTariff_isUsed = 0u; + exiFrag->SessionSetupReq_isUsed = 0u; + exiFrag->EVMinCurrent_isUsed = 0u; + exiFrag->RetryCounter_isUsed = 0u; + exiFrag->AC_EVSEStatus_isUsed = 0u; + exiFrag->PGPData_isUsed = 0u; + exiFrag->EVMaximumPowerLimit_isUsed = 0u; + exiFrag->SessionStopRes_isUsed = 0u; + exiFrag->AuthorizationReq_isUsed = 0u; + exiFrag->ServiceDiscoveryRes_isUsed = 0u; + exiFrag->GenChallenge_isUsed = 0u; + exiFrag->GenChallenge_isUsed = 0u; + exiFrag->SAScheduleTuple_isUsed = 0u; + exiFrag->PaymentServiceSelectionRes_isUsed = 0u; + exiFrag->DC_EVPowerDeliveryParameter_isUsed = 0u; + exiFrag->EVRESSSOC_isUsed = 0u; + exiFrag->ChargingStatusRes_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->X509Certificate_isUsed = 0u; + exiFrag->EVMaximumCurrentLimit_isUsed = 0u; + exiFrag->SPKISexp_isUsed = 0u; + exiFrag->CanonicalizationMethod_isUsed = 0u; + exiFrag->duration_isUsed = 0u; + exiFrag->ParameterSet_isUsed = 0u; + exiFrag->ChargeParameterDiscoveryReq_isUsed = 0u; + exiFrag->SigMeterReading_isUsed = 0u; + exiFrag->SASchedules_isUsed = 0u; + exiFrag->SessionSetupRes_isUsed = 0u; + exiFrag->SupportedEnergyTransferMode_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->SPKIData_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->Object_isUsed = 0u; + exiFrag->ChargingComplete_isUsed = 0u; + exiFrag->DSAKeyValue_isUsed = 0u; + exiFrag->Signature_isUsed = 0u; + exiFrag->Transform_isUsed = 0u; + exiFrag->ChargingStatusReq_isUsed = 0u; + exiFrag->amount_isUsed = 0u; + exiFrag->SelectedServiceList_isUsed = 0u; + exiFrag->SessionID_isUsed = 0u; + exiFrag->G_isUsed = 0u; + exiFrag->start_isUsed = 0u; + exiFrag->PaymentOptionList_isUsed = 0u; + exiFrag->Cost_isUsed = 0u; + exiFrag->Header_isUsed = 0u; + exiFrag->PMaxSchedule_isUsed = 0u; + exiFrag->EVSEMinimumVoltageLimit_isUsed = 0u; + exiFrag->ProfileEntry_isUsed = 0u; + exiFrag->ServiceCategory_isUsed = 0u; + exiFrag->ServiceScope_isUsed = 0u; + exiFrag->EVSENominalVoltage_isUsed = 0u; + exiFrag->EVStatus_isUsed = 0u; + exiFrag->SelectedService_isUsed = 0u; + exiFrag->EnergyTransferMode_isUsed = 0u; + exiFrag->EVSECurrentLimitAchieved_isUsed = 0u; + exiFrag->Value_isUsed = 0u; + exiFrag->KeyName_isUsed = 0u; + exiFrag->PaymentServiceSelectionReq_isUsed = 0u; + exiFrag->EVSEVoltageLimitAchieved_isUsed = 0u; + exiFrag->PowerDeliveryRes_isUsed = 0u; + exiFrag->DigestValue_isUsed = 0u; + exiFrag->ParameterSetID_isUsed = 0u; + exiFrag->ParameterSetID_isUsed = 0u; + exiFrag->SubCertificates_isUsed = 0u; + exiFrag->DHpublickey_isUsed = 0u; + exiFrag->DHpublickey_isUsed = 0u; + exiFrag->CertificateInstallationReq_isUsed = 0u; + exiFrag->EVMaximumVoltageLimit_isUsed = 0u; + exiFrag->shortValue_isUsed = 0u; + exiFrag->SAProvisioningCertificateChain_isUsed = 0u; + exiFrag->SAProvisioningCertificateChain_isUsed = 0u; + exiFrag->RCD_isUsed = 0u; + exiFrag->EVEnergyCapacity_isUsed = 0u; + exiFrag->RetrievalMethod_isUsed = 0u; + exiFrag->PaymentDetailsReq_isUsed = 0u; + exiFrag->SessionID_isUsed = 0u; + exiFrag->NotificationMaxDelay_isUsed = 0u; + exiFrag->Entry_isUsed = 0u; + exiFrag->RootCertificateID_isUsed = 0u; + exiFrag->AuthorizationRes_isUsed = 0u; + exiFrag->costKind_isUsed = 0u; + exiFrag->DepartureTime_isUsed = 0u; + exiFrag->EVSEIsolationStatus_isUsed = 0u; + exiFrag->DC_EVChargeParameter_isUsed = 0u; + exiFrag->V2G_Message_isUsed = 0u; + exiFrag->EVSECurrentRegulationTolerance_isUsed = 0u; + exiFrag->EVCCID_isUsed = 0u; + exiFrag->EVChargeParameter_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->EVMaximumCurrentLimit_isUsed = 0u; + exiFrag->EVSEMaxCurrent_isUsed = 0u; + exiFrag->ChargingProfileEntryMaxPower_isUsed = 0u; + exiFrag->HMACOutputLength_isUsed = 0u; + exiFrag->intValue_isUsed = 0u; + exiFrag->ServiceList_isUsed = 0u; + exiFrag->SignatureProperty_isUsed = 0u; + exiFrag->BulkSOC_isUsed = 0u; + exiFrag->SalesTariffEntry_isUsed = 0u; + exiFrag->EVErrorCode_isUsed = 0u; + exiFrag->PreChargeRes_isUsed = 0u; + exiFrag->EVSEMaximumPowerLimit_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->CertificateUpdateRes_isUsed = 0u; + exiFrag->MeterReading_isUsed = 0u; + exiFrag->ListOfRootCertificateIDs_isUsed = 0u; + exiFrag->ListOfRootCertificateIDs_isUsed = 0u; + exiFrag->EVSEMaximumCurrentLimit_isUsed = 0u; + exiFrag->ChargingSession_isUsed = 0u; + exiFrag->PaymentDetailsRes_isUsed = 0u; + exiFrag->XPath_isUsed = 0u; + exiFrag->Q_isUsed = 0u; } +#endif /* DEPLOY_ISO_CODEC_FRAGMENT */ void init_v2gEVSEChargeParameterType(struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { } -void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType) { - v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; - v2gChargingStatusResType->MeterInfo_isUsed = 0u; - v2gChargingStatusResType->ReceiptRequired_isUsed = 0u; -} - -void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType) { -} - -void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { - v2gMeteringReceiptReqType->Id_isUsed = 0u; - v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; -} - -void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { - v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; - v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u; -} - -void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType) { - v2gServiceDetailResType->ServiceParameterList_isUsed = 0u; -} - -void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType) { - v2gCertificateChainType->Id_isUsed = 0u; - v2gCertificateChainType->SubCertificates_isUsed = 0u; -} - -void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { -} - -void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { - v2gMeteringReceiptResType->EVSEStatus_isUsed = 0u; - v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 0u; - v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 0u; -} - -void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { - v2gPowerDeliveryReqType->ChargingProfile_isUsed = 0u; - v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; - v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; -} - -void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType) { - v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u; -} - -void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType) { -} - -void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType) { - v2gChargeServiceType->ServiceName_isUsed = 0u; - v2gChargeServiceType->ServiceScope_isUsed = 0u; -} - -void init_v2gParameterType(struct v2gParameterType* v2gParameterType) { - v2gParameterType->boolValue_isUsed = 0u; - v2gParameterType->byteValue_isUsed = 0u; - v2gParameterType->shortValue_isUsed = 0u; - v2gParameterType->intValue_isUsed = 0u; - v2gParameterType->physicalValue_isUsed = 0u; - v2gParameterType->stringValue_isUsed = 0u; -} - -void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType) { -} - -void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { -} - -void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType) { - v2gKeyValueType->DSAKeyValue_isUsed = 0u; - v2gKeyValueType->RSAKeyValue_isUsed = 0u; -} - -void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType) { - v2gSessionSetupResType->EVSETimeStamp_isUsed = 0u; -} - -void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType) { -} - -void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType) { - v2gX509DataType->X509IssuerSerial.arrayLen = 0u; - v2gX509DataType->X509SKI.arrayLen = 0u; - v2gX509DataType->X509SubjectName.arrayLen = 0u; - v2gX509DataType->X509Certificate.arrayLen = 0u; - v2gX509DataType->X509CRL.arrayLen = 0u; -} - -void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { -} - -void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType) { - v2gPaymentOptionListType->PaymentOption.arrayLen = 0u; -} - -void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType) { - v2gSignatureMethodType->HMACOutputLength_isUsed = 0u; -} - -void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { - v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 0u; - v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u; -} - -void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { -} - -void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { -} - -void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { - v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u; -} - -void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType) { -} - -void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { - v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u; - v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u; - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u; - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 0u; - v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u; - v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; -} - -void init_v2gServiceType(struct v2gServiceType* v2gServiceType) { - v2gServiceType->ServiceName_isUsed = 0u; - v2gServiceType->ServiceScope_isUsed = 0u; -} - -void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType) { -} - -void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType) { - v2gConsumptionCostType->Cost.arrayLen = 0u; -} - -void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType) { -} - -void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType) { -} - -void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { -} - -void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { - v2gSignaturePropertiesType->Id_isUsed = 0u; - v2gSignaturePropertiesType->SignatureProperty.arrayLen = 0u; -} - -void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType) { - v2gSelectedServiceListType->SelectedService.arrayLen = 0u; -} - -void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { - v2gServiceDiscoveryResType->ServiceList_isUsed = 0u; -} - -void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType) { -} - -void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType) { -} - -void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType) { - v2gSignedInfoType->Id_isUsed = 0u; - v2gSignedInfoType->Reference.arrayLen = 0u; -} - -void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType) { -} - -void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType) { - v2gServiceListType->Service.arrayLen = 0u; -} - -void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { -} - -void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { - v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; -} - -void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType) { - v2gSPKIDataType->SPKISexp.arrayLen = 0u; +void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { + v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; } void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDemandResType) { @@ -380,15 +444,32 @@ void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDema v2gCurrentDemandResType->ReceiptRequired_isUsed = 0u; } -void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType) { - v2gKeyInfoType->Id_isUsed = 0u; - v2gKeyInfoType->KeyName.arrayLen = 0u; - v2gKeyInfoType->KeyValue.arrayLen = 0u; - v2gKeyInfoType->RetrievalMethod.arrayLen = 0u; - v2gKeyInfoType->X509Data.arrayLen = 0u; - v2gKeyInfoType->PGPData.arrayLen = 0u; - v2gKeyInfoType->SPKIData.arrayLen = 0u; - v2gKeyInfoType->MgmtData.arrayLen = 0u; +void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { +} + +void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType) { +} + +void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType) { + v2gSalesTariffType->Id_isUsed = 0u; + v2gSalesTariffType->SalesTariffDescription_isUsed = 0u; + v2gSalesTariffType->NumEPriceLevels_isUsed = 0u; + v2gSalesTariffType->SalesTariffEntry.arrayLen = 0u; +} + +void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType) { + v2gSignaturePropertyType->Id_isUsed = 0u; +} + +void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { +} + +void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType) { + v2gSPKIDataType->SPKISexp.arrayLen = 0u; +} + +void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType) { + v2gNotificationType->FaultMsg_isUsed = 0u; } void init_v2gObjectType(struct v2gObjectType* v2gObjectType) { @@ -397,80 +478,59 @@ void init_v2gObjectType(struct v2gObjectType* v2gObjectType) { v2gObjectType->Encoding_isUsed = 0u; } -void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { - v2gSAScheduleTupleType->SalesTariff_isUsed = 0u; -} - -void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType) { - v2gSignatureValueType->Id_isUsed = 0u; -} - -void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { - v2gPowerDeliveryResType->EVSEStatus_isUsed = 0u; - v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 0u; - v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 0u; -} - -void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType) { - v2gSubCertificatesType->Certificate.arrayLen = 0u; -} - -void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType) { - v2gAuthorizationReqType->Id_isUsed = 0u; - v2gAuthorizationReqType->GenChallenge_isUsed = 0u; -} - -void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType) { - v2gChargingProfileType->ProfileEntry.arrayLen = 0u; -} - -void init_v2gEntryType(struct v2gEntryType* v2gEntryType) { - v2gEntryType->TimeInterval_isUsed = 0u; - v2gEntryType->RelativeTimeInterval_isUsed = 0u; -} - -void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType) { -} - -void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen = 0u; -} - -void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType) { -} - -void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { - v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 0u; - v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 0u; - v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u; +void init_v2gManifestType(struct v2gManifestType* v2gManifestType) { + v2gManifestType->Id_isUsed = 0u; + v2gManifestType->Reference.arrayLen = 0u; } void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType) { v2gParameterSetType->Parameter.arrayLen = 0u; } -void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { +void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { } -void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType) { - v2gMeterInfoType->MeterReading_isUsed = 0u; - v2gMeterInfoType->SigMeterReading_isUsed = 0u; - v2gMeterInfoType->MeterStatus_isUsed = 0u; - v2gMeterInfoType->TMeter_isUsed = 0u; +void init_v2gRelativeTimeIntervalType(struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { + v2gRelativeTimeIntervalType->duration_isUsed = 0u; } -void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { +void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { } -void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType) { - v2gRetrievalMethodType->URI_isUsed = 0u; - v2gRetrievalMethodType->Type_isUsed = 0u; - v2gRetrievalMethodType->Transforms_isUsed = 0u; +void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType) { + v2gSubCertificatesType->Certificate.arrayLen = 0u; } -void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType) { +void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType) { + v2gPaymentOptionListType->PaymentOption.arrayLen = 0u; +} + +void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { + v2gSalesTariffEntryType->TimeInterval_isUsed = 0u; + v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; + v2gSalesTariffEntryType->EPriceLevel_isUsed = 0u; + v2gSalesTariffEntryType->ConsumptionCost.arrayLen = 0u; +} + +void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen = 0u; +} + +void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType) { + v2gSelectedServiceType->ParameterSetID_isUsed = 0u; +} + +void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { +} + +void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + v2gPowerDeliveryReqType->ChargingProfile_isUsed = 0u; + v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; + v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; +} + +void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType) { + v2gConsumptionCostType->Cost.arrayLen = 0u; } void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { @@ -482,39 +542,20 @@ void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_ v2gDC_EVChargeParameterType->BulkSOC_isUsed = 0u; } -void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { +void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType) { + v2gChargingProfileType->ProfileEntry.arrayLen = 0u; } -void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { - v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; +void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { + v2gMeteringReceiptReqType->Id_isUsed = 0u; + v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; } -void init_v2gRelativeTimeIntervalType(struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { - v2gRelativeTimeIntervalType->duration_isUsed = 0u; -} - -void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType) { -} - -void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType) { - v2gPGPDataType->PGPKeyID_isUsed = 0u; - v2gPGPDataType->PGPKeyPacket_isUsed = 0u; -} - -void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - v2gCertificateUpdateResType->RetryCounter_isUsed = 0u; -} - -void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { -} - -void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType) { - v2gDSAKeyValueType->P_isUsed = 0u; - v2gDSAKeyValueType->Q_isUsed = 0u; - v2gDSAKeyValueType->G_isUsed = 0u; - v2gDSAKeyValueType->J_isUsed = 0u; - v2gDSAKeyValueType->Seed_isUsed = 0u; - v2gDSAKeyValueType->PgenCounter_isUsed = 0u; +void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { + v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 0u; + v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u; } void init_v2gBodyType(struct v2gBodyType* v2gBodyType) { @@ -555,25 +596,31 @@ void init_v2gBodyType(struct v2gBodyType* v2gBodyType) { v2gBodyType->WeldingDetectionRes_isUsed = 0u; } -void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { +void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType) { + v2gTransformsType->Transform.arrayLen = 0u; } -void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType) { - v2gServiceParameterListType->ParameterSet.arrayLen = 0u; +void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { + v2gServiceDiscoveryReqType->ServiceScope_isUsed = 0u; + v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; } -void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType) { +void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType) { } -void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType) { - v2gSAScheduleListType->SAScheduleTuple.arrayLen = 0u; +void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType) { + v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 0u; } -void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType) { -} - -void init_v2gCostType(struct v2gCostType* v2gCostType) { - v2gCostType->amountMultiplier_isUsed = 0u; +void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType) { + v2gKeyInfoType->Id_isUsed = 0u; + v2gKeyInfoType->KeyName.arrayLen = 0u; + v2gKeyInfoType->KeyValue.arrayLen = 0u; + v2gKeyInfoType->RetrievalMethod.arrayLen = 0u; + v2gKeyInfoType->X509Data.arrayLen = 0u; + v2gKeyInfoType->PGPData.arrayLen = 0u; + v2gKeyInfoType->SPKIData.arrayLen = 0u; + v2gKeyInfoType->MgmtData.arrayLen = 0u; } void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType) { @@ -584,25 +631,27 @@ void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType void init_v2gServiceDetailReqType(struct v2gServiceDetailReqType* v2gServiceDetailReqType) { } -void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType) { - v2gTransformsType->Transform.arrayLen = 0u; +void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { } -void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { +void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { } -void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType) { +void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType) { } -void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { - v2gAC_EVChargeParameterType->DepartureTime_isUsed = 0u; +void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { } -void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { - v2gSalesTariffEntryType->TimeInterval_isUsed = 0u; - v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; - v2gSalesTariffEntryType->EPriceLevel_isUsed = 0u; - v2gSalesTariffEntryType->ConsumptionCost.arrayLen = 0u; +void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { + v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u; +} + +void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { + v2gServiceDiscoveryResType->ServiceList_isUsed = 0u; +} + +void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { } void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { @@ -610,21 +659,277 @@ void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxSched v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u; } -void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType) { +void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { + v2gCertificateUpdateResType->RetryCounter_isUsed = 0u; } -void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType) { - v2gSalesTariffType->Id_isUsed = 0u; - v2gSalesTariffType->SalesTariffDescription_isUsed = 0u; - v2gSalesTariffType->NumEPriceLevels_isUsed = 0u; - v2gSalesTariffType->SalesTariffEntry.arrayLen = 0u; +void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { +} + +void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType) { +} + +void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType) { + v2gPGPDataType->PGPKeyID_isUsed = 0u; + v2gPGPDataType->PGPKeyPacket_isUsed = 0u; +} + +void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType) { + v2gServiceParameterListType->ParameterSet.arrayLen = 0u; +} + +void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType) { +} + +void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType) { +} + +void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { +} + +void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { +} + +void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType) { +} + +void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { + v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u; + v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u; + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u; + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 0u; + v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u; + v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; +} + +void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType) { +} + +void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType) { + v2gDSAKeyValueType->P_isUsed = 0u; + v2gDSAKeyValueType->Q_isUsed = 0u; + v2gDSAKeyValueType->G_isUsed = 0u; + v2gDSAKeyValueType->J_isUsed = 0u; + v2gDSAKeyValueType->Seed_isUsed = 0u; + v2gDSAKeyValueType->PgenCounter_isUsed = 0u; +} + +void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType) { + v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; + v2gChargingStatusResType->MeterInfo_isUsed = 0u; + v2gChargingStatusResType->ReceiptRequired_isUsed = 0u; +} + +void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType) { + v2gReferenceType->Id_isUsed = 0u; + v2gReferenceType->URI_isUsed = 0u; + v2gReferenceType->Type_isUsed = 0u; + v2gReferenceType->Transforms_isUsed = 0u; +} + +void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType) { +} + +void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { +} + +void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { + v2gAC_EVChargeParameterType->DepartureTime_isUsed = 0u; +} + +void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType) { + v2gSignatureMethodType->HMACOutputLength_isUsed = 0u; +} + +void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { +} + +void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType) { + v2gCertificateChainType->Id_isUsed = 0u; + v2gCertificateChainType->SubCertificates_isUsed = 0u; +} + +void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType) { + v2gSessionSetupResType->EVSETimeStamp_isUsed = 0u; +} + +void init_v2gCostType(struct v2gCostType* v2gCostType) { + v2gCostType->amountMultiplier_isUsed = 0u; +} + +void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType) { + v2gX509DataType->X509IssuerSerial.arrayLen = 0u; + v2gX509DataType->X509SKI.arrayLen = 0u; + v2gX509DataType->X509SubjectName.arrayLen = 0u; + v2gX509DataType->X509Certificate.arrayLen = 0u; + v2gX509DataType->X509CRL.arrayLen = 0u; +} + +void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType) { +} + +void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType) { + v2gMeterInfoType->MeterReading_isUsed = 0u; + v2gMeterInfoType->SigMeterReading_isUsed = 0u; + v2gMeterInfoType->MeterStatus_isUsed = 0u; + v2gMeterInfoType->TMeter_isUsed = 0u; +} + +void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType) { +} + +void init_v2gEntryType(struct v2gEntryType* v2gEntryType) { + v2gEntryType->TimeInterval_isUsed = 0u; + v2gEntryType->RelativeTimeInterval_isUsed = 0u; +} + +void init_v2gServiceType(struct v2gServiceType* v2gServiceType) { + v2gServiceType->ServiceName_isUsed = 0u; + v2gServiceType->ServiceScope_isUsed = 0u; +} + +void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType) { + v2gSelectedServiceListType->SelectedService.arrayLen = 0u; +} + +void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType) { + v2gChargeServiceType->ServiceName_isUsed = 0u; + v2gChargeServiceType->ServiceScope_isUsed = 0u; +} + +void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType) { + v2gServiceDetailResType->ServiceParameterList_isUsed = 0u; +} + +void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType) { + v2gSignatureValueType->Id_isUsed = 0u; +} + +void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { + v2gSignaturePropertiesType->Id_isUsed = 0u; + v2gSignaturePropertiesType->SignatureProperty.arrayLen = 0u; +} + +void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType) { + v2gAuthorizationReqType->Id_isUsed = 0u; + v2gAuthorizationReqType->GenChallenge_isUsed = 0u; +} + +void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType) { +} + +void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { + v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; + v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u; +} + +void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType) { + v2gSAScheduleListType->SAScheduleTuple.arrayLen = 0u; +} + +void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType) { +} + +void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType) { + v2gKeyValueType->DSAKeyValue_isUsed = 0u; + v2gKeyValueType->RSAKeyValue_isUsed = 0u; +} + +void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { } void init_v2gTransformType(struct v2gTransformType* v2gTransformType) { v2gTransformType->XPath.arrayLen = 0u; } -void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { +void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType) { +} + +void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType) { +} + +void init_v2gParameterType(struct v2gParameterType* v2gParameterType) { + v2gParameterType->boolValue_isUsed = 0u; + v2gParameterType->byteValue_isUsed = 0u; + v2gParameterType->shortValue_isUsed = 0u; + v2gParameterType->intValue_isUsed = 0u; + v2gParameterType->physicalValue_isUsed = 0u; + v2gParameterType->stringValue_isUsed = 0u; +} + +void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType) { + v2gServiceListType->Service.arrayLen = 0u; +} + +void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType) { + v2gRetrievalMethodType->URI_isUsed = 0u; + v2gRetrievalMethodType->Type_isUsed = 0u; + v2gRetrievalMethodType->Transforms_isUsed = 0u; +} + +void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType) { + v2gEVChargeParameterType->DepartureTime_isUsed = 0u; +} + +void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { +} + +void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType) { +} + +void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType) { +} + +void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { + v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; +} + +void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType) { + v2gSignatureType->Id_isUsed = 0u; + v2gSignatureType->KeyInfo_isUsed = 0u; + v2gSignatureType->Object.arrayLen = 0u; +} + +void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType) { +} + +void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { +} + +void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType) { +} + +void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType) { + v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u; +} + +void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { + v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 0u; + v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 0u; + v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u; +} + +void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { + v2gPowerDeliveryResType->EVSEStatus_isUsed = 0u; + v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 0u; + v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 0u; +} + +void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { + v2gSAScheduleTupleType->SalesTariff_isUsed = 0u; +} + +void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType) { + v2gSignedInfoType->Id_isUsed = 0u; + v2gSignedInfoType->Reference.arrayLen = 0u; +} + +void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { + v2gMeteringReceiptResType->EVSEStatus_isUsed = 0u; + v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 0u; + v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 0u; } diff --git a/src/codec/v2gEXIDatatypes.h b/src/codec/v2gEXIDatatypes.h index bcd987e..f3f709c 100644 --- a/src/codec/v2gEXIDatatypes.h +++ b/src/codec/v2gEXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -45,6 +45,7 @@ extern "C" { #define SUPPORT_YES 1 #define SUPPORT_NO 2 #define DEPLOY_ISO_CODEC SUPPORT_YES +#define DEPLOY_ISO_CODEC_FRAGMENT SUPPORT_NO #if DEPLOY_ISO_CODEC == SUPPORT_YES @@ -59,43 +60,25 @@ extern "C" { #define UNION_NO 2 #define SAVE_MEMORY_WITH_UNNAMED_UNION UNION_YES -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE 50 -#define v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE 350 -struct v2gContractSignatureEncryptedPrivateKeyType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - /* simple content: urn:iso:15118:2:2013:MsgDataTypes,privateKeyType */ - struct { - uint8_t bytes[v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE]; - uint16_t bytesLen; - } CONTENT ; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gEVSEChargeParameterType { + int noContent; /* avoid warning */ }; typedef enum { - v2gunitSymbolType_h = 0, - v2gunitSymbolType_m = 1, - v2gunitSymbolType_s = 2, - v2gunitSymbolType_A = 3, - v2gunitSymbolType_V = 4, - v2gunitSymbolType_W = 5, - v2gunitSymbolType_Wh = 6 -} v2gunitSymbolType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -#define v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 -struct v2gX509IssuerSerialType { - /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ - struct { - exi_string_character_t characters[v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } X509IssuerName ; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ - int64_t X509SerialNumber ; -}; + v2gDC_EVErrorCodeType_NO_ERROR = 0, + v2gDC_EVErrorCodeType_FAILED_RESSTemperatureInhibit = 1, + v2gDC_EVErrorCodeType_FAILED_EVShiftPosition = 2, + v2gDC_EVErrorCodeType_FAILED_ChargerConnectorLockFault = 3, + v2gDC_EVErrorCodeType_FAILED_EVRESSMalfunction = 4, + v2gDC_EVErrorCodeType_FAILED_ChargingCurrentdifferential = 5, + v2gDC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange = 6, + v2gDC_EVErrorCodeType_Reserved_A = 7, + v2gDC_EVErrorCodeType_Reserved_B = 8, + v2gDC_EVErrorCodeType_Reserved_C = 9, + v2gDC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility = 10, + v2gDC_EVErrorCodeType_NoData = 11 +} v2gDC_EVErrorCodeType; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ #define v2gSignaturePropertyType_Target_CHARACTERS_SIZE 50 @@ -114,6 +97,106 @@ struct v2gSignaturePropertyType { unsigned int Id_isUsed:1; }; +typedef enum { + v2gserviceCategoryType_EVCharging = 0, + v2gserviceCategoryType_Internet = 1, + v2gserviceCategoryType_ContractCertificate = 2, + v2gserviceCategoryType_OtherCustom = 3 +} v2gserviceCategoryType; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define v2gSPKIDataType_SPKISexp_BYTES_SIZE 350 +#define v2gSPKIDataType_SPKISexp_ARRAY_SIZE 1 +struct v2gSPKIDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[v2gSPKIDataType_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } array[v2gSPKIDataType_SPKISexp_ARRAY_SIZE]; + uint16_t arrayLen; + } SPKISexp; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define v2gObjectType_Id_CHARACTERS_SIZE 50 +#define v2gObjectType_MimeType_CHARACTERS_SIZE 50 +#define v2gObjectType_Encoding_CHARACTERS_SIZE 50 +struct v2gObjectType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gObjectType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ + struct { + exi_string_character_t characters[v2gObjectType_MimeType_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MimeType ; + unsigned int MimeType_isUsed:1; + /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gObjectType_Encoding_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Encoding ; + unsigned int Encoding_isUsed:1; +}; + +typedef enum { + v2gpaymentOptionType_Contract = 0, + v2gpaymentOptionType_ExternalPayment = 1 +} v2gpaymentOptionType; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +struct v2gRelativeTimeIntervalType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":start, urn:iso:15118:2:2013:MsgDataTypes,#AnonType_startRelativeTimeIntervalType */ + uint32_t start ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":duration, urn:iso:15118:2:2013:MsgDataTypes,#AnonType_durationRelativeTimeIntervalType */ + uint32_t duration ; + unsigned int duration_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE 50 +#define v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE 350 +struct v2gContractSignatureEncryptedPrivateKeyType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* simple content: urn:iso:15118:2:2013:MsgDataTypes,privateKeyType */ + struct { + uint8_t bytes[v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE]; + uint16_t bytesLen; + } CONTENT ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ +#define v2gSubCertificatesType_Certificate_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ +#define v2gSubCertificatesType_Certificate_ARRAY_SIZE 4 +struct v2gSubCertificatesType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Certificate, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ + struct { + struct { + uint8_t bytes[v2gSubCertificatesType_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } array[v2gSubCertificatesType_Certificate_ARRAY_SIZE]; + uint16_t arrayLen; + } Certificate; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ +#define v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE 2 +struct v2gPaymentOptionListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":PaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ + struct { + v2gpaymentOptionType array[v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE]; + uint16_t arrayLen; + } PaymentOption; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ struct v2gSelectedServiceType { /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ @@ -123,62 +206,6 @@ struct v2gSelectedServiceType { unsigned int ParameterSetID_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ -struct v2gEVChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t DepartureTime ; - unsigned int DepartureTime_isUsed:1; -}; - -typedef enum { - v2gDC_EVErrorCodeType_NO_ERROR = 0, - v2gDC_EVErrorCodeType_FAILED_RESSTemperatureInhibit = 1, - v2gDC_EVErrorCodeType_FAILED_EVShiftPosition = 2, - v2gDC_EVErrorCodeType_FAILED_ChargerConnectorLockFault = 3, - v2gDC_EVErrorCodeType_FAILED_EVRESSMalfunction = 4, - v2gDC_EVErrorCodeType_FAILED_ChargingCurrentdifferential = 5, - v2gDC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange = 6, - v2gDC_EVErrorCodeType_Reserved_A = 7, - v2gDC_EVErrorCodeType_Reserved_B = 8, - v2gDC_EVErrorCodeType_Reserved_C = 9, - v2gDC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility = 10, - v2gDC_EVErrorCodeType_NoData = 11 -} v2gDC_EVErrorCodeType; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gEVSEChargeParameterType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 50 -struct v2gCanonicalizationMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; -}; - -typedef enum { - v2gisolationLevelType_Invalid = 0, - v2gisolationLevelType_Valid = 1, - v2gisolationLevelType_Warning = 2, - v2gisolationLevelType_Fault = 3, - v2gisolationLevelType_No_IMD = 4 -} v2gisolationLevelType; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gSASchedulesType { - int noContent; /* avoid warning */ -}; - -typedef enum { - v2gcostKindType_relativePricePercentage = 0, - v2gcostKindType_RenewableGenerationPercentage = 1, - v2gcostKindType_CarbonDioxideEmission = 2 -} v2gcostKindType; - typedef enum { v2gresponseCodeType_OK = 0, v2gresponseCodeType_OK_NewSessionEstablished = 1, @@ -208,6 +235,301 @@ typedef enum { v2gresponseCodeType_FAILED_CertificateRevoked = 25 } v2gresponseCodeType; +typedef enum { + v2gunitSymbolType_h = 0, + v2gunitSymbolType_m = 1, + v2gunitSymbolType_s = 2, + v2gunitSymbolType_A = 3, + v2gunitSymbolType_V = 4, + v2gunitSymbolType_W = 5, + v2gunitSymbolType_Wh = 6 +} v2gunitSymbolType; + +typedef enum { + v2gisolationLevelType_Invalid = 0, + v2gisolationLevelType_Valid = 1, + v2gisolationLevelType_Warning = 2, + v2gisolationLevelType_Fault = 3, + v2gisolationLevelType_No_IMD = 4 +} v2gisolationLevelType; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +#define v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ +struct v2gServiceDiscoveryReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ + v2gserviceCategoryType ServiceCategory ; + unsigned int ServiceCategory_isUsed:1; +}; + +typedef enum { + v2gvalueType_bool = 0, + v2gvalueType_byte = 1, + v2gvalueType_short = 2, + v2gvalueType_int = 3, + v2gvalueType_physicalValue = 4, + v2gvalueType_string = 5 +} v2gvalueType; + +typedef enum { + v2gchargeProgressType_Start = 0, + v2gchargeProgressType_Stop = 1, + v2gchargeProgressType_Renegotiate = 2 +} v2gchargeProgressType; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +struct v2gServiceDetailReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +struct v2gPhysicalValueType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Multiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ + int8_t Multiplier ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Unit, urn:iso:15118:2:2013:MsgDataTypes,unitSymbolType */ + v2gunitSymbolType Unit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Value, http://www.w3.org/2001/XMLSchema,short */ + int16_t Value ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +#define v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 +struct v2gX509IssuerSerialType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ + int64_t X509SerialNumber ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE 5 +struct v2gListOfRootCertificateIDsType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ + struct { + struct v2gX509IssuerSerialType array[v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE]; + uint16_t arrayLen; + } RootCertificateID; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +#define v2gPGPDataType_PGPKeyID_BYTES_SIZE 350 +#define v2gPGPDataType_PGPKeyPacket_BYTES_SIZE 350 +struct v2gPGPDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[v2gPGPDataType_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + unsigned int PGPKeyID_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[v2gPGPDataType_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + unsigned int PGPKeyPacket_isUsed:1; +}; + +typedef enum { + v2gfaultCodeType_ParsingError = 0, + v2gfaultCodeType_NoTLSRootCertificatAvailable = 1, + v2gfaultCodeType_UnknownError = 2 +} v2gfaultCodeType; + +typedef enum { + v2gchargingSessionType_Terminate = 0, + v2gchargingSessionType_Pause = 1 +} v2gchargingSessionType; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ +struct v2gSessionStopReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ChargingSession, urn:iso:15118:2:2013:MsgDataTypes,chargingSessionType */ + v2gchargingSessionType ChargingSession ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gSASchedulesType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE 50 +#define v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE 350 +struct v2gDiffieHellmanPublickeyType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* simple content: urn:iso:15118:2:2013:MsgDataTypes,dHpublickeyType */ + struct { + uint8_t bytes[v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE]; + uint16_t bytesLen; + } CONTENT ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +#define v2gSessionSetupReqType_EVCCID_BYTES_SIZE 6 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evccIDType is 6 */ +struct v2gSessionSetupReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":EVCCID, urn:iso:15118:2:2013:MsgDataTypes,evccIDType */ + struct { + uint8_t bytes[v2gSessionSetupReqType_EVCCID_BYTES_SIZE]; + uint16_t bytesLen; + } EVCCID ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +struct v2gDC_EVStatusType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVReady, http://www.w3.org/2001/XMLSchema,boolean */ + int EVReady ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode, urn:iso:15118:2:2013:MsgDataTypes,DC_EVErrorCodeType */ + v2gDC_EVErrorCodeType EVErrorCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ + int8_t EVRESSSOC ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +#define v2gDSAKeyValueType_P_BYTES_SIZE 350 +#define v2gDSAKeyValueType_Q_BYTES_SIZE 350 +#define v2gDSAKeyValueType_G_BYTES_SIZE 350 +#define v2gDSAKeyValueType_Y_BYTES_SIZE 350 +#define v2gDSAKeyValueType_J_BYTES_SIZE 350 +#define v2gDSAKeyValueType_Seed_BYTES_SIZE 350 +#define v2gDSAKeyValueType_PgenCounter_BYTES_SIZE 350 +struct v2gDSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":P, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gDSAKeyValueType_P_BYTES_SIZE]; + uint16_t bytesLen; + } P ; + unsigned int P_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Q, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gDSAKeyValueType_Q_BYTES_SIZE]; + uint16_t bytesLen; + } Q ; + unsigned int Q_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":G, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gDSAKeyValueType_G_BYTES_SIZE]; + uint16_t bytesLen; + } G ; + unsigned int G_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Y, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gDSAKeyValueType_Y_BYTES_SIZE]; + uint16_t bytesLen; + } Y ; + /* element: "http://www.w3.org/2000/09/xmldsig#":J, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gDSAKeyValueType_J_BYTES_SIZE]; + uint16_t bytesLen; + } J ; + unsigned int J_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Seed, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gDSAKeyValueType_Seed_BYTES_SIZE]; + uint16_t bytesLen; + } Seed ; + unsigned int Seed_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PgenCounter, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gDSAKeyValueType_PgenCounter_BYTES_SIZE]; + uint16_t bytesLen; + } PgenCounter ; + unsigned int PgenCounter_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +#define v2gRSAKeyValueType_Modulus_BYTES_SIZE 350 +#define v2gRSAKeyValueType_Exponent_BYTES_SIZE 350 +struct v2gRSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gRSAKeyValueType_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[v2gRSAKeyValueType_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE 65 +struct v2gSignatureMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ + int64_t HMACOutputLength ; + unsigned int HMACOutputLength_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ +struct v2gAC_EVChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t DepartureTime ; + unsigned int DepartureTime_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EAmount, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EAmount ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaxVoltage ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaxCurrent ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMinCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +#define v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE 50 +#define v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ +struct v2gCertificateInstallationReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* element: "urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ + struct { + uint8_t bytes[v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE]; + uint16_t bytesLen; + } OEMProvisioningCert ; + /* element: "urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +#define v2gCertificateChainType_Id_CHARACTERS_SIZE 50 +#define v2gCertificateChainType_Certificate_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ +struct v2gCertificateChainType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gCertificateChainType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Certificate, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ + struct { + uint8_t bytes[v2gCertificateChainType_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } Certificate ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SubCertificates, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ + struct v2gSubCertificatesType SubCertificates ; + unsigned int SubCertificates_isUsed:1; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ #define v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ struct v2gSessionSetupResType { @@ -273,103 +595,6 @@ struct v2gX509DataType { } X509CRL; }; -typedef enum { - v2gchargeProgressType_Start = 0, - v2gchargeProgressType_Stop = 1, - v2gchargeProgressType_Renegotiate = 2 -} v2gchargeProgressType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE 50 -struct v2gSignatureMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; - /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ - int64_t HMACOutputLength ; - unsigned int HMACOutputLength_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gEVPowerDeliveryParameterType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE 5 -struct v2gListOfRootCertificateIDsType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ - struct { - struct v2gX509IssuerSerialType array[v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE]; - uint16_t arrayLen; - } RootCertificateID; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -struct v2gDC_EVStatusType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVReady, http://www.w3.org/2001/XMLSchema,boolean */ - int EVReady ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode, urn:iso:15118:2:2013:MsgDataTypes,DC_EVErrorCodeType */ - v2gDC_EVErrorCodeType EVErrorCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ - int8_t EVRESSSOC ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -struct v2gSessionStopResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -struct v2gChargingStatusReqType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -struct v2gWeldingDetectionReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignaturePropertiesType_Id_CHARACTERS_SIZE 50 -#define v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 1 -struct v2gSignaturePropertiesType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gSignaturePropertiesType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct v2gSignaturePropertyType array[v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; - uint16_t arrayLen; - } SignatureProperty; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSelectedServiceListType_SelectedService_ARRAY_SIZE 5 -struct v2gSelectedServiceListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SelectedService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ - struct { - struct v2gSelectedServiceType array[v2gSelectedServiceListType_SelectedService_ARRAY_SIZE]; - uint16_t arrayLen; - } SelectedService; -}; - -typedef enum { - v2gvalueType_bool = 0, - v2gvalueType_byte = 1, - v2gvalueType_short = 2, - v2gvalueType_int = 3, - v2gvalueType_physicalValue = 4, - v2gvalueType_string = 5 -} v2gvalueType; - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ #define v2gEMAIDType_Id_CHARACTERS_SIZE 50 #define v2gEMAIDType_CONTENT_CHARACTERS_SIZE 50 @@ -386,161 +611,6 @@ struct v2gEMAIDType { } CONTENT ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gIntervalType { - int noContent; /* avoid warning */ -}; - -typedef enum { - v2gEVSEProcessingType_Finished = 0, - v2gEVSEProcessingType_Ongoing = 1, - v2gEVSEProcessingType_Ongoing_WaitingForCustomerInteraction = 2 -} v2gEVSEProcessingType; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -struct v2gCableCheckReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; -}; - -typedef enum { - v2gEVSENotificationType_None = 0, - v2gEVSENotificationType_StopCharging = 1, - v2gEVSENotificationType_ReNegotiation = 2 -} v2gEVSENotificationType; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ -struct v2gAC_EVSEStatusType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ - uint16_t NotificationMaxDelay ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ - v2gEVSENotificationType EVSENotification ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RCD, http://www.w3.org/2001/XMLSchema,boolean */ - int RCD ; -}; - -typedef enum { - v2gchargingSessionType_Terminate = 0, - v2gchargingSessionType_Pause = 1 -} v2gchargingSessionType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gSPKIDataType_SPKISexp_BYTES_SIZE 350 -#define v2gSPKIDataType_SPKISexp_ARRAY_SIZE 1 -struct v2gSPKIDataType { - /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - struct { - uint8_t bytes[v2gSPKIDataType_SPKISexp_BYTES_SIZE]; - uint16_t bytesLen; - } array[v2gSPKIDataType_SPKISexp_ARRAY_SIZE]; - uint16_t arrayLen; - } SPKISexp; -}; - -typedef enum { - v2gEnergyTransferModeType_AC_single_phase_core = 0, - v2gEnergyTransferModeType_AC_three_phase_core = 1, - v2gEnergyTransferModeType_DC_core = 2, - v2gEnergyTransferModeType_DC_extended = 3, - v2gEnergyTransferModeType_DC_combo_core = 4, - v2gEnergyTransferModeType_DC_unique = 5 -} v2gEnergyTransferModeType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gObjectType_Id_CHARACTERS_SIZE 50 -#define v2gObjectType_MimeType_CHARACTERS_SIZE 50 -#define v2gObjectType_Encoding_CHARACTERS_SIZE 50 -struct v2gObjectType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gObjectType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ - struct { - exi_string_character_t characters[v2gObjectType_MimeType_CHARACTERS_SIZE]; - uint16_t charactersLen; - } MimeType ; - unsigned int MimeType_isUsed:1; - /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gObjectType_Encoding_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Encoding ; - unsigned int Encoding_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define v2gSignatureValueType_Id_CHARACTERS_SIZE 50 -#define v2gSignatureValueType_CONTENT_BYTES_SIZE 350 -struct v2gSignatureValueType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gSignatureValueType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[v2gSignatureValueType_CONTENT_BYTES_SIZE]; - uint16_t bytesLen; - } CONTENT ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ -#define v2gSubCertificatesType_Certificate_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ -#define v2gSubCertificatesType_Certificate_ARRAY_SIZE 4 -struct v2gSubCertificatesType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Certificate, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ - struct { - struct { - uint8_t bytes[v2gSubCertificatesType_Certificate_BYTES_SIZE]; - uint16_t bytesLen; - } array[v2gSubCertificatesType_Certificate_ARRAY_SIZE]; - uint16_t arrayLen; - } Certificate; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -#define v2gAuthorizationReqType_Id_CHARACTERS_SIZE 50 -#define v2gAuthorizationReqType_GenChallenge_BYTES_SIZE 16 /* XML schema facet length for urn:iso:15118:2:2013:MsgDataTypes,genChallengeType is 16 */ -struct v2gAuthorizationReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gAuthorizationReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":GenChallenge, urn:iso:15118:2:2013:MsgDataTypes,genChallengeType */ - struct { - uint8_t bytes[v2gAuthorizationReqType_GenChallenge_BYTES_SIZE]; - uint16_t bytesLen; - } GenChallenge ; - unsigned int GenChallenge_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ -#define v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE 5 -struct v2gSupportedEnergyTransferModeType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ - struct { - v2gEnergyTransferModeType array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE]; - uint16_t arrayLen; - } EnergyTransferMode; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -struct v2gPhysicalValueType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Multiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ - int8_t Multiplier ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Unit, urn:iso:15118:2:2013:MsgDataTypes,unitSymbolType */ - v2gunitSymbolType Unit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Value, http://www.w3.org/2001/XMLSchema,short */ - int16_t Value ; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ #define v2gMeterInfoType_MeterID_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,meterIDType is 32 */ #define v2gMeterInfoType_SigMeterReading_BYTES_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sigMeterReadingType is 64 */ @@ -567,180 +637,96 @@ struct v2gMeterInfoType { unsigned int TMeter_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -#define v2gSessionSetupReqType_EVCCID_BYTES_SIZE 6 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evccIDType is 6 */ -struct v2gSessionSetupReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":EVCCID, urn:iso:15118:2:2013:MsgDataTypes,evccIDType */ +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +#define v2gServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ +#define v2gServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ +struct v2gServiceType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceName, urn:iso:15118:2:2013:MsgDataTypes,serviceNameType */ struct { - uint8_t bytes[v2gSessionSetupReqType_EVCCID_BYTES_SIZE]; - uint16_t bytesLen; - } EVCCID ; + exi_string_character_t characters[v2gServiceType_ServiceName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceName ; + unsigned int ServiceName_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ + v2gserviceCategoryType ServiceCategory ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[v2gServiceType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ + int FreeService ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ -struct v2gDC_EVChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t DepartureTime ; - unsigned int DepartureTime_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaximumCurrentLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaximumPowerLimit ; - unsigned int EVMaximumPowerLimit_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaximumVoltageLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVEnergyCapacity ; - unsigned int EVEnergyCapacity_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVEnergyRequest ; - unsigned int EVEnergyRequest_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FullSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ - int8_t FullSOC ; - unsigned int FullSOC_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ - int8_t BulkSOC ; - unsigned int BulkSOC_isUsed:1; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSelectedServiceListType_SelectedService_ARRAY_SIZE 5 +struct v2gSelectedServiceListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SelectedService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct v2gSelectedServiceType array[v2gSelectedServiceListType_SelectedService_ARRAY_SIZE]; + uint16_t arrayLen; + } SelectedService; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -struct v2gDC_EVPowerDeliveryParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ - int BulkChargingComplete ; - unsigned int BulkChargingComplete_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ - int ChargingComplete ; -}; +typedef enum { + v2gcostKindType_relativePricePercentage = 0, + v2gcostKindType_RenewableGenerationPercentage = 1, + v2gcostKindType_CarbonDioxideEmission = 2 +} v2gcostKindType; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -#define v2gRSAKeyValueType_Modulus_BYTES_SIZE 350 -#define v2gRSAKeyValueType_Exponent_BYTES_SIZE 350 -struct v2gRSAKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gRSAKeyValueType_Modulus_BYTES_SIZE]; - uint16_t bytesLen; - } Modulus ; - /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gRSAKeyValueType_Exponent_BYTES_SIZE]; - uint16_t bytesLen; - } Exponent ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -struct v2gRelativeTimeIntervalType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":start, urn:iso:15118:2:2013:MsgDataTypes,#AnonType_startRelativeTimeIntervalType */ - uint32_t start ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":duration, urn:iso:15118:2:2013:MsgDataTypes,#AnonType_durationRelativeTimeIntervalType */ - uint32_t duration ; - unsigned int duration_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -#define v2gPGPDataType_PGPKeyID_BYTES_SIZE 350 -#define v2gPGPDataType_PGPKeyPacket_BYTES_SIZE 350 -struct v2gPGPDataType { - /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[v2gPGPDataType_PGPKeyID_BYTES_SIZE]; - uint16_t bytesLen; - } PGPKeyID ; - unsigned int PGPKeyID_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[v2gPGPDataType_PGPKeyPacket_BYTES_SIZE]; - uint16_t bytesLen; - } PGPKeyPacket ; - unsigned int PGPKeyPacket_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -#define v2gDSAKeyValueType_P_BYTES_SIZE 350 -#define v2gDSAKeyValueType_Q_BYTES_SIZE 350 -#define v2gDSAKeyValueType_G_BYTES_SIZE 350 -#define v2gDSAKeyValueType_Y_BYTES_SIZE 350 -#define v2gDSAKeyValueType_J_BYTES_SIZE 350 -#define v2gDSAKeyValueType_Seed_BYTES_SIZE 350 -#define v2gDSAKeyValueType_PgenCounter_BYTES_SIZE 350 -struct v2gDSAKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":P, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gDSAKeyValueType_P_BYTES_SIZE]; - uint16_t bytesLen; - } P ; - unsigned int P_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Q, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gDSAKeyValueType_Q_BYTES_SIZE]; - uint16_t bytesLen; - } Q ; - unsigned int Q_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":G, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gDSAKeyValueType_G_BYTES_SIZE]; - uint16_t bytesLen; - } G ; - unsigned int G_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Y, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gDSAKeyValueType_Y_BYTES_SIZE]; - uint16_t bytesLen; - } Y ; - /* element: "http://www.w3.org/2000/09/xmldsig#":J, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gDSAKeyValueType_J_BYTES_SIZE]; - uint16_t bytesLen; - } J ; - unsigned int J_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Seed, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gDSAKeyValueType_Seed_BYTES_SIZE]; - uint16_t bytesLen; - } Seed ; - unsigned int Seed_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":PgenCounter, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[v2gDSAKeyValueType_PgenCounter_BYTES_SIZE]; - uint16_t bytesLen; - } PgenCounter ; - unsigned int PgenCounter_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ -#define v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE 16 /* XML schema facet length for urn:iso:15118:2:2013:MsgDataTypes,genChallengeType is 16 */ -struct v2gPaymentDetailsResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":GenChallenge, urn:iso:15118:2:2013:MsgDataTypes,genChallengeType */ - struct { - uint8_t bytes[v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE]; - uint16_t bytesLen; - } GenChallenge ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSETimeStamp, http://www.w3.org/2001/XMLSchema,long */ - int64_t EVSETimeStamp ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -#define v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE 50 -#define v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ -struct v2gCertificateInstallationReqType { +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define v2gSignatureValueType_Id_CHARACTERS_SIZE 50 +#define v2gSignatureValueType_CONTENT_BYTES_SIZE 350 +struct v2gSignatureValueType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { - exi_string_character_t characters[v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gSignatureValueType_Id_CHARACTERS_SIZE]; uint16_t charactersLen; } Id ; - /* element: "urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ + unsigned int Id_isUsed:1; + /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ struct { - uint8_t bytes[v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE]; + uint8_t bytes[v2gSignatureValueType_CONTENT_BYTES_SIZE]; uint16_t bytesLen; - } OEMProvisioningCert ; - /* element: "urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; + } CONTENT ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignaturePropertiesType_Id_CHARACTERS_SIZE 50 +#define v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 1 +struct v2gSignaturePropertiesType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSignaturePropertiesType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct v2gSignaturePropertyType array[v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; + uint16_t arrayLen; + } SignatureProperty; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +#define v2gAuthorizationReqType_Id_CHARACTERS_SIZE 50 +#define v2gAuthorizationReqType_GenChallenge_BYTES_SIZE 16 /* XML schema facet length for urn:iso:15118:2:2013:MsgDataTypes,genChallengeType is 16 */ +struct v2gAuthorizationReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gAuthorizationReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":GenChallenge, urn:iso:15118:2:2013:MsgDataTypes,genChallengeType */ + struct { + uint8_t bytes[v2gAuthorizationReqType_GenChallenge_BYTES_SIZE]; + uint16_t bytesLen; + } GenChallenge ; + unsigned int GenChallenge_isUsed:1; }; /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ @@ -748,8 +734,17 @@ struct v2gEVStatusType { int noContent; /* avoid warning */ }; +typedef enum { + v2gEnergyTransferModeType_AC_single_phase_core = 0, + v2gEnergyTransferModeType_AC_three_phase_core = 1, + v2gEnergyTransferModeType_DC_core = 2, + v2gEnergyTransferModeType_DC_extended = 3, + v2gEnergyTransferModeType_DC_combo_core = 4, + v2gEnergyTransferModeType_DC_unique = 5 +} v2gEnergyTransferModeType; + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gDigestMethodType_Algorithm_CHARACTERS_SIZE 50 +#define v2gDigestMethodType_Algorithm_CHARACTERS_SIZE 65 struct v2gDigestMethodType { /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { @@ -758,83 +753,23 @@ struct v2gDigestMethodType { } Algorithm ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -struct v2gCostType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":costKind, urn:iso:15118:2:2013:MsgDataTypes,costKindType */ - v2gcostKindType costKind ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":amount, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t amount ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ - int8_t amountMultiplier ; - unsigned int amountMultiplier_isUsed:1; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +struct v2gKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ + struct v2gDSAKeyValueType DSAKeyValue ; + unsigned int DSAKeyValue_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ + struct v2gRSAKeyValueType RSAKeyValue ; + unsigned int RSAKeyValue_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -struct v2gServiceDetailReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ -struct v2gAC_EVChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t DepartureTime ; - unsigned int DepartureTime_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EAmount, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EAmount ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaxVoltage ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaxCurrent ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMinCurrent ; -}; - -typedef enum { - v2gDC_EVSEStatusCodeType_EVSE_NotReady = 0, - v2gDC_EVSEStatusCodeType_EVSE_Ready = 1, - v2gDC_EVSEStatusCodeType_EVSE_Shutdown = 2, - v2gDC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent = 3, - v2gDC_EVSEStatusCodeType_EVSE_IsolationMonitoringActive = 4, - v2gDC_EVSEStatusCodeType_EVSE_EmergencyShutdown = 5, - v2gDC_EVSEStatusCodeType_EVSE_Malfunction = 6, - v2gDC_EVSEStatusCodeType_Reserved_8 = 7, - v2gDC_EVSEStatusCodeType_Reserved_9 = 8, - v2gDC_EVSEStatusCodeType_Reserved_A = 9, - v2gDC_EVSEStatusCodeType_Reserved_B = 10, - v2gDC_EVSEStatusCodeType_Reserved_C = 11 -} v2gDC_EVSEStatusCodeType; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -struct v2gPMaxScheduleEntryType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct v2gIntervalType TimeInterval ; - unsigned int TimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ - struct v2gRelativeTimeIntervalType RelativeTimeInterval ; - unsigned int RelativeTimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":PMax, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType PMax ; -}; - -typedef enum { - v2gpaymentOptionType_Contract = 0, - v2gpaymentOptionType_ExternalPayment = 1 -} v2gpaymentOptionType; - -typedef enum { - v2gfaultCodeType_ParsingError = 0, - v2gfaultCodeType_NoTLSRootCertificatAvailable = 1, - v2gfaultCodeType_UnknownError = 2 -} v2gfaultCodeType; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gBodyBaseType { +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gEVPowerDeliveryParameterType { int noContent; /* avoid warning */ }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gTransformType_Algorithm_CHARACTERS_SIZE 50 +#define v2gTransformType_Algorithm_CHARACTERS_SIZE 65 #define v2gTransformType_XPath_CHARACTERS_SIZE 50 #define v2gTransformType_XPath_ARRAY_SIZE 1 struct v2gTransformType { @@ -853,166 +788,15 @@ struct v2gTransformType { } XPath; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE 50 -#define v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE 350 -struct v2gDiffieHellmanPublickeyType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - /* simple content: urn:iso:15118:2:2013:MsgDataTypes,dHpublickeyType */ - struct { - uint8_t bytes[v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE]; - uint16_t bytesLen; - } CONTENT ; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gBodyBaseType { + int noContent; /* avoid warning */ }; -typedef enum { - v2gserviceCategoryType_EVCharging = 0, - v2gserviceCategoryType_Internet = 1, - v2gserviceCategoryType_ContractCertificate = 2, - v2gserviceCategoryType_OtherCustom = 3 -} v2gserviceCategoryType; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ -struct v2gProfileEntryType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t ChargingProfileEntryStart ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType ChargingProfileEntryMaxPower ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse, urn:iso:15118:2:2013:MsgDataTypes,maxNumPhasesType */ - int8_t ChargingProfileEntryMaxNumberOfPhasesInUse ; - unsigned int ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -#define v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ -struct v2gServiceDiscoveryReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ - struct { - exi_string_character_t characters[v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceScope ; - unsigned int ServiceScope_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ - v2gserviceCategoryType ServiceCategory ; - unsigned int ServiceCategory_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ -#define v2gNotificationType_FaultMsg_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,faultMsgType is 64 */ -struct v2gNotificationType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultCode, urn:iso:15118:2:2013:MsgDataTypes,faultCodeType */ - v2gfaultCodeType FaultCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultMsg, urn:iso:15118:2:2013:MsgDataTypes,faultMsgType */ - struct { - exi_string_character_t characters[v2gNotificationType_FaultMsg_CHARACTERS_SIZE]; - uint16_t charactersLen; - } FaultMsg ; - unsigned int FaultMsg_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ -struct v2gAC_EVSEChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSENominalVoltage ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaxCurrent ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -#define v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ -struct v2gChargingStatusResType { +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +struct v2gSessionStopResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ - struct { - exi_string_character_t characters[v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } EVSEID ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaxCurrent ; - unsigned int EVSEMaxCurrent_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ - struct v2gMeterInfoType MeterInfo ; - unsigned int MeterInfo_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":ReceiptRequired, http://www.w3.org/2001/XMLSchema,boolean */ - int ReceiptRequired ; - unsigned int ReceiptRequired_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ -struct v2gEVSEStatusType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ - uint16_t NotificationMaxDelay ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ - v2gEVSENotificationType EVSENotification ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -#define v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE 50 -#define v2gMeteringReceiptReqType_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ -struct v2gMeteringReceiptReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":SessionID, urn:iso:15118:2:2013:MsgDataTypes,sessionIDType */ - struct { - uint8_t bytes[v2gMeteringReceiptReqType_SessionID_BYTES_SIZE]; - uint16_t bytesLen; - } SessionID ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - unsigned int SAScheduleTupleID_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ - struct v2gMeterInfoType MeterInfo ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -#define v2gCertificateChainType_Id_CHARACTERS_SIZE 50 -#define v2gCertificateChainType_Certificate_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ -struct v2gCertificateChainType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gCertificateChainType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Certificate, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ - struct { - uint8_t bytes[v2gCertificateChainType_Certificate_BYTES_SIZE]; - uint16_t bytesLen; - } Certificate ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SubCertificates, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ - struct v2gSubCertificatesType SubCertificates ; - unsigned int SubCertificates_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE 5 -struct v2gPMaxScheduleType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ - struct { - struct v2gPMaxScheduleEntryType array[v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE]; - uint16_t arrayLen; - } PMaxScheduleEntry; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ -struct v2gSessionStopReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ChargingSession, urn:iso:15118:2:2013:MsgDataTypes,chargingSessionType */ - v2gchargingSessionType ChargingSession ; }; /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ @@ -1047,30 +831,146 @@ struct v2gParameterType { unsigned int stringValue_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ -#define v2gChargeServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ -#define v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ -struct v2gChargeServiceType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceName, urn:iso:15118:2:2013:MsgDataTypes,serviceNameType */ +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ +#define v2gServiceListType_Service_ARRAY_SIZE 5 +struct v2gServiceListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Service, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ struct { - exi_string_character_t characters[v2gChargeServiceType_ServiceName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceName ; - unsigned int ServiceName_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ - v2gserviceCategoryType ServiceCategory ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ + struct v2gServiceType array[v2gServiceListType_Service_ARRAY_SIZE]; + uint16_t arrayLen; + } Service; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 65 +struct v2gCanonicalizationMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { - exi_string_character_t characters[v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; uint16_t charactersLen; - } ServiceScope ; - unsigned int ServiceScope_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ - int FreeService ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ - struct v2gSupportedEnergyTransferModeType SupportedEnergyTransferMode ; + } Algorithm ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ +struct v2gEVChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t DepartureTime ; + unsigned int DepartureTime_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gIntervalType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +struct v2gPreChargeReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVTargetVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVTargetVoltage ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVTargetCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVTargetCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +struct v2gChargingStatusReqType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ +#define v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE 16 /* XML schema facet length for urn:iso:15118:2:2013:MsgDataTypes,genChallengeType is 16 */ +struct v2gPaymentDetailsResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":GenChallenge, urn:iso:15118:2:2013:MsgDataTypes,genChallengeType */ + struct { + uint8_t bytes[v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE]; + uint16_t bytesLen; + } GenChallenge ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSETimeStamp, http://www.w3.org/2001/XMLSchema,long */ + int64_t EVSETimeStamp ; +}; + +typedef enum { + v2gEVSEProcessingType_Finished = 0, + v2gEVSEProcessingType_Ongoing = 1, + v2gEVSEProcessingType_Ongoing_WaitingForCustomerInteraction = 2 +} v2gEVSEProcessingType; + +typedef enum { + v2gEVSENotificationType_None = 0, + v2gEVSENotificationType_StopCharging = 1, + v2gEVSENotificationType_ReNegotiation = 2 +} v2gEVSENotificationType; + +typedef enum { + v2gDC_EVSEStatusCodeType_EVSE_NotReady = 0, + v2gDC_EVSEStatusCodeType_EVSE_Ready = 1, + v2gDC_EVSEStatusCodeType_EVSE_Shutdown = 2, + v2gDC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent = 3, + v2gDC_EVSEStatusCodeType_EVSE_IsolationMonitoringActive = 4, + v2gDC_EVSEStatusCodeType_EVSE_EmergencyShutdown = 5, + v2gDC_EVSEStatusCodeType_EVSE_Malfunction = 6, + v2gDC_EVSEStatusCodeType_Reserved_8 = 7, + v2gDC_EVSEStatusCodeType_Reserved_9 = 8, + v2gDC_EVSEStatusCodeType_Reserved_A = 9, + v2gDC_EVSEStatusCodeType_Reserved_B = 10, + v2gDC_EVSEStatusCodeType_Reserved_C = 11 +} v2gDC_EVSEStatusCodeType; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +struct v2gDC_EVPowerDeliveryParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int BulkChargingComplete ; + unsigned int BulkChargingComplete_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int ChargingComplete ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ +struct v2gAC_EVSEStatusType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ + uint16_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ + v2gEVSENotificationType EVSENotification ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RCD, http://www.w3.org/2001/XMLSchema,boolean */ + int RCD ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +struct v2gPaymentServiceSelectionReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ + v2gpaymentOptionType SelectedPaymentOption ; + /* element: "urn:iso:15118:2:2013:MsgBody":SelectedServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSelectedServiceListType SelectedServiceList ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ +#define v2gNotificationType_FaultMsg_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,faultMsgType is 64 */ +struct v2gNotificationType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultCode, urn:iso:15118:2:2013:MsgDataTypes,faultCodeType */ + v2gfaultCodeType FaultCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultMsg, urn:iso:15118:2:2013:MsgDataTypes,faultMsgType */ + struct { + exi_string_character_t characters[v2gNotificationType_FaultMsg_CHARACTERS_SIZE]; + uint16_t charactersLen; + } FaultMsg ; + unsigned int FaultMsg_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gParameterSetType_Parameter_ARRAY_SIZE 5 +struct v2gParameterSetType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ + int16_t ParameterSetID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Parameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ + struct { + struct v2gParameterType array[v2gParameterSetType_Parameter_ARRAY_SIZE]; + uint16_t arrayLen; + } Parameter; }; /* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ @@ -1079,22 +979,121 @@ struct v2gPaymentServiceSelectionResType { v2gresponseCodeType ResponseCode ; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -struct v2gKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ - struct v2gDSAKeyValueType DSAKeyValue ; - unsigned int DSAKeyValue_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ - struct v2gRSAKeyValueType RSAKeyValue ; - unsigned int RSAKeyValue_isUsed:1; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ +#define v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE 5 +struct v2gSupportedEnergyTransferModeType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ + struct { + v2gEnergyTransferModeType array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE]; + uint16_t arrayLen; + } EnergyTransferMode; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -struct v2gAuthorizationResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ - v2gEVSEProcessingType EVSEProcessing ; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ +struct v2gDC_EVChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t DepartureTime ; + unsigned int DepartureTime_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaximumCurrentLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaximumPowerLimit ; + unsigned int EVMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaximumVoltageLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVEnergyCapacity ; + unsigned int EVEnergyCapacity_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVEnergyRequest ; + unsigned int EVEnergyRequest_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FullSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ + int8_t FullSOC ; + unsigned int FullSOC_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ + int8_t BulkSOC ; + unsigned int BulkSOC_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +#define v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE 50 +#define v2gMeteringReceiptReqType_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ +struct v2gMeteringReceiptReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":SessionID, urn:iso:15118:2:2013:MsgDataTypes,sessionIDType */ + struct { + uint8_t bytes[v2gMeteringReceiptReqType_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + unsigned int SAScheduleTupleID_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct v2gMeterInfoType MeterInfo ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +struct v2gChargeParameterDiscoveryReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple, http://www.w3.org/2001/XMLSchema,unsignedShort */ + uint16_t MaxEntriesSAScheduleTuple ; + unsigned int MaxEntriesSAScheduleTuple_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ + v2gEnergyTransferModeType RequestedEnergyTransferMode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ + struct v2gEVChargeParameterType EVChargeParameter ; + unsigned int EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ + struct v2gAC_EVChargeParameterType AC_EVChargeParameter ; + unsigned int AC_EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ + struct v2gDC_EVChargeParameterType DC_EVChargeParameter ; + unsigned int DC_EVChargeParameter_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gTransformsType_Transform_ARRAY_SIZE 1 +struct v2gTransformsType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct v2gTransformType array[v2gTransformsType_Transform_ARRAY_SIZE]; + uint16_t arrayLen; + } Transform; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ +struct v2gEVSEStatusType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ + uint16_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ + v2gEVSENotificationType EVSENotification ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ +struct v2gProfileEntryType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t ChargingProfileEntryStart ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType ChargingProfileEntryMaxPower ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse, urn:iso:15118:2:2013:MsgDataTypes,maxNumPhasesType */ + int8_t ChargingProfileEntryMaxNumberOfPhasesInUse ; + unsigned int ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ +struct v2gAC_EVSEChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSENominalVoltage ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaxCurrent ; }; /* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ @@ -1117,32 +1116,47 @@ struct v2gCertificateUpdateReqType { struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ -#define v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE 2 -struct v2gPaymentOptionListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":PaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +#define v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE 15 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,eMAIDType is 15 */ +struct v2gPaymentDetailsReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ struct { - v2gpaymentOptionType array[v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE]; - uint16_t arrayLen; - } PaymentOption; + exi_string_character_t characters[v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } eMAID ; + /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct v2gCertificateChainType ContractSignatureCertChain ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -struct v2gChargeParameterDiscoveryReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple, http://www.w3.org/2001/XMLSchema,unsignedShort */ - uint16_t MaxEntriesSAScheduleTuple ; - unsigned int MaxEntriesSAScheduleTuple_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ - v2gEnergyTransferModeType RequestedEnergyTransferMode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ - struct v2gEVChargeParameterType EVChargeParameter ; - unsigned int EVChargeParameter_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ - struct v2gAC_EVChargeParameterType AC_EVChargeParameter ; - unsigned int AC_EVChargeParameter_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ - struct v2gDC_EVChargeParameterType DC_EVChargeParameter ; - unsigned int DC_EVChargeParameter_isUsed:1; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +struct v2gPMaxScheduleEntryType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct v2gIntervalType TimeInterval ; + unsigned int TimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct v2gRelativeTimeIntervalType RelativeTimeInterval ; + unsigned int RelativeTimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":PMax, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType PMax ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ +struct v2gCertificateUpdateResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct v2gCertificateChainType SAProvisioningCertificateChain ; + /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct v2gCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey ; + /* element: "urn:iso:15118:2:2013:MsgBody":DHpublickey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gDiffieHellmanPublickeyType DHpublickey ; + /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gEMAIDType eMAID ; + /* element: "urn:iso:15118:2:2013:MsgBody":RetryCounter, http://www.w3.org/2001/XMLSchema,short */ + int16_t RetryCounter ; + unsigned int RetryCounter_isUsed:1; }; /* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ @@ -1161,6 +1175,28 @@ struct v2gCertificateInstallationResType { struct v2gEMAIDType eMAID ; }; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct v2gCableCheckReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gServiceParameterListType_ParameterSet_ARRAY_SIZE 5 +struct v2gServiceParameterListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSet, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct { + struct v2gParameterSetType array[v2gServiceParameterListType_ParameterSet_ARRAY_SIZE]; + uint16_t arrayLen; + } ParameterSet; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct v2gWeldingDetectionReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ struct v2gCurrentDemandReqType { /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ @@ -1191,15 +1227,112 @@ struct v2gCurrentDemandReqType { struct v2gPhysicalValueType EVTargetVoltage ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -#define v2gServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ -#define v2gServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ -struct v2gServiceType { +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +#define v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ +struct v2gChargingStatusResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ + struct { + exi_string_character_t characters[v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } EVSEID ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaxCurrent ; + unsigned int EVSEMaxCurrent_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct v2gMeterInfoType MeterInfo ; + unsigned int MeterInfo_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":ReceiptRequired, http://www.w3.org/2001/XMLSchema,boolean */ + int ReceiptRequired ; + unsigned int ReceiptRequired_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +#define v2gReferenceType_Id_CHARACTERS_SIZE 50 +#define v2gReferenceType_URI_CHARACTERS_SIZE 50 +#define v2gReferenceType_Type_CHARACTERS_SIZE 50 +#define v2gReferenceType_DigestValue_BYTES_SIZE 350 +struct v2gReferenceType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gReferenceType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gReferenceType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gReferenceType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gTransformsType Transforms ; + unsigned int Transforms_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gDigestMethodType DigestMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestValue, http://www.w3.org/2000/09/xmldsig#,DigestValueType */ + struct { + uint8_t bytes[v2gReferenceType_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +struct v2gCostType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":costKind, urn:iso:15118:2:2013:MsgDataTypes,costKindType */ + v2gcostKindType costKind ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":amount, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t amount ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ + int8_t amountMultiplier ; + unsigned int amountMultiplier_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct v2gAuthorizationResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ + v2gEVSEProcessingType EVSEProcessing ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +struct v2gEntryType { + /* substitutionGroup */ +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + union { +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct v2gIntervalType TimeInterval ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct v2gRelativeTimeIntervalType RelativeTimeInterval ; +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + }; +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + unsigned int TimeInterval_isUsed:1; + unsigned int RelativeTimeInterval_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ +#define v2gChargeServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ +#define v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ +struct v2gChargeServiceType { /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ uint16_t ServiceID ; /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceName, urn:iso:15118:2:2013:MsgDataTypes,serviceNameType */ struct { - exi_string_character_t characters[v2gServiceType_ServiceName_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gChargeServiceType_ServiceName_CHARACTERS_SIZE]; uint16_t charactersLen; } ServiceName ; unsigned int ServiceName_isUsed:1; @@ -1207,44 +1340,46 @@ struct v2gServiceType { v2gserviceCategoryType ServiceCategory ; /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ struct { - exi_string_character_t characters[v2gServiceType_ServiceScope_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE]; uint16_t charactersLen; } ServiceScope ; unsigned int ServiceScope_isUsed:1; /* element: "urn:iso:15118:2:2013:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ int FreeService ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ + struct v2gSupportedEnergyTransferModeType SupportedEnergyTransferMode ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ -#define v2gConsumptionCostType_Cost_ARRAY_SIZE 3 -struct v2gConsumptionCostType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":startValue, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType startValue ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Cost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +struct v2gServiceDetailResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceParameterList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gServiceParameterListType ServiceParameterList ; + unsigned int ServiceParameterList_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +#define v2gRetrievalMethodType_URI_CHARACTERS_SIZE 50 +#define v2gRetrievalMethodType_Type_CHARACTERS_SIZE 50 +struct v2gRetrievalMethodType { + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { - struct v2gCostType array[v2gConsumptionCostType_Cost_ARRAY_SIZE]; - uint16_t arrayLen; - } Cost; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -struct v2gPreChargeReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVTargetVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVTargetVoltage ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVTargetCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVTargetCurrent ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ -#define v2gServiceListType_Service_ARRAY_SIZE 5 -struct v2gServiceListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Service, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ + exi_string_character_t characters[v2gRetrievalMethodType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { - struct v2gServiceType array[v2gServiceListType_Service_ARRAY_SIZE]; - uint16_t arrayLen; - } Service; + exi_string_character_t characters[v2gRetrievalMethodType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gTransformsType Transforms ; + unsigned int Transforms_isUsed:1; }; /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ @@ -1260,6 +1395,77 @@ struct v2gDC_EVSEStatusType { v2gDC_EVSEStatusCodeType EVSEStatusCode ; }; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct v2gCableCheckResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ + v2gEVSEProcessingType EVSEProcessing ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE 5 +struct v2gPMaxScheduleType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ + struct { + struct v2gPMaxScheduleEntryType array[v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } PMaxScheduleEntry; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +struct v2gPowerDeliveryResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ + struct v2gEVSEStatusType EVSEStatus ; + unsigned int EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; + unsigned int AC_EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + unsigned int DC_EVSEStatus_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignedInfoType_Id_CHARACTERS_SIZE 50 +#define v2gSignedInfoType_Reference_ARRAY_SIZE 1 +struct v2gSignedInfoType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSignedInfoType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gCanonicalizationMethodType CanonicalizationMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSignatureMethodType SignatureMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct v2gReferenceType array[v2gSignedInfoType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +struct v2gMeteringReceiptResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ + struct v2gEVSEStatusType EVSEStatus ; + unsigned int EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; + unsigned int AC_EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + unsigned int DC_EVSEStatus_isUsed:1; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ #define v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ struct v2gCurrentDemandResType { @@ -1301,139 +1507,6 @@ struct v2gCurrentDemandResType { unsigned int ReceiptRequired_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -struct v2gPowerDeliveryResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ - struct v2gEVSEStatusType EVSEStatus ; - unsigned int EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; - unsigned int AC_EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - unsigned int DC_EVSEStatus_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gChargingProfileType_ProfileEntry_ARRAY_SIZE 5 -struct v2gChargingProfileType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ - struct { - struct v2gProfileEntryType array[v2gChargingProfileType_ProfileEntry_ARRAY_SIZE]; - uint16_t arrayLen; - } ProfileEntry; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -struct v2gEntryType { - /* substitutionGroup */ -#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES - union { -#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ - /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct v2gIntervalType TimeInterval ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ - struct v2gRelativeTimeIntervalType RelativeTimeInterval ; -#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES - }; -#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ - unsigned int TimeInterval_isUsed:1; - unsigned int RelativeTimeInterval_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -struct v2gCableCheckResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ - v2gEVSEProcessingType EVSEProcessing ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gParameterSetType_Parameter_ARRAY_SIZE 5 -struct v2gParameterSetType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ - int16_t ParameterSetID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Parameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ - struct { - struct v2gParameterType array[v2gParameterSetType_Parameter_ARRAY_SIZE]; - uint16_t arrayLen; - } Parameter; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -#define v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE 15 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,eMAIDType is 15 */ -struct v2gPaymentDetailsReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ - struct { - exi_string_character_t characters[v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } eMAID ; - /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct v2gCertificateChainType ContractSignatureCertChain ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -struct v2gPaymentServiceSelectionReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ - v2gpaymentOptionType SelectedPaymentOption ; - /* element: "urn:iso:15118:2:2013:MsgBody":SelectedServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSelectedServiceListType SelectedServiceList ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ -struct v2gCertificateUpdateResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct v2gCertificateChainType SAProvisioningCertificateChain ; - /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct v2gCertificateChainType ContractSignatureCertChain ; - /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey ; - /* element: "urn:iso:15118:2:2013:MsgBody":DHpublickey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gDiffieHellmanPublickeyType DHpublickey ; - /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gEMAIDType eMAID ; - /* element: "urn:iso:15118:2:2013:MsgBody":RetryCounter, http://www.w3.org/2001/XMLSchema,short */ - int16_t RetryCounter ; - unsigned int RetryCounter_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gServiceParameterListType_ParameterSet_ARRAY_SIZE 5 -struct v2gServiceParameterListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSet, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct { - struct v2gParameterSetType array[v2gServiceParameterListType_ParameterSet_ARRAY_SIZE]; - uint16_t arrayLen; - } ParameterSet; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gTransformsType_Transform_ARRAY_SIZE 1 -struct v2gTransformsType { - /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct v2gTransformType array[v2gTransformsType_Transform_ARRAY_SIZE]; - uint16_t arrayLen; - } Transform; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -struct v2gWeldingDetectionResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEPresentVoltage ; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ struct v2gPreChargeResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ @@ -1444,90 +1517,6 @@ struct v2gPreChargeResType { struct v2gPhysicalValueType EVSEPresentVoltage ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ -#define v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE 3 -struct v2gSalesTariffEntryType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct v2gIntervalType TimeInterval ; - unsigned int TimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ - struct v2gRelativeTimeIntervalType RelativeTimeInterval ; - unsigned int RelativeTimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel, http://www.w3.org/2001/XMLSchema,unsignedByte */ - uint8_t EPriceLevel ; - unsigned int EPriceLevel_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ - struct { - struct v2gConsumptionCostType array[v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE]; - uint16_t arrayLen; - } ConsumptionCost; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSalesTariffType_Id_CHARACTERS_SIZE 50 -#define v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,tariffDescriptionType is 32 */ -#define v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE 5 -struct v2gSalesTariffType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gSalesTariffType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SalesTariffID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription, urn:iso:15118:2:2013:MsgDataTypes,tariffDescriptionType */ - struct { - exi_string_character_t characters[v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE]; - uint16_t charactersLen; - } SalesTariffDescription ; - unsigned int SalesTariffDescription_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels, http://www.w3.org/2001/XMLSchema,unsignedByte */ - uint8_t NumEPriceLevels ; - unsigned int NumEPriceLevels_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ - struct { - struct v2gSalesTariffEntryType array[v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE]; - uint16_t arrayLen; - } SalesTariffEntry; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -#define v2gReferenceType_Id_CHARACTERS_SIZE 50 -#define v2gReferenceType_URI_CHARACTERS_SIZE 50 -#define v2gReferenceType_Type_CHARACTERS_SIZE 50 -#define v2gReferenceType_DigestValue_BYTES_SIZE 350 -struct v2gReferenceType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gReferenceType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gReferenceType_URI_CHARACTERS_SIZE]; - uint16_t charactersLen; - } URI ; - unsigned int URI_isUsed:1; - /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gReferenceType_Type_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Type ; - unsigned int Type_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gTransformsType Transforms ; - unsigned int Transforms_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":DigestMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gDigestMethodType DigestMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":DigestValue, http://www.w3.org/2000/09/xmldsig#,DigestValueType */ - struct { - uint8_t bytes[v2gReferenceType_DigestValue_BYTES_SIZE]; - uint16_t bytesLen; - } DigestValue ; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ #define v2gManifestType_Id_CHARACTERS_SIZE 50 #define v2gManifestType_Reference_ARRAY_SIZE 1 @@ -1545,147 +1534,36 @@ struct v2gManifestType { } Reference; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -struct v2gDC_EVSEChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +struct v2gWeldingDetectionResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ struct v2gDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaximumCurrentLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaximumPowerLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaximumVoltageLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMinimumCurrentLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMinimumVoltageLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSECurrentRegulationTolerance ; - unsigned int EVSECurrentRegulationTolerance_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEPeakCurrentRipple ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEEnergyToBeDelivered ; - unsigned int EVSEEnergyToBeDelivered_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEPresentVoltage ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -struct v2gServiceDetailResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceParameterList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gServiceParameterListType ServiceParameterList ; - unsigned int ServiceParameterList_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -struct v2gMeteringReceiptResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ - struct v2gEVSEStatusType EVSEStatus ; - unsigned int EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; - unsigned int AC_EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - unsigned int DC_EVSEStatus_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -struct v2gPowerDeliveryReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ChargeProgress, urn:iso:15118:2:2013:MsgDataTypes,chargeProgressType */ - v2gchargeProgressType ChargeProgress ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - /* element: "urn:iso:15118:2:2013:MsgBody":ChargingProfile, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gChargingProfileType ChargingProfile ; - unsigned int ChargingProfile_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct v2gEVPowerDeliveryParameterType EVPowerDeliveryParameter ; - unsigned int EVPowerDeliveryParameter_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ - struct v2gDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; - unsigned int DC_EVPowerDeliveryParameter_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -struct v2gServiceDiscoveryResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":PaymentOptionList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ - struct v2gPaymentOptionListType PaymentOptionList ; - /* element: "urn:iso:15118:2:2013:MsgBody":ChargeService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ - struct v2gChargeServiceType ChargeService ; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ - struct v2gServiceListType ServiceList ; - unsigned int ServiceList_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignedInfoType_Id_CHARACTERS_SIZE 50 -#define v2gSignedInfoType_Reference_ARRAY_SIZE 1 -struct v2gSignedInfoType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ +#define v2gConsumptionCostType_Cost_ARRAY_SIZE 3 +struct v2gConsumptionCostType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":startValue, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType startValue ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Cost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ struct { - exi_string_character_t characters[v2gSignedInfoType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gCanonicalizationMethodType CanonicalizationMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSignatureMethodType SignatureMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ - struct { - struct v2gReferenceType array[v2gSignedInfoType_Reference_ARRAY_SIZE]; + struct v2gCostType array[v2gConsumptionCostType_Cost_ARRAY_SIZE]; uint16_t arrayLen; - } Reference; + } Cost; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -struct v2gSAScheduleTupleType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gPMaxScheduleType PMaxSchedule ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariff, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSalesTariffType SalesTariff ; - unsigned int SalesTariff_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -#define v2gRetrievalMethodType_URI_CHARACTERS_SIZE 50 -#define v2gRetrievalMethodType_Type_CHARACTERS_SIZE 50 -struct v2gRetrievalMethodType { - /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gChargingProfileType_ProfileEntry_ARRAY_SIZE 5 +struct v2gChargingProfileType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ struct { - exi_string_character_t characters[v2gRetrievalMethodType_URI_CHARACTERS_SIZE]; - uint16_t charactersLen; - } URI ; - unsigned int URI_isUsed:1; - /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gRetrievalMethodType_Type_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Type ; - unsigned int Type_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gTransformsType Transforms ; - unsigned int Transforms_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ -#define v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE 3 -struct v2gSAScheduleListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ - struct { - struct v2gSAScheduleTupleType array[v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE]; + struct v2gProfileEntryType array[v2gChargingProfileType_ProfileEntry_ARRAY_SIZE]; uint16_t arrayLen; - } SAScheduleTuple; + } ProfileEntry; }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ @@ -1749,6 +1627,169 @@ struct v2gKeyInfoType { } MgmtData; }; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +struct v2gServiceDiscoveryResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":PaymentOptionList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ + struct v2gPaymentOptionListType PaymentOptionList ; + /* element: "urn:iso:15118:2:2013:MsgBody":ChargeService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ + struct v2gChargeServiceType ChargeService ; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ + struct v2gServiceListType ServiceList ; + unsigned int ServiceList_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +struct v2gDC_EVSEChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaximumCurrentLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaximumPowerLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaximumVoltageLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMinimumCurrentLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMinimumVoltageLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSECurrentRegulationTolerance ; + unsigned int EVSECurrentRegulationTolerance_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEPeakCurrentRipple ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEEnergyToBeDelivered ; + unsigned int EVSEEnergyToBeDelivered_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignatureType_Id_CHARACTERS_SIZE 50 +#define v2gSignatureType_Object_ARRAY_SIZE 1 +struct v2gSignatureType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSignatureType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignedInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSignedInfoType SignedInfo ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gSignatureValueType SignatureValue ; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct v2gKeyInfoType KeyInfo ; + unsigned int KeyInfo_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Object, Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct v2gObjectType array[v2gSignatureType_Object_ARRAY_SIZE]; + uint16_t arrayLen; + } Object; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ +#define v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE 3 +struct v2gSalesTariffEntryType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct v2gIntervalType TimeInterval ; + unsigned int TimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct v2gRelativeTimeIntervalType RelativeTimeInterval ; + unsigned int RelativeTimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel, http://www.w3.org/2001/XMLSchema,unsignedByte */ + uint8_t EPriceLevel ; + unsigned int EPriceLevel_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ + struct { + struct v2gConsumptionCostType array[v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE]; + uint16_t arrayLen; + } ConsumptionCost; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +struct v2gPowerDeliveryReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ChargeProgress, urn:iso:15118:2:2013:MsgDataTypes,chargeProgressType */ + v2gchargeProgressType ChargeProgress ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2013:MsgBody":ChargingProfile, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gChargingProfileType ChargingProfile ; + unsigned int ChargingProfile_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct v2gEVPowerDeliveryParameterType EVPowerDeliveryParameter ; + unsigned int EVPowerDeliveryParameter_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ + struct v2gDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; + unsigned int DC_EVPowerDeliveryParameter_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +#define v2gMessageHeaderType_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ +struct v2gMessageHeaderType { + /* element: "urn:iso:15118:2:2013:MsgHeader":SessionID, urn:iso:15118:2:2013:MsgDataTypes,sessionIDType */ + struct { + uint8_t bytes[v2gMessageHeaderType_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + /* element: "urn:iso:15118:2:2013:MsgHeader":Notification, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ + struct v2gNotificationType Notification ; + unsigned int Notification_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Signature, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSignatureType Signature ; + unsigned int Signature_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSalesTariffType_Id_CHARACTERS_SIZE 50 +#define v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,tariffDescriptionType is 32 */ +#define v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE 5 +struct v2gSalesTariffType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSalesTariffType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SalesTariffID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription, urn:iso:15118:2:2013:MsgDataTypes,tariffDescriptionType */ + struct { + exi_string_character_t characters[v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE]; + uint16_t charactersLen; + } SalesTariffDescription ; + unsigned int SalesTariffDescription_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels, http://www.w3.org/2001/XMLSchema,unsignedByte */ + uint8_t NumEPriceLevels ; + unsigned int NumEPriceLevels_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ + struct { + struct v2gSalesTariffEntryType array[v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } SalesTariffEntry; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +struct v2gSAScheduleTupleType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gPMaxScheduleType PMaxSchedule ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SalesTariff, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSalesTariffType SalesTariff ; + unsigned int SalesTariff_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ +#define v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE 3 +struct v2gSAScheduleListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct v2gSAScheduleTupleType array[v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE]; + uint16_t arrayLen; + } SAScheduleTuple; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ struct v2gChargeParameterDiscoveryResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ @@ -1888,46 +1929,6 @@ struct v2gBodyType { unsigned int WeldingDetectionRes_isUsed:1; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignatureType_Id_CHARACTERS_SIZE 50 -#define v2gSignatureType_Object_ARRAY_SIZE 1 -struct v2gSignatureType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gSignatureType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignedInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSignedInfoType SignedInfo ; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gSignatureValueType SignatureValue ; - /* element: "http://www.w3.org/2000/09/xmldsig#":KeyInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct v2gKeyInfoType KeyInfo ; - unsigned int KeyInfo_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Object, Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct v2gObjectType array[v2gSignatureType_Object_ARRAY_SIZE]; - uint16_t arrayLen; - } Object; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -#define v2gMessageHeaderType_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ -struct v2gMessageHeaderType { - /* element: "urn:iso:15118:2:2013:MsgHeader":SessionID, urn:iso:15118:2:2013:MsgDataTypes,sessionIDType */ - struct { - uint8_t bytes[v2gMessageHeaderType_SessionID_BYTES_SIZE]; - uint16_t bytesLen; - } SessionID ; - /* element: "urn:iso:15118:2:2013:MsgHeader":Notification, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ - struct v2gNotificationType Notification ; - unsigned int Notification_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Signature, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSignatureType Signature ; - unsigned int Signature_isUsed:1; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDef":Header,"urn:iso:15118:2:2013:MsgDef":Body)', derivedBy='RESTRICTION'. */ struct v2gAnonType_V2G_Message { /* element: "urn:iso:15118:2:2013:MsgDef":Header, Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ @@ -1941,9 +1942,44 @@ struct v2gAnonType_V2G_Message { #define EXIDocument_MgmtData_CHARACTERS_SIZE 50 #define EXIDocument_KeyName_CHARACTERS_SIZE 50 #define EXIDocument_DigestValue_BYTES_SIZE 350 +#define EXIFragment_Exponent_BYTES_SIZE 350 +#define EXIFragment_J_BYTES_SIZE 350 +#define EXIFragment_X509CRL_BYTES_SIZE 350 +#define EXIFragment_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ +#define EXIFragment_OEMProvisioningCert_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ +#define EXIFragment_MeterID_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,meterIDType is 32 */ +#define EXIFragment_FaultMsg_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,faultMsgType is 64 */ +#define EXIFragment_eMAID_CHARACTERS_SIZE 15 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,eMAIDType is 15 */ +#define EXIFragment_PGPKeyPacket_BYTES_SIZE 350 +#define EXIFragment_PgenCounter_BYTES_SIZE 350 +#define EXIFragment_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ +#define EXIFragment_stringValue_CHARACTERS_SIZE 50 +#define EXIFragment_Y_BYTES_SIZE 350 +#define EXIFragment_Seed_BYTES_SIZE 350 +#define EXIFragment_SalesTariffDescription_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,tariffDescriptionType is 32 */ +#define EXIFragment_Modulus_BYTES_SIZE 350 +#define EXIFragment_Certificate_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ +#define EXIFragment_X509IssuerName_CHARACTERS_SIZE 50 +#define EXIFragment_X509SubjectName_CHARACTERS_SIZE 50 +#define EXIFragment_MgmtData_CHARACTERS_SIZE 50 +#define EXIFragment_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ +#define EXIFragment_PGPKeyID_BYTES_SIZE 350 +#define EXIFragment_X509SKI_BYTES_SIZE 350 +#define EXIFragment_P_BYTES_SIZE 350 +#define EXIFragment_GenChallenge_BYTES_SIZE 16 /* XML schema facet length for urn:iso:15118:2:2013:MsgDataTypes,genChallengeType is 16 */ +#define EXIFragment_X509Certificate_BYTES_SIZE 350 +#define EXIFragment_SPKISexp_BYTES_SIZE 350 +#define EXIFragment_SigMeterReading_BYTES_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sigMeterReadingType is 64 */ +#define EXIFragment_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ +#define EXIFragment_G_BYTES_SIZE 350 +#define EXIFragment_KeyName_CHARACTERS_SIZE 50 +#define EXIFragment_DigestValue_BYTES_SIZE 350 +#define EXIFragment_EVCCID_BYTES_SIZE 6 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evccIDType is 6 */ +#define EXIFragment_XPath_CHARACTERS_SIZE 50 +#define EXIFragment_Q_BYTES_SIZE 350 -/* Possible root elements of EXI Document */ +/* Global elements of EXI Document */ struct v2gEXIDocument { #if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES union { @@ -2125,115 +2161,689 @@ struct v2gEXIDocument { int _warning_; }; +/* Possible elements of EXI Fragment */ +struct v2gEXIFragment { +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + union { +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + struct v2gRSAKeyValueType RSAKeyValue ; + struct v2gServiceDetailReqType ServiceDetailReq ; + struct v2gPhysicalValueType EVSEEnergyToBeDelivered ; + struct v2gCableCheckResType CableCheckRes ; + struct v2gPhysicalValueType EVMaxVoltage ; + struct v2gPhysicalValueType RemainingTimeToBulkSoC ; + struct v2gNotificationType Notification ; + struct v2gParameterType Parameter ; + int8_t amountMultiplier ; + struct v2gPhysicalValueType EVSEMaximumVoltageLimit ; + struct v2gChargeParameterDiscoveryResType ChargeParameterDiscoveryRes ; + v2gfaultCodeType FaultCode ; + struct v2gChargingProfileType ChargingProfile ; + v2gDC_EVSEStatusCodeType EVSEStatusCode ; + struct { + uint8_t bytes[EXIFragment_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; + struct v2gServiceDetailResType ServiceDetailRes ; + struct v2gPreChargeReqType PreChargeReq ; + struct v2gPhysicalValueType EVSEMaximumPowerLimit ; + uint16_t ServiceID ; + int8_t ChargingProfileEntryMaxNumberOfPhasesInUse ; + struct { + uint8_t bytes[EXIFragment_J_BYTES_SIZE]; + uint16_t bytesLen; + } J ; + struct v2gRelativeTimeIntervalType RelativeTimeInterval ; + struct v2gCertificateUpdateReqType CertificateUpdateReq ; + struct v2gTransformsType Transforms ; + struct { + uint8_t bytes[EXIFragment_X509CRL_BYTES_SIZE]; + uint16_t bytesLen; + } X509CRL ; + struct v2gManifestType Manifest ; + int BulkChargingComplete ; + int ChargingComplete ; + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + v2gEVSENotificationType EVSENotification ; + int EVSEPowerLimitAchieved ; + struct { + exi_string_character_t characters[EXIFragment_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + int64_t EVSETimeStamp ; + struct { + uint8_t bytes[EXIFragment_OEMProvisioningCert_BYTES_SIZE]; + uint16_t bytesLen; + } OEMProvisioningCert ; + struct { + exi_string_character_t characters[EXIFragment_MeterID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MeterID ; + uint8_t SalesTariffID ; + int64_t TMeter ; + int8_t byteValue ; + struct v2gDigestMethodType DigestMethod ; + struct { + exi_string_character_t characters[EXIFragment_FaultMsg_CHARACTERS_SIZE]; + uint16_t charactersLen; + } FaultMsg ; + int8_t FullSOC ; + struct v2gWeldingDetectionReqType WeldingDetectionReq ; + struct v2gSAScheduleListType SAScheduleList ; + struct { + exi_string_character_t characters[EXIFragment_eMAID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } eMAID ; + struct v2gServiceDiscoveryReqType ServiceDiscoveryReq ; + struct v2gPhysicalValueType EVMaxCurrent ; + struct v2gX509IssuerSerialType X509IssuerSerial ; + struct v2gBodyBaseType BodyElement ; + struct v2gEVSEChargeParameterType EVSEChargeParameter ; + uint8_t SAScheduleTupleID ; + struct v2gPhysicalValueType EVSEPresentCurrent ; + v2gserviceCategoryType ServiceCategory ; + struct v2gEVPowerDeliveryParameterType EVPowerDeliveryParameter ; + struct { + uint8_t bytes[EXIFragment_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + v2gpaymentOptionType PaymentOption ; + struct v2gCertificateInstallationResType CertificateInstallationRes ; + struct { + uint8_t bytes[EXIFragment_PgenCounter_BYTES_SIZE]; + uint16_t bytesLen; + } PgenCounter ; + struct v2gPhysicalValueType EVMaximumPowerLimit ; + int64_t X509SerialNumber ; + struct v2gBodyType Body ; + struct v2gPhysicalValueType EVTargetVoltage ; + uint8_t EPriceLevel ; + int FreeService ; + struct v2gReferenceType Reference ; + struct v2gCurrentDemandReqType CurrentDemandReq ; + struct v2gSignedInfoType SignedInfo ; + struct v2gIntervalType TimeInterval ; + struct v2gChargeServiceType ChargeService ; + struct v2gServiceType Service ; + int boolValue ; + struct v2gMeteringReceiptReqType MeteringReceiptReq ; + struct { + exi_string_character_t characters[EXIFragment_EVSEID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } EVSEID ; + struct v2gMeterInfoType MeterInfo ; + struct v2gKeyValueType KeyValue ; + struct { + exi_string_character_t characters[EXIFragment_stringValue_CHARACTERS_SIZE]; + uint16_t charactersLen; + } stringValue ; + struct v2gPhysicalValueType EVSEMaxCurrent ; + struct v2gContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey ; + struct v2gPhysicalValueType PMax ; + struct v2gPhysicalValueType RemainingTimeToFullSoC ; + struct v2gEVSEStatusType EVSEStatus ; + v2gunitSymbolType Unit ; + struct { + uint8_t bytes[EXIFragment_Y_BYTES_SIZE]; + uint16_t bytesLen; + } Y ; + v2gEnergyTransferModeType RequestedEnergyTransferMode ; + struct v2gPhysicalValueType EVSEPeakCurrentRipple ; + struct v2gPhysicalValueType EAmount ; + struct v2gPhysicalValueType EVSEPresentVoltage ; + v2gresponseCodeType ResponseCode ; + struct v2gAC_EVSEChargeParameterType AC_EVSEChargeParameter ; + struct v2gSignatureMethodType SignatureMethod ; + struct v2gAC_EVSEStatusType AC_EVSEStatus ; + int ReceiptRequired ; + uint32_t ChargingProfileEntryStart ; + struct v2gCurrentDemandResType CurrentDemandRes ; + struct v2gConsumptionCostType ConsumptionCost ; + struct v2gServiceParameterListType ServiceParameterList ; + struct v2gPhysicalValueType EVSEMaximumCurrentLimit ; + struct v2gX509DataType X509Data ; + struct { + uint8_t bytes[EXIFragment_Seed_BYTES_SIZE]; + uint16_t bytesLen; + } Seed ; + struct { + exi_string_character_t characters[EXIFragment_SalesTariffDescription_CHARACTERS_SIZE]; + uint16_t charactersLen; + } SalesTariffDescription ; + struct { + uint8_t bytes[EXIFragment_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + struct v2gPhysicalValueType EVMaximumVoltageLimit ; + struct { + uint8_t bytes[EXIFragment_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } Certificate ; + struct v2gCableCheckReqType CableCheckReq ; + struct v2gDC_EVStatusType DC_EVStatus ; + int8_t Multiplier ; + struct v2gKeyInfoType KeyInfo ; + struct v2gPhysicalValueType EVTargetCurrent ; + struct v2gPowerDeliveryReqType PowerDeliveryReq ; + struct { + exi_string_character_t characters[EXIFragment_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + struct v2gSessionStopReqType SessionStopReq ; + struct { + exi_string_character_t characters[EXIFragment_X509SubjectName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509SubjectName ; + struct v2gPMaxScheduleEntryType PMaxScheduleEntry ; + v2gchargeProgressType ChargeProgress ; + v2gpaymentOptionType SelectedPaymentOption ; + struct { + exi_string_character_t characters[EXIFragment_MgmtData_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MgmtData ; + struct v2gAC_EVChargeParameterType AC_EVChargeParameter ; + struct v2gPhysicalValueType EVSEMinimumCurrentLimit ; + struct v2gWeldingDetectionResType WeldingDetectionRes ; + struct v2gPhysicalValueType physicalValue ; + struct { + exi_string_character_t characters[EXIFragment_ServiceName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceName ; + uint8_t NumEPriceLevels ; + v2gEVSEProcessingType EVSEProcessing ; + struct { + uint8_t bytes[EXIFragment_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + struct v2gPhysicalValueType startValue ; + struct v2gMeteringReceiptResType MeteringReceiptRes ; + struct v2gPhysicalValueType EVEnergyRequest ; + uint16_t MaxEntriesSAScheduleTuple ; + int EVReady ; + struct { + uint8_t bytes[EXIFragment_X509SKI_BYTES_SIZE]; + uint16_t bytesLen; + } X509SKI ; + struct v2gSignaturePropertiesType SignatureProperties ; + struct { + uint8_t bytes[EXIFragment_P_BYTES_SIZE]; + uint16_t bytesLen; + } P ; + struct v2gSignatureValueType SignatureValue ; + int16_t MeterStatus ; + struct v2gDC_EVSEChargeParameterType DC_EVSEChargeParameter ; + struct v2gSalesTariffType SalesTariff ; + struct v2gSessionSetupReqType SessionSetupReq ; + struct v2gPhysicalValueType EVMinCurrent ; + int16_t RetryCounter ; + struct v2gPGPDataType PGPData ; + struct v2gSessionStopResType SessionStopRes ; + struct v2gAuthorizationReqType AuthorizationReq ; + struct v2gServiceDiscoveryResType ServiceDiscoveryRes ; + struct { + uint8_t bytes[EXIFragment_GenChallenge_BYTES_SIZE]; + uint16_t bytesLen; + } GenChallenge ; + struct v2gSAScheduleTupleType SAScheduleTuple ; + struct v2gPaymentServiceSelectionResType PaymentServiceSelectionRes ; + struct v2gDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; + int8_t EVRESSSOC ; + struct v2gChargingStatusResType ChargingStatusRes ; + struct v2gCertificateChainType ContractSignatureCertChain ; + struct { + uint8_t bytes[EXIFragment_X509Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } X509Certificate ; + struct v2gPhysicalValueType EVMaximumCurrentLimit ; + struct { + uint8_t bytes[EXIFragment_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } SPKISexp ; + struct v2gCanonicalizationMethodType CanonicalizationMethod ; + uint32_t duration ; + struct v2gParameterSetType ParameterSet ; + struct v2gChargeParameterDiscoveryReqType ChargeParameterDiscoveryReq ; + struct { + uint8_t bytes[EXIFragment_SigMeterReading_BYTES_SIZE]; + uint16_t bytesLen; + } SigMeterReading ; + struct v2gSASchedulesType SASchedules ; + struct v2gSessionSetupResType SessionSetupRes ; + struct v2gSupportedEnergyTransferModeType SupportedEnergyTransferMode ; + struct v2gSPKIDataType SPKIData ; + struct v2gObjectType Object ; + struct v2gDSAKeyValueType DSAKeyValue ; + struct v2gSignatureType Signature ; + struct v2gTransformType Transform ; + struct v2gChargingStatusReqType ChargingStatusReq ; + uint32_t amount ; + struct v2gSelectedServiceListType SelectedServiceList ; + struct { + uint8_t bytes[EXIFragment_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + struct { + uint8_t bytes[EXIFragment_G_BYTES_SIZE]; + uint16_t bytesLen; + } G ; + uint32_t start ; + struct v2gPaymentOptionListType PaymentOptionList ; + struct v2gCostType Cost ; + struct v2gMessageHeaderType Header ; + struct v2gPMaxScheduleType PMaxSchedule ; + struct v2gPhysicalValueType EVSEMinimumVoltageLimit ; + struct v2gProfileEntryType ProfileEntry ; + struct v2gPhysicalValueType EVSENominalVoltage ; + struct v2gEVStatusType EVStatus ; + struct v2gSelectedServiceType SelectedService ; + v2gEnergyTransferModeType EnergyTransferMode ; + int EVSECurrentLimitAchieved ; + int16_t Value ; + struct { + exi_string_character_t characters[EXIFragment_KeyName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } KeyName ; + struct v2gPaymentServiceSelectionReqType PaymentServiceSelectionReq ; + int EVSEVoltageLimitAchieved ; + struct v2gPowerDeliveryResType PowerDeliveryRes ; + struct { + uint8_t bytes[EXIFragment_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; + int16_t ParameterSetID ; + struct v2gSubCertificatesType SubCertificates ; + struct v2gDiffieHellmanPublickeyType DHpublickey ; + struct v2gCertificateInstallationReqType CertificateInstallationReq ; + int16_t shortValue ; + struct v2gCertificateChainType SAProvisioningCertificateChain ; + int RCD ; + struct v2gPhysicalValueType EVEnergyCapacity ; + struct v2gRetrievalMethodType RetrievalMethod ; + struct v2gPaymentDetailsReqType PaymentDetailsReq ; + uint16_t NotificationMaxDelay ; + struct v2gEntryType Entry ; + struct v2gX509IssuerSerialType RootCertificateID ; + struct v2gAuthorizationResType AuthorizationRes ; + v2gcostKindType costKind ; + uint32_t DepartureTime ; + v2gisolationLevelType EVSEIsolationStatus ; + struct v2gDC_EVChargeParameterType DC_EVChargeParameter ; + struct v2gAnonType_V2G_Message V2G_Message ; + struct v2gPhysicalValueType EVSECurrentRegulationTolerance ; + struct { + uint8_t bytes[EXIFragment_EVCCID_BYTES_SIZE]; + uint16_t bytesLen; + } EVCCID ; + struct v2gEVChargeParameterType EVChargeParameter ; + struct v2gPhysicalValueType ChargingProfileEntryMaxPower ; + int64_t HMACOutputLength ; + int32_t intValue ; + struct v2gServiceListType ServiceList ; + struct v2gSignaturePropertyType SignatureProperty ; + int8_t BulkSOC ; + struct v2gSalesTariffEntryType SalesTariffEntry ; + v2gDC_EVErrorCodeType EVErrorCode ; + struct v2gPreChargeResType PreChargeRes ; + struct v2gCertificateUpdateResType CertificateUpdateRes ; + uint64_t MeterReading ; + struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; + v2gchargingSessionType ChargingSession ; + struct v2gPaymentDetailsResType PaymentDetailsRes ; + struct { + exi_string_character_t characters[EXIFragment_XPath_CHARACTERS_SIZE]; + uint16_t charactersLen; + } XPath ; + struct { + uint8_t bytes[EXIFragment_Q_BYTES_SIZE]; + uint16_t bytesLen; + } Q ; +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + }; +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + unsigned int RSAKeyValue_isUsed:1; + unsigned int ServiceDetailReq_isUsed:1; + unsigned int EVSEEnergyToBeDelivered_isUsed:1; + unsigned int CableCheckRes_isUsed:1; + unsigned int EVMaxVoltage_isUsed:1; + unsigned int RemainingTimeToBulkSoC_isUsed:1; + unsigned int Notification_isUsed:1; + unsigned int Parameter_isUsed:1; + unsigned int amountMultiplier_isUsed:1; + unsigned int EVSEMaximumVoltageLimit_isUsed:1; + unsigned int ChargeParameterDiscoveryRes_isUsed:1; + unsigned int FaultCode_isUsed:1; + unsigned int ChargingProfile_isUsed:1; + unsigned int EVSEStatusCode_isUsed:1; + unsigned int Exponent_isUsed:1; + unsigned int ServiceDetailRes_isUsed:1; + unsigned int PreChargeReq_isUsed:1; + unsigned int EVSEMaximumPowerLimit_isUsed:1; + unsigned int ServiceID_isUsed:1; + unsigned int ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed:1; + unsigned int J_isUsed:1; + unsigned int RelativeTimeInterval_isUsed:1; + unsigned int CertificateUpdateReq_isUsed:1; + unsigned int Transforms_isUsed:1; + unsigned int X509CRL_isUsed:1; + unsigned int Manifest_isUsed:1; + unsigned int BulkChargingComplete_isUsed:1; + unsigned int ChargingComplete_isUsed:1; + unsigned int DC_EVSEStatus_isUsed:1; + unsigned int EVSENotification_isUsed:1; + unsigned int EVSEPowerLimitAchieved_isUsed:1; + unsigned int ServiceScope_isUsed:1; + unsigned int EVSETimeStamp_isUsed:1; + unsigned int OEMProvisioningCert_isUsed:1; + unsigned int MeterID_isUsed:1; + unsigned int SalesTariffID_isUsed:1; + unsigned int TMeter_isUsed:1; + unsigned int byteValue_isUsed:1; + unsigned int DigestMethod_isUsed:1; + unsigned int FaultMsg_isUsed:1; + unsigned int FullSOC_isUsed:1; + unsigned int WeldingDetectionReq_isUsed:1; + unsigned int SAScheduleList_isUsed:1; + unsigned int eMAID_isUsed:1; + unsigned int ServiceDiscoveryReq_isUsed:1; + unsigned int EVMaxCurrent_isUsed:1; + unsigned int X509IssuerSerial_isUsed:1; + unsigned int BodyElement_isUsed:1; + unsigned int EVSEChargeParameter_isUsed:1; + unsigned int SAScheduleTupleID_isUsed:1; + unsigned int EVSEPresentCurrent_isUsed:1; + unsigned int ServiceCategory_isUsed:1; + unsigned int EVPowerDeliveryParameter_isUsed:1; + unsigned int PGPKeyPacket_isUsed:1; + unsigned int PaymentOption_isUsed:1; + unsigned int CertificateInstallationRes_isUsed:1; + unsigned int PgenCounter_isUsed:1; + unsigned int EVMaximumPowerLimit_isUsed:1; + unsigned int X509SerialNumber_isUsed:1; + unsigned int Body_isUsed:1; + unsigned int EVTargetVoltage_isUsed:1; + unsigned int EPriceLevel_isUsed:1; + unsigned int FreeService_isUsed:1; + unsigned int Reference_isUsed:1; + unsigned int CurrentDemandReq_isUsed:1; + unsigned int SignedInfo_isUsed:1; + unsigned int TimeInterval_isUsed:1; + unsigned int ChargeService_isUsed:1; + unsigned int Service_isUsed:1; + unsigned int boolValue_isUsed:1; + unsigned int MeteringReceiptReq_isUsed:1; + unsigned int EVSEID_isUsed:1; + unsigned int MeterInfo_isUsed:1; + unsigned int KeyValue_isUsed:1; + unsigned int stringValue_isUsed:1; + unsigned int EVSEMaxCurrent_isUsed:1; + unsigned int ContractSignatureEncryptedPrivateKey_isUsed:1; + unsigned int PMax_isUsed:1; + unsigned int RemainingTimeToFullSoC_isUsed:1; + unsigned int EVSEStatus_isUsed:1; + unsigned int Unit_isUsed:1; + unsigned int Y_isUsed:1; + unsigned int RequestedEnergyTransferMode_isUsed:1; + unsigned int EVSEPeakCurrentRipple_isUsed:1; + unsigned int EAmount_isUsed:1; + unsigned int EVSEPresentVoltage_isUsed:1; + unsigned int ResponseCode_isUsed:1; + unsigned int AC_EVSEChargeParameter_isUsed:1; + unsigned int SignatureMethod_isUsed:1; + unsigned int AC_EVSEStatus_isUsed:1; + unsigned int ReceiptRequired_isUsed:1; + unsigned int ChargingProfileEntryStart_isUsed:1; + unsigned int CurrentDemandRes_isUsed:1; + unsigned int ConsumptionCost_isUsed:1; + unsigned int ServiceParameterList_isUsed:1; + unsigned int EVSEMaximumCurrentLimit_isUsed:1; + unsigned int X509Data_isUsed:1; + unsigned int Seed_isUsed:1; + unsigned int SalesTariffDescription_isUsed:1; + unsigned int Modulus_isUsed:1; + unsigned int EVMaximumVoltageLimit_isUsed:1; + unsigned int Certificate_isUsed:1; + unsigned int CableCheckReq_isUsed:1; + unsigned int DC_EVStatus_isUsed:1; + unsigned int Multiplier_isUsed:1; + unsigned int KeyInfo_isUsed:1; + unsigned int EVTargetCurrent_isUsed:1; + unsigned int PowerDeliveryReq_isUsed:1; + unsigned int X509IssuerName_isUsed:1; + unsigned int SessionStopReq_isUsed:1; + unsigned int X509SubjectName_isUsed:1; + unsigned int PMaxScheduleEntry_isUsed:1; + unsigned int ChargeProgress_isUsed:1; + unsigned int SelectedPaymentOption_isUsed:1; + unsigned int MgmtData_isUsed:1; + unsigned int AC_EVChargeParameter_isUsed:1; + unsigned int EVSEMinimumCurrentLimit_isUsed:1; + unsigned int WeldingDetectionRes_isUsed:1; + unsigned int physicalValue_isUsed:1; + unsigned int ServiceName_isUsed:1; + unsigned int NumEPriceLevels_isUsed:1; + unsigned int EVSEProcessing_isUsed:1; + unsigned int PGPKeyID_isUsed:1; + unsigned int startValue_isUsed:1; + unsigned int MeteringReceiptRes_isUsed:1; + unsigned int EVEnergyRequest_isUsed:1; + unsigned int MaxEntriesSAScheduleTuple_isUsed:1; + unsigned int EVReady_isUsed:1; + unsigned int X509SKI_isUsed:1; + unsigned int SignatureProperties_isUsed:1; + unsigned int P_isUsed:1; + unsigned int SignatureValue_isUsed:1; + unsigned int MeterStatus_isUsed:1; + unsigned int DC_EVSEChargeParameter_isUsed:1; + unsigned int SalesTariff_isUsed:1; + unsigned int SessionSetupReq_isUsed:1; + unsigned int EVMinCurrent_isUsed:1; + unsigned int RetryCounter_isUsed:1; + unsigned int PGPData_isUsed:1; + unsigned int SessionStopRes_isUsed:1; + unsigned int AuthorizationReq_isUsed:1; + unsigned int ServiceDiscoveryRes_isUsed:1; + unsigned int GenChallenge_isUsed:1; + unsigned int SAScheduleTuple_isUsed:1; + unsigned int PaymentServiceSelectionRes_isUsed:1; + unsigned int DC_EVPowerDeliveryParameter_isUsed:1; + unsigned int EVRESSSOC_isUsed:1; + unsigned int ChargingStatusRes_isUsed:1; + unsigned int ContractSignatureCertChain_isUsed:1; + unsigned int X509Certificate_isUsed:1; + unsigned int EVMaximumCurrentLimit_isUsed:1; + unsigned int SPKISexp_isUsed:1; + unsigned int CanonicalizationMethod_isUsed:1; + unsigned int duration_isUsed:1; + unsigned int ParameterSet_isUsed:1; + unsigned int ChargeParameterDiscoveryReq_isUsed:1; + unsigned int SigMeterReading_isUsed:1; + unsigned int SASchedules_isUsed:1; + unsigned int SessionSetupRes_isUsed:1; + unsigned int SupportedEnergyTransferMode_isUsed:1; + unsigned int SPKIData_isUsed:1; + unsigned int Object_isUsed:1; + unsigned int DSAKeyValue_isUsed:1; + unsigned int Signature_isUsed:1; + unsigned int Transform_isUsed:1; + unsigned int ChargingStatusReq_isUsed:1; + unsigned int amount_isUsed:1; + unsigned int SelectedServiceList_isUsed:1; + unsigned int SessionID_isUsed:1; + unsigned int G_isUsed:1; + unsigned int start_isUsed:1; + unsigned int PaymentOptionList_isUsed:1; + unsigned int Cost_isUsed:1; + unsigned int Header_isUsed:1; + unsigned int PMaxSchedule_isUsed:1; + unsigned int EVSEMinimumVoltageLimit_isUsed:1; + unsigned int ProfileEntry_isUsed:1; + unsigned int EVSENominalVoltage_isUsed:1; + unsigned int EVStatus_isUsed:1; + unsigned int SelectedService_isUsed:1; + unsigned int EnergyTransferMode_isUsed:1; + unsigned int EVSECurrentLimitAchieved_isUsed:1; + unsigned int Value_isUsed:1; + unsigned int KeyName_isUsed:1; + unsigned int PaymentServiceSelectionReq_isUsed:1; + unsigned int EVSEVoltageLimitAchieved_isUsed:1; + unsigned int PowerDeliveryRes_isUsed:1; + unsigned int DigestValue_isUsed:1; + unsigned int ParameterSetID_isUsed:1; + unsigned int SubCertificates_isUsed:1; + unsigned int DHpublickey_isUsed:1; + unsigned int CertificateInstallationReq_isUsed:1; + unsigned int shortValue_isUsed:1; + unsigned int SAProvisioningCertificateChain_isUsed:1; + unsigned int RCD_isUsed:1; + unsigned int EVEnergyCapacity_isUsed:1; + unsigned int RetrievalMethod_isUsed:1; + unsigned int PaymentDetailsReq_isUsed:1; + unsigned int NotificationMaxDelay_isUsed:1; + unsigned int Entry_isUsed:1; + unsigned int RootCertificateID_isUsed:1; + unsigned int AuthorizationRes_isUsed:1; + unsigned int costKind_isUsed:1; + unsigned int DepartureTime_isUsed:1; + unsigned int EVSEIsolationStatus_isUsed:1; + unsigned int DC_EVChargeParameter_isUsed:1; + unsigned int V2G_Message_isUsed:1; + unsigned int EVSECurrentRegulationTolerance_isUsed:1; + unsigned int EVCCID_isUsed:1; + unsigned int EVChargeParameter_isUsed:1; + unsigned int ChargingProfileEntryMaxPower_isUsed:1; + unsigned int HMACOutputLength_isUsed:1; + unsigned int intValue_isUsed:1; + unsigned int ServiceList_isUsed:1; + unsigned int SignatureProperty_isUsed:1; + unsigned int BulkSOC_isUsed:1; + unsigned int SalesTariffEntry_isUsed:1; + unsigned int EVErrorCode_isUsed:1; + unsigned int PreChargeRes_isUsed:1; + unsigned int CertificateUpdateRes_isUsed:1; + unsigned int MeterReading_isUsed:1; + unsigned int ListOfRootCertificateIDs_isUsed:1; + unsigned int ChargingSession_isUsed:1; + unsigned int PaymentDetailsRes_isUsed:1; + unsigned int XPath_isUsed:1; + unsigned int Q_isUsed:1; + + + int _warning_; +}; + + /* Initialization methods for structs */ void init_v2gEXIDocument(struct v2gEXIDocument* exiDoc); -void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType); -void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType); -void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType); -void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType); -void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType); -void init_v2gManifestType(struct v2gManifestType* v2gManifestType); -void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType); -void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType); +#if DEPLOY_ISO_CODEC_FRAGMENT == SUPPORT_YES +void init_v2gEXIFragment(struct v2gEXIFragment* exiFrag); +#endif /* DEPLOY_ISO_CODEC_FRAGMENT */ void init_v2gEVSEChargeParameterType(struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType); -void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType); -void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType); -void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType); -void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); -void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType); -void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType); -void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType); -void init_v2gParameterType(struct v2gParameterType* v2gParameterType); -void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType); -void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType); -void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType); -void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType); -void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType); -void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType); -void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType); -void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); -void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType); -void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -void init_v2gServiceType(struct v2gServiceType* v2gServiceType); -void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType); -void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType); -void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType); -void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType); -void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType); -void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType); -void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType); -void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType); -void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType); -void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType); -void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType); -void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDemandResType); -void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType); -void init_v2gObjectType(struct v2gObjectType* v2gObjectType); -void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType); -void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType); -void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType); -void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType); -void init_v2gEntryType(struct v2gEntryType* v2gEntryType); -void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType); -void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType); -void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType); -void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType); -void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType); -void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType); -void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); -void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); +void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDemandResType); +void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); +void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType); +void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType); +void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType); +void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); +void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType); +void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType); +void init_v2gObjectType(struct v2gObjectType* v2gObjectType); +void init_v2gManifestType(struct v2gManifestType* v2gManifestType); +void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType); +void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); void init_v2gRelativeTimeIntervalType(struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType); -void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType); -void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType); -void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); -void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); -void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType); +void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); +void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType); +void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType); +void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); +void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType); +void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); +void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); +void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType); +void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType); +void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); +void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); void init_v2gBodyType(struct v2gBodyType* v2gBodyType); -void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType); -void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType); -void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType); -void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType); -void init_v2gCostType(struct v2gCostType* v2gCostType); +void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType); +void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); +void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType); +void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType); +void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType); void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType); void init_v2gServiceDetailReqType(struct v2gServiceDetailReqType* v2gServiceDetailReqType); -void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType); -void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType); -void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); +void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); +void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType); +void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); +void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); +void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); +void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType); -void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType); -void init_v2gTransformType(struct v2gTransformType* v2gTransformType); +void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); +void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); +void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType); +void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType); +void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType); +void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType); +void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType); +void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); +void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType); +void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); +void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType); +void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType); +void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType); +void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType); +void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType); +void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); +void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); +void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType); +void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); +void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType); +void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType); +void init_v2gCostType(struct v2gCostType* v2gCostType); +void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType); +void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType); +void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType); +void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType); +void init_v2gEntryType(struct v2gEntryType* v2gEntryType); +void init_v2gServiceType(struct v2gServiceType* v2gServiceType); +void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType); +void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType); +void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType); +void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType); +void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); +void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType); +void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType); +void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); +void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType); +void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType); +void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType); +void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); +void init_v2gTransformType(struct v2gTransformType* v2gTransformType); +void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType); +void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType); +void init_v2gParameterType(struct v2gParameterType* v2gParameterType); +void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType); +void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType); +void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType); +void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); +void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType); +void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType); +void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); +void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType); +void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType); +void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType); +void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType); +void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); +void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); +void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); +void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType); +void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); #endif /* DEPLOY_ISO_CODEC */ diff --git a/src/codec/v2gEXIDatatypesDecoder.c b/src/codec/v2gEXIDatatypesDecoder.c index 415be60..4afb52e 100644 --- a/src/codec/v2gEXIDatatypesDecoder.c +++ b/src/codec/v2gEXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -50,112 +50,112 @@ static uint32_t uint32; /* Forward Declarations */ -static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); -static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); -static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); -static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); -static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); -static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); -static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); -static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); -static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); -static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); -static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); -static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); -static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); -static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); -static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); -static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); -static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); -static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); -static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); -static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); -static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); -static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); -static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); -static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); -static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); -static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); -static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); -static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); -static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); -static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); -static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); -static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); -static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); -static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); -static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); -static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); -static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); -static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); -static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); -static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); -static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); -static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); -static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); -static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); -static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); -static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); -static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); -static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); -static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); -static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); -static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); -static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); -static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); +static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); +static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); +static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); +static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); +static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); +static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); +static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); +static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); +static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); +static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); +static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); +static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); static int decode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType); -static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); -static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); -static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); -static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); -static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); +static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); +static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); +static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); +static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); +static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); +static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); +static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); +static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); +static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); +static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); +static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); -static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); -static int decode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); -static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); -static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); -static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); +static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); +static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); +static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); +static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); +static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); -static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); -static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); -static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); +static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); +static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); +static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); +static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); +static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); +static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); -static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); -static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); +static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); +static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); +static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); +static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); +static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); +static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); +static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); +static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); +static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); +static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); +static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); +static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); +static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); +static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); +static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); +static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); +static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); +static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); +static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); +static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); +static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); +static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); +static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); +static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); +static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); +static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); +static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); +static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); +static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); +static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); +static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); +static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); +static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); +static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); +static int decode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); +static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); +static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); +static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); +static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); +static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); +static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); +static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); +static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); +static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); +static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); +static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); +static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); +static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); +static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); +static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); +static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); +static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); +static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); +static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); +static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); +static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); +static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); +static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); +static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); +static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); /* Deviant data decoding (skip functions) */ static int decodeDeviationsCH(bitstream_t* stream) { @@ -173,108 +173,23 @@ static int decodeDeviationsCH(bitstream_t* stream) { } - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { + /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { int grammarID = 0; int done = 0; - init_v2gProfileEntryType(v2gProfileEntryType); + init_v2gEVSEChargeParameterType(v2gEVSEChargeParameterType); while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gProfileEntryType->ChargingProfileEntryStart); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 1; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower); - grammarID = 2; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &(uint32)); - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse = (int8_t)(uint32 + 1); - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -293,55 +208,22 @@ static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntr return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { - int grammarID = 5; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { + int grammarID = 2; int done = 0; - init_v2gContractSignatureEncryptedPrivateKeyType(v2gContractSignatureEncryptedPrivateKeyType); + init_v2gDC_EVPowerDeliveryParameterType(v2gDC_EVPowerDeliveryParameterType); while(!done) { switch(grammarID) { - case 5: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + case 2: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); - if (errn == 0) { - errn = (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2) <= v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen >= 2) { - v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen = (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen, v2gContractSignatureEncryptedPrivateKeyType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 6; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 6: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen) <= v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes); - } + errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus); grammarID = 3; break; default: @@ -351,13 +233,99 @@ static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea } break; case 3: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); + v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 4; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 4: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -376,80 +344,56 @@ static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { - int grammarID = 7; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType) { + int grammarID = 6; int done = 0; - init_v2gServiceDiscoveryReqType(v2gServiceDiscoveryReqType); + init_v2gCurrentDemandResType(v2gCurrentDemandResType); while(!done) { switch(grammarID) { - case 7: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 6: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceDiscoveryReqType->ServiceScope.charactersLen); - if (errn == 0) { - errn = (v2gServiceDiscoveryReqType->ServiceScope.charactersLen - 2) <= v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gServiceDiscoveryReqType->ServiceScope.charactersLen >= 2) { - v2gServiceDiscoveryReqType->ServiceScope.charactersLen = (uint16_t)(v2gServiceDiscoveryReqType->ServiceScope.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gServiceDiscoveryReqType->ServiceScope.charactersLen, v2gServiceDiscoveryReqType->ServiceScope.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gServiceDiscoveryReqType->ServiceScope_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 8; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gServiceDiscoveryReqType->ServiceCategory = (v2gserviceCategoryType) uint32; - v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 1u; + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gCurrentDemandResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 7; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; - case 2: - done = 1; - grammarID = 4; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 7: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gCurrentDemandResType->DC_EVSEStatus); + grammarID = 8; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -458,36 +402,13 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ } break; case 8: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gServiceDiscoveryReqType->ServiceCategory = (v2gserviceCategoryType) uint32; - v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentVoltage); + grammarID = 9; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -495,14 +416,443 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ } } break; - case 3: + case 9: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentCurrent); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSECurrentLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 11; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEVoltageLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 12; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 12: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEPowerLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 13; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 13: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumVoltageLimit); + v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; + grammarID = 14; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); + v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 15; + break; + case 2: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); + v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 16; + break; + case 3: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 17; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 14: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); + v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 15; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); + v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 16; + break; + case 2: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 17; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 15: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); + v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 16; + break; + case 1: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 17; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 16: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 17; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 17: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gCurrentDemandResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 18; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 18: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo); + v2gCurrentDemandResType->MeterInfo_isUsed = 1u; + grammarID = 19; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); + v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); + v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -521,40 +871,288 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { - int grammarID = 9; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ +static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { + int grammarID = 20; int done = 0; - init_v2gSignatureType(v2gSignatureType); + init_v2gAC_EVSEStatusType(v2gAC_EVSEStatusType); while(!done) { switch(grammarID) { - case 9: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + case 20: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gAC_EVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 21; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 21: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gAC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 22; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 22: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gAC_EVSEStatusType->RCD); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { + int grammarID = 23; + int done = 0; + + init_v2gPreChargeResType(v2gPreChargeResType); + + while(!done) { + switch(grammarID) { + case 23: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gPreChargeResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 24; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 24: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus); + grammarID = 25; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { + int grammarID = 26; + int done = 0; + + init_v2gSalesTariffType(v2gSalesTariffType); + + while(!done) { + switch(grammarID) { + case 26: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignatureType->Id.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->Id.charactersLen); if (errn == 0) { - errn = (v2gSignatureType->Id.charactersLen - 2) <= v2gSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gSalesTariffType->Id.charactersLen - 2) <= v2gSalesTariffType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gSignatureType->Id.charactersLen >= 2) { - v2gSignatureType->Id.charactersLen = (uint16_t)(v2gSignatureType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignatureType->Id.charactersLen, v2gSignatureType->Id.characters); + if (v2gSalesTariffType->Id.charactersLen >= 2) { + v2gSalesTariffType->Id.charactersLen = (uint16_t)(v2gSalesTariffType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSalesTariffType->Id.charactersLen, v2gSalesTariffType->Id.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - v2gSignatureType->Id_isUsed = 1u; - grammarID = 10; + v2gSalesTariffType->Id_isUsed = 1u; + grammarID = 27; break; case 1: - errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); - grammarID = 11; + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 28; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -562,14 +1160,32 @@ static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* } } break; - case 10: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + case 27: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); - grammarID = 11; + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 28; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -577,42 +1193,510 @@ static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* } } break; - case 11: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue); - grammarID = 12; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 12: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + case 28: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo); - v2gSignatureType->KeyInfo_isUsed = 1u; - grammarID = 13; + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->SalesTariffDescription.charactersLen); + if (errn == 0) { + errn = (v2gSalesTariffType->SalesTariffDescription.charactersLen - 2) <= v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSalesTariffType->SalesTariffDescription.charactersLen >= 2) { + v2gSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.charactersLen, v2gSalesTariffType->SalesTariffDescription.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSalesTariffType->SalesTariffDescription_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 29; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 1: - if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { - errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 30; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 13; + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 29: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 30; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 30: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 31: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 31; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { + int grammarID = 32; + int done = 0; + + init_v2gSignaturePropertyType(v2gSignaturePropertyType); + + while(!done) { + switch(grammarID) { + case 32: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertyType->Id.charactersLen - 2) <= v2gSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertyType->Id.charactersLen >= 2) { + v2gSignaturePropertyType->Id.charactersLen = (uint16_t)(v2gSignaturePropertyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertyType->Id.charactersLen, v2gSignaturePropertyType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignaturePropertyType->Id_isUsed = 1u; + grammarID = 33; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertyType->Target.charactersLen >= 2) { + v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 34; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 33: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertyType->Target.charactersLen >= 2) { + v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 34; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 34: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 1: + errn = decodeDeviationsCH(stream); + grammarID = 36; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 1: + done = 1; + grammarID = 1; + break; + case 2: + grammarID = 35; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 36: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 1: + grammarID = 36; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { + int grammarID = 37; + int done = 0; + + init_v2gPaymentServiceSelectionReqType(v2gPaymentServiceSelectionReqType); + + while(!done) { + switch(grammarID) { + case 37: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gPaymentServiceSelectionReqType->SelectedPaymentOption = (v2gpaymentOptionType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 38; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 38: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { + int grammarID = 39; + int done = 0; + + init_v2gSPKIDataType(v2gSPKIDataType); + + while(!done) { + switch(grammarID) { + case 39: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); + } + v2gSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 40; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 40: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); + } + v2gSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 40; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 41; break; case 2: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -620,22 +1704,46 @@ static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* } } break; - case 13: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + case 41: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { - errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); + if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); + } + v2gSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 13; + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 40; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -656,14 +1764,14 @@ static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType) { - int grammarID = 14; + int grammarID = 42; int done = 0; init_v2gNotificationType(v2gNotificationType); while(!done) { switch(grammarID) { - case 14: + case 42: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -684,7 +1792,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 15; + grammarID = 43; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -696,7 +1804,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio } } break; - case 15: + case 43: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -729,7 +1837,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -737,7 +1845,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -745,14 +1853,14 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -771,243 +1879,82 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ -static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { - int grammarID = 16; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { + int grammarID = 44; int done = 0; - init_v2gAC_EVSEChargeParameterType(v2gAC_EVSEChargeParameterType); + init_v2gObjectType(v2gObjectType); while(!done) { switch(grammarID) { - case 16: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 44: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus); - grammarID = 17; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 17: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage); - grammarID = 18; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 18: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { - int grammarID = 19; - int done = 0; - - init_v2gX509IssuerSerialType(v2gX509IssuerSerialType); - - while(!done) { - switch(grammarID) { - case 19: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509IssuerSerialType->X509IssuerName.charactersLen); - if (errn == 0) { - errn = (v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gX509IssuerSerialType->X509IssuerName.charactersLen >= 2) { - v2gX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.charactersLen, v2gX509IssuerSerialType->X509IssuerName.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 20; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 20: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gX509IssuerSerialType->X509SerialNumber); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - int grammarID = 21; - int done = 0; - - init_v2gSignaturePropertyType(v2gSignaturePropertyType); - - while(!done) { - switch(grammarID) { - case 21: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Id.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gObjectType->Encoding.charactersLen); if (errn == 0) { - errn = (v2gSignaturePropertyType->Id.charactersLen - 2) <= v2gSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gObjectType->Encoding.charactersLen - 2) <= v2gObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gSignaturePropertyType->Id.charactersLen >= 2) { - v2gSignaturePropertyType->Id.charactersLen = (uint16_t)(v2gSignaturePropertyType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertyType->Id.charactersLen, v2gSignaturePropertyType->Id.characters); + if (v2gObjectType->Encoding.charactersLen >= 2) { + v2gObjectType->Encoding.charactersLen = (uint16_t)(v2gObjectType->Encoding.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->Encoding.charactersLen, v2gObjectType->Encoding.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - v2gSignaturePropertyType->Id_isUsed = 1u; - grammarID = 22; + v2gObjectType->Encoding_isUsed = 1u; + grammarID = 45; break; case 1: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); if (errn == 0) { - errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gSignaturePropertyType->Target.charactersLen >= 2) { - v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); + if (v2gObjectType->Id.charactersLen >= 2) { + v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 23; + v2gObjectType->Id_isUsed = 1u; + grammarID = 46; + break; + case 2: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->MimeType.charactersLen >= 2) { + v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->MimeType_isUsed = 1u; + grammarID = 47; + break; + case 3: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 4: + done = 1; + grammarID = 1; + break; + case 5: + grammarID = 35; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1015,26 +1962,56 @@ static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat } } break; - case 22: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 45: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); if (errn == 0) { - errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gSignaturePropertyType->Target.charactersLen >= 2) { - v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); + if (v2gObjectType->Id.charactersLen >= 2) { + v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 23; + v2gObjectType->Id_isUsed = 1u; + grammarID = 46; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->MimeType.charactersLen >= 2) { + v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->MimeType_isUsed = 1u; + grammarID = 47; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 3: + done = 1; + grammarID = 1; + break; + case 4: + grammarID = 35; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1042,19 +2019,62 @@ static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat } } break; - case 23: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + case 46: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->MimeType.charactersLen >= 2) { + v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->MimeType_isUsed = 1u; + grammarID = 47; + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 2: + done = 1; + grammarID = 1; + break; + case 3: + grammarID = 35; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 47: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; + grammarID = 35; break; case 1: - errn = decodeDeviationsCH(stream); - grammarID = 25; + done = 1; + grammarID = 1; + break; + case 2: + grammarID = 35; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1062,7 +2082,7 @@ static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat } } break; - case 24: + case 35: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1070,303 +2090,14 @@ static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; + grammarID = 35; break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; case 2: - grammarID = 24; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 25: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 1: - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { - int grammarID = 26; - int done = 0; - - init_v2gReferenceType(v2gReferenceType); - - while(!done) { - switch(grammarID) { - case 26: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Id.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->Id.charactersLen - 2) <= v2gReferenceType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->Id.charactersLen >= 2) { - v2gReferenceType->Id.charactersLen = (uint16_t)(v2gReferenceType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->Id.charactersLen, v2gReferenceType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->Id_isUsed = 1u; - grammarID = 27; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->Type.charactersLen >= 2) { - v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->Type_isUsed = 1u; - grammarID = 28; - break; - case 2: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->URI.charactersLen >= 2) { - v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->URI_isUsed = 1u; - grammarID = 29; - break; - case 3: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 30; - break; - case 4: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 31; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 27: - /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->Type.charactersLen >= 2) { - v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->Type_isUsed = 1u; - grammarID = 28; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->URI.charactersLen >= 2) { - v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->URI_isUsed = 1u; - grammarID = 29; - break; - case 2: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 30; - break; - case 3: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 31; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 28: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->URI.charactersLen >= 2) { - v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->URI_isUsed = 1u; - grammarID = 29; - break; - case 1: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 30; - break; - case 2: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 31; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 29: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 30; - break; - case 1: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 31; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 30: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 31; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 31: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->DigestValue.bytesLen); - if (errn == 0) { - errn = (v2gReferenceType->DigestValue.bytesLen) <= v2gReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gReferenceType->DigestValue.bytesLen, v2gReferenceType->DigestValue.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + grammarID = 35; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1387,14 +2118,14 @@ static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType) { - int grammarID = 32; + int grammarID = 48; int done = 0; init_v2gManifestType(v2gManifestType); while(!done) { switch(grammarID) { - case 32: + case 48: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1414,7 +2145,7 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v } } v2gManifestType->Id_isUsed = 1u; - grammarID = 33; + grammarID = 49; break; case 1: if (v2gManifestType->Reference.arrayLen < v2gManifestType_Reference_ARRAY_SIZE) { @@ -1422,7 +2153,7 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 34; + grammarID = 50; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1430,7 +2161,7 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v } } break; - case 33: + case 49: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -1441,7 +2172,7 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 34; + grammarID = 50; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1449,7 +2180,7 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v } } break; - case 34: + case 50: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1460,11 +2191,1148 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 34; + grammarID = 50; break; case 1: done = 1; - grammarID = 4; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { + int grammarID = 51; + int done = 0; + + init_v2gParameterSetType(v2gParameterSetType); + + while(!done) { + switch(grammarID) { + case 51: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &v2gParameterSetType->ParameterSetID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 52; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 52: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 53; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 53; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { + int grammarID = 54; + int done = 0; + + init_v2gPaymentServiceSelectionResType(v2gPaymentServiceSelectionResType); + + while(!done) { + switch(grammarID) { + case 54: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gPaymentServiceSelectionResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { + int grammarID = 55; + int done = 0; + + init_v2gRelativeTimeIntervalType(v2gRelativeTimeIntervalType); + + while(!done) { + switch(grammarID) { + case 55: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->start); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 56; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 56: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->duration); + v2gRelativeTimeIntervalType->duration_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { + int grammarID = 57; + int done = 0; + + init_v2gContractSignatureEncryptedPrivateKeyType(v2gContractSignatureEncryptedPrivateKeyType); + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); + if (errn == 0) { + errn = (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2) <= v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen >= 2) { + v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen = (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen, v2gContractSignatureEncryptedPrivateKeyType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 58; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 58: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); + if (errn == 0) { + errn = (v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen) <= v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes); + } + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ +static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { + int grammarID = 59; + int done = 0; + + init_v2gSubCertificatesType(v2gSubCertificatesType); + + while(!done) { + switch(grammarID) { + case 59: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 60; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 60: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 61; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 61: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 62; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 62: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ +static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType) { + int grammarID = 63; + int done = 0; + + init_v2gPaymentOptionListType(v2gPaymentOptionListType); + + while(!done) { + switch(grammarID) { + case 63: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gPaymentOptionListType->PaymentOption.arrayLen < v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen] = (v2gpaymentOptionType) uint32; + v2gPaymentOptionListType->PaymentOption.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 64: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gPaymentOptionListType->PaymentOption.arrayLen < v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen] = (v2gpaymentOptionType) uint32; + v2gPaymentOptionListType->PaymentOption.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ +static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { + int grammarID = 65; + int done = 0; + + init_v2gSalesTariffEntryType(v2gSalesTariffEntryType); + + while(!done) { + switch(grammarID) { + case 65: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval); + v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 66; + break; + case 1: + errn = decode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval); + v2gSalesTariffEntryType->TimeInterval_isUsed = 1u; + grammarID = 66; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 66: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); + v2gSalesTariffEntryType->EPriceLevel_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 67; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 68; + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 67: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 68; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 68: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 69; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 69: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ +static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { + int grammarID = 70; + int done = 0; + + init_v2gSupportedEnergyTransferModeType(v2gSupportedEnergyTransferModeType); + + while(!done) { + switch(grammarID) { + case 70: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 71: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 72; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 72: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 73; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 74; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 74: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 75; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 75: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1485,14 +3353,14 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType) { - int grammarID = 35; + int grammarID = 76; int done = 0; init_v2gSelectedServiceType(v2gSelectedServiceType); while(!done) { switch(grammarID) { - case 35: + case 76: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -1512,7 +3380,7 @@ static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelected /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 36; + grammarID = 77; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -1524,7 +3392,7 @@ static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelected } } break; - case 36: + case 77: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1545,7 +3413,7 @@ static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelected /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -1553,7 +3421,7 @@ static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelected break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1561,14 +3429,14 @@ static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelected } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1587,123 +3455,16 @@ static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelected return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { - int grammarID = 37; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { + int grammarID = 23; int done = 0; - init_v2gEVChargeParameterType(v2gEVChargeParameterType); + init_v2gWeldingDetectionResType(v2gWeldingDetectionResType); while(!done) { switch(grammarID) { - case 37: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gEVChargeParameterType->DepartureTime); - v2gEVChargeParameterType->DepartureTime_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { - int grammarID = 38; - int done = 0; - - init_v2gEVSEChargeParameterType(v2gEVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { - int grammarID = 39; - int done = 0; - - init_v2gChargingStatusResType(v2gChargingStatusResType); - - while(!done) { - switch(grammarID) { - case 39: + case 23: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -1714,7 +3475,7 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gChargingStatusResType->ResponseCode = (v2gresponseCodeType) uint32; + v2gWeldingDetectionResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -1724,7 +3485,7 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 40; + grammarID = 24; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -1736,43 +3497,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 40: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + case 24: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargingStatusResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gChargingStatusResType->EVSEID.charactersLen - 2) <= v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gChargingStatusResType->EVSEID.charactersLen >= 2) { - v2gChargingStatusResType->EVSEID.charactersLen = (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gChargingStatusResType->EVSEID.charactersLen, v2gChargingStatusResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 41; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus); + grammarID = 25; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1780,32 +3512,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gChargingStatusResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 42; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage); + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1813,155 +3527,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent); - v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; - grammarID = 43; - break; - case 1: - errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); - v2gChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 44; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); - v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 45; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 43: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); - v2gChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 44; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); - v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 45; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 44: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); - v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 45; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1980,49 +3553,17 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ -static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { - int grammarID = 46; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + int grammarID = 78; int done = 0; - init_v2gEVSEStatusType(v2gEVSEStatusType); + init_v2gPowerDeliveryReqType(v2gPowerDeliveryReqType); while(!done) { switch(grammarID) { - case 46: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gEVSEStatusType->NotificationMaxDelay); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 47; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 47: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + case 78: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -2032,17 +3573,17 @@ static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusTyp if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gEVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + v2gPowerDeliveryReqType->ChargeProgress = (v2gchargeProgressType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 79; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2054,14 +3595,652 @@ static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusTyp } } break; - case 3: + case 79: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gPowerDeliveryReqType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 80; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 80: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile); + v2gPowerDeliveryReqType->ChargingProfile_isUsed = 1u; + grammarID = 81; + break; + case 1: + errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 5; + break; + case 2: + errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 5; + break; + case 3: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 81: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 5; + break; + case 1: + errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 5; + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ +static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { + int grammarID = 82; + int done = 0; + + init_v2gConsumptionCostType(v2gConsumptionCostType); + + while(!done) { + switch(grammarID) { + case 82: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue); + grammarID = 83; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 84; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 84: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 85; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 85: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { + int grammarID = 86; + int done = 0; + + init_v2gDC_EVChargeParameterType(v2gDC_EVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 86: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gDC_EVChargeParameterType->DepartureTime); + v2gDC_EVChargeParameterType->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 87; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); + grammarID = 88; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 87: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); + grammarID = 88; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 88: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit); + grammarID = 89; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 89: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit); + v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 90; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 91; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 90: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 91; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 91: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity); + v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; + grammarID = 92; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); + v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 93; + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 94; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); + v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 93; + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 94; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 93: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 94; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { + int grammarID = 95; + int done = 0; + + init_v2gChargingProfileType(v2gChargingProfileType); + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 96; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 96: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 96; + break; + case 1: + done = 1; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2082,14 +4261,14 @@ static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusTyp /* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { - int grammarID = 48; + int grammarID = 97; int done = 0; init_v2gMeteringReceiptReqType(v2gMeteringReceiptReqType); while(!done) { switch(grammarID) { - case 48: + case 97: /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -2109,7 +4288,7 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter } } v2gMeteringReceiptReqType->Id_isUsed = 1u; - grammarID = 49; + grammarID = 98; break; case 1: /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ @@ -2132,7 +4311,7 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 50; + grammarID = 99; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2144,7 +4323,7 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter } } break; - case 49: + case 98: /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -2170,7 +4349,7 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 50; + grammarID = 99; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2182,7 +4361,7 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter } } break; - case 50: + case 99: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -2204,7 +4383,7 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 51; + grammarID = 100; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2212,7 +4391,7 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter break; case 1: errn = decode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo); - grammarID = 3; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2220,14 +4399,14 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter } } break; - case 51: + case 100: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo); - grammarID = 3; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2235,14 +4414,14 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2261,118 +4440,63 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { - int grammarID = 52; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { + int grammarID = 101; int done = 0; - init_v2gDC_EVSEChargeParameterType(v2gDC_EVSEChargeParameterType); + init_v2gChargeParameterDiscoveryReqType(v2gChargeParameterDiscoveryReqType); while(!done) { switch(grammarID) { - case 52: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus); - grammarID = 53; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 53: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); - grammarID = 54; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 54: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); - grammarID = 55; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 55: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); - grammarID = 56; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 56: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); - grammarID = 57; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 57: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); - grammarID = 58; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 58: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + case 101: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); - v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; - grammarID = 59; + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); + v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 102; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 60; + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 103; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2380,78 +4504,8 @@ static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gD } } break; - case 59: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 60: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); - v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { - int grammarID = 61; - int done = 0; - - init_v2gServiceDetailResType(v2gServiceDetailResType); - - while(!done) { - switch(grammarID) { - case 61: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + case 102: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -2460,18 +4514,18 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gServiceDetailResType->ResponseCode = (v2gresponseCodeType) uint32; + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 62; + grammarID = 103; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2483,8 +4537,1420 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } } break; - case 62: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + case 103: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter); + v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; + grammarID = 5; + break; + case 1: + errn = decode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter); + v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; + grammarID = 5; + break; + case 2: + errn = decode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter); + v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { + int grammarID = 104; + int done = 0; + + init_v2gBodyType(v2gBodyType); + + while(!done) { + switch(grammarID) { + case 104: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq); + v2gBodyType->AuthorizationReq_isUsed = 1u; + grammarID = 5; + break; + case 1: + errn = decode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes); + v2gBodyType->AuthorizationRes_isUsed = 1u; + grammarID = 5; + break; + case 2: + errn = decode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement); + v2gBodyType->BodyElement_isUsed = 1u; + grammarID = 5; + break; + case 3: + errn = decode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq); + v2gBodyType->CableCheckReq_isUsed = 1u; + grammarID = 5; + break; + case 4: + errn = decode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes); + v2gBodyType->CableCheckRes_isUsed = 1u; + grammarID = 5; + break; + case 5: + errn = decode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq); + v2gBodyType->CertificateInstallationReq_isUsed = 1u; + grammarID = 5; + break; + case 6: + errn = decode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes); + v2gBodyType->CertificateInstallationRes_isUsed = 1u; + grammarID = 5; + break; + case 7: + errn = decode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq); + v2gBodyType->CertificateUpdateReq_isUsed = 1u; + grammarID = 5; + break; + case 8: + errn = decode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes); + v2gBodyType->CertificateUpdateRes_isUsed = 1u; + grammarID = 5; + break; + case 9: + errn = decode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq); + v2gBodyType->ChargeParameterDiscoveryReq_isUsed = 1u; + grammarID = 5; + break; + case 10: + errn = decode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes); + v2gBodyType->ChargeParameterDiscoveryRes_isUsed = 1u; + grammarID = 5; + break; + case 11: + errn = decode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq); + v2gBodyType->ChargingStatusReq_isUsed = 1u; + grammarID = 5; + break; + case 12: + errn = decode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes); + v2gBodyType->ChargingStatusRes_isUsed = 1u; + grammarID = 5; + break; + case 13: + errn = decode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq); + v2gBodyType->CurrentDemandReq_isUsed = 1u; + grammarID = 5; + break; + case 14: + errn = decode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes); + v2gBodyType->CurrentDemandRes_isUsed = 1u; + grammarID = 5; + break; + case 15: + errn = decode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq); + v2gBodyType->MeteringReceiptReq_isUsed = 1u; + grammarID = 5; + break; + case 16: + errn = decode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes); + v2gBodyType->MeteringReceiptRes_isUsed = 1u; + grammarID = 5; + break; + case 17: + errn = decode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq); + v2gBodyType->PaymentDetailsReq_isUsed = 1u; + grammarID = 5; + break; + case 18: + errn = decode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes); + v2gBodyType->PaymentDetailsRes_isUsed = 1u; + grammarID = 5; + break; + case 19: + errn = decode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq); + v2gBodyType->PaymentServiceSelectionReq_isUsed = 1u; + grammarID = 5; + break; + case 20: + errn = decode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes); + v2gBodyType->PaymentServiceSelectionRes_isUsed = 1u; + grammarID = 5; + break; + case 21: + errn = decode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq); + v2gBodyType->PowerDeliveryReq_isUsed = 1u; + grammarID = 5; + break; + case 22: + errn = decode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes); + v2gBodyType->PowerDeliveryRes_isUsed = 1u; + grammarID = 5; + break; + case 23: + errn = decode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq); + v2gBodyType->PreChargeReq_isUsed = 1u; + grammarID = 5; + break; + case 24: + errn = decode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes); + v2gBodyType->PreChargeRes_isUsed = 1u; + grammarID = 5; + break; + case 25: + errn = decode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq); + v2gBodyType->ServiceDetailReq_isUsed = 1u; + grammarID = 5; + break; + case 26: + errn = decode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes); + v2gBodyType->ServiceDetailRes_isUsed = 1u; + grammarID = 5; + break; + case 27: + errn = decode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq); + v2gBodyType->ServiceDiscoveryReq_isUsed = 1u; + grammarID = 5; + break; + case 28: + errn = decode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes); + v2gBodyType->ServiceDiscoveryRes_isUsed = 1u; + grammarID = 5; + break; + case 29: + errn = decode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq); + v2gBodyType->SessionSetupReq_isUsed = 1u; + grammarID = 5; + break; + case 30: + errn = decode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes); + v2gBodyType->SessionSetupRes_isUsed = 1u; + grammarID = 5; + break; + case 31: + errn = decode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq); + v2gBodyType->SessionStopReq_isUsed = 1u; + grammarID = 5; + break; + case 32: + errn = decode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes); + v2gBodyType->SessionStopRes_isUsed = 1u; + grammarID = 5; + break; + case 33: + errn = decode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq); + v2gBodyType->WeldingDetectionReq_isUsed = 1u; + grammarID = 5; + break; + case 34: + errn = decode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes); + v2gBodyType->WeldingDetectionRes_isUsed = 1u; + grammarID = 5; + break; + case 35: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType) { + int grammarID = 105; + int done = 0; + + init_v2gTransformsType(v2gTransformsType); + + while(!done) { + switch(grammarID) { + case 105: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { + errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 106; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 106: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { + errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 106; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { + int grammarID = 107; + int done = 0; + + init_v2gServiceDiscoveryReqType(v2gServiceDiscoveryReqType); + + while(!done) { + switch(grammarID) { + case 107: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gServiceDiscoveryReqType->ServiceScope.charactersLen); + if (errn == 0) { + errn = (v2gServiceDiscoveryReqType->ServiceScope.charactersLen - 2) <= v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gServiceDiscoveryReqType->ServiceScope.charactersLen >= 2) { + v2gServiceDiscoveryReqType->ServiceScope.charactersLen = (uint16_t)(v2gServiceDiscoveryReqType->ServiceScope.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gServiceDiscoveryReqType->ServiceScope.charactersLen, v2gServiceDiscoveryReqType->ServiceScope.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gServiceDiscoveryReqType->ServiceScope_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 108; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceDiscoveryReqType->ServiceCategory = (v2gserviceCategoryType) uint32; + v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 108: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceDiscoveryReqType->ServiceCategory = (v2gserviceCategoryType) uint32; + v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ +static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { + int grammarID = 109; + int done = 0; + + init_v2gEVSEStatusType(v2gEVSEStatusType); + + while(!done) { + switch(grammarID) { + case 109: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gEVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 110; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 110: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gEVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { + int grammarID = 111; + int done = 0; + + init_v2gProfileEntryType(v2gProfileEntryType); + + while(!done) { + switch(grammarID) { + case 111: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gProfileEntryType->ChargingProfileEntryStart); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 112; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 112: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower); + grammarID = 113; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 113: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &(uint32)); + v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse = (int8_t)(uint32 + 1); + v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType) { + int grammarID = 114; + int done = 0; + + init_v2gKeyInfoType(v2gKeyInfoType); + + while(!done) { + switch(grammarID) { + case 114: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->Id.charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->Id.charactersLen - 2) <= v2gKeyInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->Id.charactersLen >= 2) { + v2gKeyInfoType->Id.charactersLen = (uint16_t)(v2gKeyInfoType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->Id.charactersLen, v2gKeyInfoType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->Id_isUsed = 1u; + grammarID = 115; + break; + case 1: + if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 3: + if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 4: + if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 5: + if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 6: + if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 7: + if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 8: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 116; + break; + case 9: + grammarID = 117; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 115: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 2: + if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 3: + if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 4: + if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 5: + if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 6: + if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 7: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 116; + break; + case 8: + grammarID = 117; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 116: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 2: + if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 3: + if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 4: + if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 5: + if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 6: + if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 7: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 116; + break; + case 8: + done = 1; + grammarID = 1; + break; + case 9: + grammarID = 116; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 117: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 2: + if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 3: + if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 4: + if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 5: + if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 116; + break; + case 6: + if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 116; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 7: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 116; + break; + case 8: + grammarID = 117; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { + int grammarID = 118; + int done = 0; + + init_v2gMessageHeaderType(v2gMessageHeaderType); + + while(!done) { + switch(grammarID) { + case 118: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gMessageHeaderType->SessionID.bytesLen); + if (errn == 0) { + errn = (v2gMessageHeaderType->SessionID.bytesLen) <= v2gMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gMessageHeaderType->SessionID.bytesLen, v2gMessageHeaderType->SessionID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 119; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification); + v2gMessageHeaderType->Notification_isUsed = 1u; + grammarID = 120; + break; + case 1: + errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); + v2gMessageHeaderType->Signature_isUsed = 1u; + grammarID = 5; + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 120: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); + v2gMessageHeaderType->Signature_isUsed = 1u; + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { + int grammarID = 121; + int done = 0; + + init_v2gServiceDetailReqType(v2gServiceDetailReqType); + + while(!done) { + switch(grammarID) { + case 121: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -2493,7 +5959,7 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceDetailResType->ServiceID); + errn = decodeUnsignedInteger16(stream, &v2gServiceDetailReqType->ServiceID); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -2503,7 +5969,7 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 63; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2515,34 +5981,14 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } } break; - case 63: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList); - v2gServiceDetailResType->ServiceParameterList_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2561,101 +6007,23 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { - int grammarID = 64; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ +static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { + int grammarID = 122; int done = 0; - init_v2gCertificateChainType(v2gCertificateChainType); + init_v2gAC_EVSEChargeParameterType(v2gAC_EVSEChargeParameterType); while(!done) { switch(grammarID) { - case 64: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Id.charactersLen); - if (errn == 0) { - errn = (v2gCertificateChainType->Id.charactersLen - 2) <= v2gCertificateChainType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCertificateChainType->Id.charactersLen >= 2) { - v2gCertificateChainType->Id.charactersLen = (uint16_t)(v2gCertificateChainType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCertificateChainType->Id.charactersLen, v2gCertificateChainType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gCertificateChainType->Id_isUsed = 1u; - grammarID = 65; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); - if (errn == 0) { - errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 66; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 65: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + case 122: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); - if (errn == 0) { - errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 66; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus); + grammarID = 123; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2663,19 +6031,14 @@ static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertifi } } break; - case 66: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 123: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates); - v2gCertificateChainType->SubCertificates_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage); + grammarID = 124; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2683,1757 +6046,29 @@ static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertifi } } break; - case 3: + case 124: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { - int grammarID = 67; - int done = 0; - - init_v2gCanonicalizationMethodType(v2gCanonicalizationMethodType); - - while(!done) { - switch(grammarID) { - case 67: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gCanonicalizationMethodType->Algorithm.charactersLen); - if (errn == 0) { - errn = (v2gCanonicalizationMethodType->Algorithm.charactersLen - 2) <= v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCanonicalizationMethodType->Algorithm.charactersLen >= 2) { - v2gCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.charactersLen, v2gCanonicalizationMethodType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 68; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 68: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 24; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 24; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { - int grammarID = 69; - int done = 0; - - init_v2gMeteringReceiptResType(v2gMeteringReceiptResType); - - while(!done) { - switch(grammarID) { - case 69: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gMeteringReceiptResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 70; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 70: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus); - v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus); - v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus); - v2gMeteringReceiptResType->EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { - int grammarID = 71; - int done = 0; - - init_v2gPowerDeliveryReqType(v2gPowerDeliveryReqType); - - while(!done) { - switch(grammarID) { - case 71: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gPowerDeliveryReqType->ChargeProgress = (v2gchargeProgressType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 72; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 72: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gPowerDeliveryReqType->SAScheduleTupleID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 73; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile); - v2gPowerDeliveryReqType->ChargingProfile_isUsed = 1u; - grammarID = 74; - break; - case 1: - errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 74: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { - int grammarID = 75; - int done = 0; - - init_v2gPMaxScheduleType(v2gPMaxScheduleType); - - while(!done) { - switch(grammarID) { - case 75: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { - errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 76; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 76: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { - errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 76; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ -static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { - int grammarID = 77; - int done = 0; - - init_v2gSessionStopReqType(v2gSessionStopReqType); - - while(!done) { - switch(grammarID) { - case 77: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - v2gSessionStopReqType->ChargingSession = (v2gchargingSessionType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ -static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType) { - int grammarID = 78; - int done = 0; - - init_v2gChargeServiceType(v2gChargeServiceType); - - while(!done) { - switch(grammarID) { - case 78: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 79; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceName.charactersLen); - if (errn == 0) { - errn = (v2gChargeServiceType->ServiceName.charactersLen - 2) <= v2gChargeServiceType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gChargeServiceType->ServiceName.charactersLen >= 2) { - v2gChargeServiceType->ServiceName.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gChargeServiceType->ServiceName.charactersLen, v2gChargeServiceType->ServiceName.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gChargeServiceType->ServiceName_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 80; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gChargeServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 81; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 80: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gChargeServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 81; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceScope.charactersLen); - if (errn == 0) { - errn = (v2gChargeServiceType->ServiceScope.charactersLen - 2) <= v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gChargeServiceType->ServiceScope.charactersLen >= 2) { - v2gChargeServiceType->ServiceScope.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gChargeServiceType->ServiceScope.charactersLen, v2gChargeServiceType->ServiceScope.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gChargeServiceType->ServiceScope_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 82; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 83; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 83; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ -static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { - int grammarID = 84; - int done = 0; - - init_v2gParameterType(v2gParameterType); - - while(!done) { - switch(grammarID) { - case 84: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gParameterType->Name.charactersLen); - if (errn == 0) { - errn = (v2gParameterType->Name.charactersLen - 2) <= v2gParameterType_Name_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gParameterType->Name.charactersLen >= 2) { - v2gParameterType->Name.charactersLen = (uint16_t)(v2gParameterType->Name.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gParameterType->Name.charactersLen, v2gParameterType->Name.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 85; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 85: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gParameterType->boolValue); - v2gParameterType->boolValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gParameterType->byteValue = (int8_t)(uint32 -128); - v2gParameterType->byteValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gParameterType->shortValue); - v2gParameterType->shortValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger32(stream, &v2gParameterType->intValue); - v2gParameterType->intValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - errn = decode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue); - v2gParameterType->physicalValue_isUsed = 1u; - grammarID = 3; - break; - case 5: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gParameterType->stringValue.charactersLen); - if (errn == 0) { - errn = (v2gParameterType->stringValue.charactersLen - 2) <= v2gParameterType_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gParameterType->stringValue.charactersLen >= 2) { - v2gParameterType->stringValue.charactersLen = (uint16_t)(v2gParameterType->stringValue.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gParameterType->stringValue.charactersLen, v2gParameterType->stringValue.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gParameterType->stringValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { - int grammarID = 38; - int done = 0; - - init_v2gSASchedulesType(v2gSASchedulesType); - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { - int grammarID = 86; - int done = 0; - - init_v2gPaymentServiceSelectionResType(v2gPaymentServiceSelectionResType); - - while(!done) { - switch(grammarID) { - case 86: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gPaymentServiceSelectionResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { - int grammarID = 87; - int done = 0; - - init_v2gKeyValueType(v2gKeyValueType); - - while(!done) { - switch(grammarID) { - case 87: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); - v2gKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 88; - break; - case 1: - errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); - v2gKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 88; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 88; - break; - case 3: - grammarID = 89; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 88: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - case 1: - grammarID = 88; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 89: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); - v2gKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 88; - break; - case 1: - errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); - v2gKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 88; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 88; - break; - case 3: - grammarID = 89; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { - int grammarID = 90; - int done = 0; - - init_v2gSessionSetupResType(v2gSessionSetupResType); - - while(!done) { - switch(grammarID) { - case 90: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gSessionSetupResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 91; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 91: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSessionSetupResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gSessionSetupResType->EVSEID.charactersLen - 2) <= v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSessionSetupResType->EVSEID.charactersLen >= 2) { - v2gSessionSetupResType->EVSEID.charactersLen = (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSessionSetupResType->EVSEID.charactersLen, v2gSessionSetupResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 92; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 92: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gSessionSetupResType->EVSETimeStamp); - v2gSessionSetupResType->EVSETimeStamp_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { - int grammarID = 93; - int done = 0; - - init_v2gAuthorizationResType(v2gAuthorizationResType); - - while(!done) { - switch(grammarID) { - case 93: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gAuthorizationResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 94; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gAuthorizationResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { - int grammarID = 95; - int done = 0; - - init_v2gX509DataType(v2gX509DataType); - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 96; - break; - case 1: - if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); - } - v2gX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { - v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); - } - v2gX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); - } - v2gX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 5: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 96; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 96: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 96; - break; - case 1: - if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); - } - v2gX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { - v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); - } - v2gX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); - } - v2gX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 5: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 96; - break; - case 6: - done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4454,14 +6089,14 @@ static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v /* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { - int grammarID = 97; + int grammarID = 125; int done = 0; init_v2gCertificateUpdateReqType(v2gCertificateUpdateReqType); while(!done) { switch(grammarID) { - case 97: + case 125: /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -4480,7 +6115,7 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 98; + grammarID = 126; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4488,14 +6123,14 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 98: + case 126: /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain); - grammarID = 99; + grammarID = 127; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4503,7 +6138,7 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 99: + case 127: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -4535,7 +6170,7 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 100; + grammarID = 128; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4547,14 +6182,14 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 100: + case 128: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs); - grammarID = 3; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4562,14 +6197,14 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4588,334 +6223,37 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ -static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType) { - int grammarID = 101; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { + int grammarID = 129; int done = 0; - init_v2gPaymentOptionListType(v2gPaymentOptionListType); + init_v2gPhysicalValueType(v2gPhysicalValueType); while(!done) { switch(grammarID) { - case 101: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ + case 129: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gPaymentOptionListType->PaymentOption.arrayLen < v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen] = (v2gpaymentOptionType) uint32; - v2gPaymentOptionListType->PaymentOption.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 102; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 102: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gPaymentOptionListType->PaymentOption.arrayLen < v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen] = (v2gpaymentOptionType) uint32; - v2gPaymentOptionListType->PaymentOption.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { - int grammarID = 103; - int done = 0; - - init_v2gSignatureMethodType(v2gSignatureMethodType); - - while(!done) { - switch(grammarID) { - case 103: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignatureMethodType->Algorithm.charactersLen); - if (errn == 0) { - errn = (v2gSignatureMethodType->Algorithm.charactersLen - 2) <= v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignatureMethodType->Algorithm.charactersLen >= 2) { - v2gSignatureMethodType->Algorithm.charactersLen = (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignatureMethodType->Algorithm.charactersLen, v2gSignatureMethodType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 104; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 104: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gSignatureMethodType->HMACOutputLength); - v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + v2gPhysicalValueType->Multiplier = (int8_t)(uint32 -3); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 24; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 105; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 24; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 105: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gSignatureMethodType->HMACOutputLength); - v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 24; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 105; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { - int grammarID = 106; - int done = 0; - - init_v2gChargeParameterDiscoveryReqType(v2gChargeParameterDiscoveryReqType); - - while(!done) { - switch(grammarID) { - case 106: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); - v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 107; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 108; + grammarID = 130; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4927,8 +6265,8 @@ static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct } } break; - case 107: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ + case 130: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -4938,17 +6276,17 @@ static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; + v2gPhysicalValueType->Unit = (v2gunitSymbolType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 108; + grammarID = 131; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4960,124 +6298,27 @@ static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct } } break; - case 108: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter); - v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter); - v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter); - v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ + case 131: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { - int grammarID = 38; - int done = 0; - - init_v2gEVPowerDeliveryParameterType(v2gEVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ -static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { - int grammarID = 109; - int done = 0; - - init_v2gCertificateInstallationResType(v2gCertificateInstallationResType); - - while(!done) { - switch(grammarID) { - case 109: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gCertificateInstallationResType->ResponseCode = (v2gresponseCodeType) uint32; + errn = decodeInteger16(stream, &v2gPhysicalValueType->Value); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 110; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5089,89 +6330,125 @@ static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct } } break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain); - grammarID = 111; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 111: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain); - grammarID = 112; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 112: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey); - grammarID = 113; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey); - grammarID = 114; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 114: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { + int grammarID = 132; + int done = 0; + + init_v2gX509IssuerSerialType(v2gX509IssuerSerialType); + + while(!done) { + switch(grammarID) { + case 132: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509IssuerSerialType->X509IssuerName.charactersLen); + if (errn == 0) { + errn = (v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gX509IssuerSerialType->X509IssuerName.charactersLen >= 2) { + v2gX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.charactersLen, v2gX509IssuerSerialType->X509IssuerName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 133; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 133: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gX509IssuerSerialType->X509SerialNumber); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5192,14 +6469,14 @@ static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { - int grammarID = 115; + int grammarID = 134; int done = 0; init_v2gListOfRootCertificateIDsType(v2gListOfRootCertificateIDsType); while(!done) { switch(grammarID) { - case 115: + case 134: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -5210,7 +6487,7 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 116; + grammarID = 135; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5218,7 +6495,7 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } } break; - case 116: + case 135: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -5229,1320 +6506,11 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 116; + grammarID = 135; break; case 1: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { - int grammarID = 117; - int done = 0; - - init_v2gDC_EVStatusType(v2gDC_EVStatusType); - - while(!done) { - switch(grammarID) { - case 117: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVStatusType->EVReady); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 118; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 118: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - v2gDC_EVStatusType->EVErrorCode = (v2gDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 119; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 119: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { - int grammarID = 120; - int done = 0; - - init_v2gCurrentDemandReqType(v2gCurrentDemandReqType); - - while(!done) { - switch(grammarID) { - case 120: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus); - grammarID = 121; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 121: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent); - grammarID = 122; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit); - v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; - grammarID = 123; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); - v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 124; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 125; - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 126; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 127; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); - v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 124; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 125; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 126; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 127; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 124: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 125; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 126; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 127; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 125: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 126; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 127; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 126: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 127; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC); - v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; - grammarID = 128; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); - v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 129; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 128: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); - v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 129; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 129: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType) { - int grammarID = 130; - int done = 0; - - init_v2gServiceType(v2gServiceType); - - while(!done) { - switch(grammarID) { - case 130: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 131; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 131: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceType->ServiceName.charactersLen); - if (errn == 0) { - errn = (v2gServiceType->ServiceName.charactersLen - 2) <= v2gServiceType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gServiceType->ServiceName.charactersLen >= 2) { - v2gServiceType->ServiceName.charactersLen = (uint16_t)(v2gServiceType->ServiceName.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gServiceType->ServiceName.charactersLen, v2gServiceType->ServiceName.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gServiceType->ServiceName_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 132; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 133; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 132: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 133; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 133: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceType->ServiceScope.charactersLen); - if (errn == 0) { - errn = (v2gServiceType->ServiceScope.charactersLen - 2) <= v2gServiceType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gServiceType->ServiceScope.charactersLen >= 2) { - v2gServiceType->ServiceScope.charactersLen = (uint16_t)(v2gServiceType->ServiceScope.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gServiceType->ServiceScope.charactersLen, v2gServiceType->ServiceScope.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gServiceType->ServiceScope_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 134; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gServiceType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 134: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gServiceType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { - int grammarID = 86; - int done = 0; - - init_v2gSessionStopResType(v2gSessionStopResType); - - while(!done) { - switch(grammarID) { - case 86: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gSessionStopResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ -static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { - int grammarID = 135; - int done = 0; - - init_v2gConsumptionCostType(v2gConsumptionCostType); - - while(!done) { - switch(grammarID) { - case 135: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue); - grammarID = 136; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 136: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 137; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 137: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 138; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 138: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { - int grammarID = 38; - int done = 0; - - init_v2gChargingStatusReqType(v2gChargingStatusReqType); - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { - int grammarID = 139; - int done = 0; - - init_v2gPreChargeReqType(v2gPreChargeReqType); - - while(!done) { - switch(grammarID) { - case 139: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus); - grammarID = 140; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 140: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage); - grammarID = 141; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 141: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { - int grammarID = 142; - int done = 0; - - init_v2gWeldingDetectionReqType(v2gWeldingDetectionReqType); - - while(!done) { - switch(grammarID) { - case 142: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { - int grammarID = 143; - int done = 0; - - init_v2gSignaturePropertiesType(v2gSignaturePropertiesType); - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertiesType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSignaturePropertiesType->Id.charactersLen - 2) <= v2gSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignaturePropertiesType->Id.charactersLen >= 2) { - v2gSignaturePropertiesType->Id.charactersLen = (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertiesType->Id.charactersLen, v2gSignaturePropertiesType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSignaturePropertiesType->Id_isUsed = 1u; - grammarID = 144; - break; - case 1: - if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 145; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 144: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 145; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 145: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 145; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { - int grammarID = 146; - int done = 0; - - init_v2gSelectedServiceListType(v2gSelectedServiceListType); - - while(!done) { - switch(grammarID) { - case 146: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 147; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 147: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 147; - break; - case 1: - done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6563,14 +6531,14 @@ static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele /* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { - int grammarID = 148; + int grammarID = 136; int done = 0; init_v2gServiceDiscoveryResType(v2gServiceDiscoveryResType); while(!done) { switch(grammarID) { - case 148: + case 136: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6591,7 +6559,7 @@ static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 149; + grammarID = 137; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6603,13 +6571,356 @@ static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServ } } break; - case 149: + case 137: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList); + grammarID = 138; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 138: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService); + grammarID = 139; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 139: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList); + v2gServiceDiscoveryResType->ServiceList_isUsed = 1u; + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { + int grammarID = 140; + int done = 0; + + init_v2gPaymentDetailsReqType(v2gPaymentDetailsReqType); + + while(!done) { + switch(grammarID) { + case 140: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsReqType->eMAID.charactersLen); + if (errn == 0) { + errn = (v2gPaymentDetailsReqType->eMAID.charactersLen - 2) <= v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gPaymentDetailsReqType->eMAID.charactersLen >= 2) { + v2gPaymentDetailsReqType->eMAID.charactersLen = (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.charactersLen, v2gPaymentDetailsReqType->eMAID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 141; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 141: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { + int grammarID = 142; + int done = 0; + + init_v2gPMaxScheduleEntryType(v2gPMaxScheduleEntryType); + + while(!done) { + switch(grammarID) { + case 142: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval); + v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 143; + break; + case 1: + errn = decode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval); + v2gPMaxScheduleEntryType->TimeInterval_isUsed = 1u; + grammarID = 143; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 143: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { + int grammarID = 144; + int done = 0; + + init_v2gCertificateUpdateResType(v2gCertificateUpdateResType); + + while(!done) { + switch(grammarID) { + case 144: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gCertificateUpdateResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 145; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 145: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain); + grammarID = 146; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 146: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain); + grammarID = 147; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 147: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey); + grammarID = 148; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 148: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey); + grammarID = 149; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 149: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID); grammarID = 150; break; default: @@ -6619,33 +6930,35 @@ static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServ } break; case 150: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService); - grammarID = 151; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 151: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList); - v2gServiceDiscoveryResType->ServiceList_isUsed = 1u; - grammarID = 3; + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &v2gCertificateUpdateResType->RetryCounter); + v2gCertificateUpdateResType->RetryCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6653,14 +6966,14 @@ static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServ } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6679,34 +6992,55 @@ static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServ return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { - int grammarID = 152; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ +static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { + int grammarID = 151; int done = 0; - init_v2gEMAIDType(v2gEMAIDType); + init_v2gCertificateInstallationResType(v2gCertificateInstallationResType); while(!done) { switch(grammarID) { - case 152: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + case 151: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gEMAIDType->Id.charactersLen); - if (errn == 0) { - errn = (v2gEMAIDType->Id.charactersLen - 2) <= v2gEMAIDType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gEMAIDType->Id.charactersLen >= 2) { - v2gEMAIDType->Id.charactersLen = (uint16_t)(v2gEMAIDType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gEMAIDType->Id.charactersLen, v2gEMAIDType->Id.characters); + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gCertificateInstallationResType->ResponseCode = (v2gresponseCodeType) uint32; } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 152; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 152: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain); grammarID = 153; break; default: @@ -6716,25 +7050,13 @@ static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAI } break; case 153: - /* StartTag[CHARACTERS[STRING]] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gEMAIDType->CONTENT.charactersLen); - if (errn == 0) { - errn = (v2gEMAIDType->CONTENT.charactersLen - 2) <= v2gEMAIDType_CONTENT_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gEMAIDType->CONTENT.charactersLen >= 2) { - v2gEMAIDType->CONTENT.charactersLen = (uint16_t)(v2gEMAIDType->CONTENT.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gEMAIDType->CONTENT.charactersLen, v2gEMAIDType->CONTENT.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 3; + errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain); + grammarID = 154; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6742,102 +7064,15 @@ static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAI } } break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { - int grammarID = 38; - int done = 0; - - init_v2gIntervalType(v2gIntervalType); - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { - int grammarID = 154; - int done = 0; - - init_v2gSignedInfoType(v2gSignedInfoType); - - while(!done) { - switch(grammarID) { case 154: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignedInfoType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSignedInfoType->Id.charactersLen - 2) <= v2gSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignedInfoType->Id.charactersLen >= 2) { - v2gSignedInfoType->Id.charactersLen = (uint16_t)(v2gSignedInfoType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignedInfoType->Id.charactersLen, v2gSignedInfoType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSignedInfoType->Id_isUsed = 1u; + errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey); grammarID = 155; break; - case 1: - errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); - grammarID = 156; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -6845,12 +7080,12 @@ static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoTyp } break; case 155: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); + errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey); grammarID = 156; break; default: @@ -6860,13 +7095,13 @@ static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoTyp } break; case 156: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod); - grammarID = 157; + errn = decode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID); + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6874,41 +7109,14 @@ static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoTyp } } break; - case 157: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + case 5: + /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 34; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 34: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 34; - break; - case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6929,21 +7137,21 @@ static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoTyp /* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType) { - int grammarID = 142; + int grammarID = 157; int done = 0; init_v2gCableCheckReqType(v2gCableCheckReqType); while(!done) { switch(grammarID) { - case 142: + case 157: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_v2gDC_EVStatusType(stream, &v2gCableCheckReqType->DC_EVStatus); - grammarID = 3; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6951,14 +7159,14 @@ static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheck } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6977,251 +7185,71 @@ static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheck return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ -static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { int grammarID = 158; int done = 0; - init_v2gServiceListType(v2gServiceListType); + init_v2gPGPDataType(v2gPGPDataType); while(!done) { switch(grammarID) { case 158: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 159; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 160; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 160: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 161; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 161: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 162; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 162: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 163; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 163: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 164; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 164: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 165; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 165: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ -static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { - int grammarID = 166; - int done = 0; - - init_v2gAC_EVSEStatusType(v2gAC_EVSEStatusType); - - while(!done) { - switch(grammarID) { - case 166: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gAC_EVSEStatusType->NotificationMaxDelay); + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyID.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyID.bytesLen) <= v2gPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyID.bytesLen, v2gPGPDataType->PGPKeyID.bytes); + } + v2gPGPDataType->PGPKeyID_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 167; + grammarID = 159; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); + } + v2gPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 160; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7233,8 +7261,158 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta } } break; - case 167: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + case 159: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); + } + v2gPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 160; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 160; + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 160: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 160; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { + int grammarID = 161; + int done = 0; + + init_v2gServiceParameterListType(v2gServiceParameterListType); + + while(!done) { + switch(grammarID) { + case 161: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 162; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 162: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 162; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ +static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { + int grammarID = 163; + int done = 0; + + init_v2gSessionStopReqType(v2gSessionStopReqType); + + while(!done) { + switch(grammarID) { + case 163: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -7243,18 +7421,393 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gAC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gSessionStopReqType->ChargingSession = (v2gchargingSessionType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 168; + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { + int grammarID = 0; + int done = 0; + + init_v2gSASchedulesType(v2gSASchedulesType); + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { + int grammarID = 157; + int done = 0; + + init_v2gWeldingDetectionReqType(v2gWeldingDetectionReqType); + + while(!done) { + switch(grammarID) { + case 157: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { + int grammarID = 57; + int done = 0; + + init_v2gDiffieHellmanPublickeyType(v2gDiffieHellmanPublickeyType); + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->Id.charactersLen); + if (errn == 0) { + errn = (v2gDiffieHellmanPublickeyType->Id.charactersLen - 2) <= v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gDiffieHellmanPublickeyType->Id.charactersLen >= 2) { + v2gDiffieHellmanPublickeyType->Id.charactersLen = (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.charactersLen, v2gDiffieHellmanPublickeyType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 58; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 58: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); + if (errn == 0) { + errn = (v2gDiffieHellmanPublickeyType->CONTENT.bytesLen) <= v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen, v2gDiffieHellmanPublickeyType->CONTENT.bytes); + } + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { + int grammarID = 164; + int done = 0; + + init_v2gSessionSetupReqType(v2gSessionSetupReqType); + + while(!done) { + switch(grammarID) { + case 164: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSessionSetupReqType->EVCCID.bytesLen); + if (errn == 0) { + errn = (v2gSessionSetupReqType->EVCCID.bytesLen) <= v2gSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytesLen, v2gSessionSetupReqType->EVCCID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { + int grammarID = 165; + int done = 0; + + init_v2gCurrentDemandReqType(v2gCurrentDemandReqType); + + while(!done) { + switch(grammarID) { + case 165: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus); + grammarID = 166; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 166: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent); + grammarID = 167; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 167: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit); + v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; + grammarID = 168; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); + v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 169; + break; + case 2: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 170; + break; + case 3: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 171; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 172; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7267,26 +7820,58 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta } break; case 168: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); + v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 169; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 170; + break; + case 2: /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gAC_EVSEStatusType->RCD); + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 171; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 172; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7298,62 +7883,54 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta } } break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { - int grammarID = 169; - int done = 0; - - init_v2gDC_EVSEStatusType(v2gDC_EVSEStatusType); - - while(!done) { - switch(grammarID) { case 169: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 170; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDC_EVSEStatusType->NotificationMaxDelay); + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 170; + grammarID = 171; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 172; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7366,24 +7943,24 @@ static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSESta } break; case 170: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gDC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 171; @@ -7392,6 +7969,27 @@ static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSESta } } break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 172; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -7399,25 +7997,23 @@ static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSESta } break; case 171: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gDC_EVSEStatusType->EVSEIsolationStatus = (v2gisolationLevelType) uint32; - v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u; + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 172; @@ -7426,28 +8022,6 @@ static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSESta } } break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -7455,7 +8029,134 @@ static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSESta } break; case 172: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC); + v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; + grammarID = 173; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); + v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 174; + break; + case 2: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 173: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); + v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 174; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 174: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { + int grammarID = 175; + int done = 0; + + init_v2gDC_EVStatusType(v2gDC_EVStatusType); + + while(!done) { + switch(grammarID) { + case 175: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVStatusType->EVReady); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 176; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 176: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -7465,244 +8166,14 @@ static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSESta if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; + v2gDC_EVStatusType->EVErrorCode = (v2gDC_EVErrorCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { - int grammarID = 173; - int done = 0; - - init_v2gSPKIDataType(v2gSPKIDataType); - - while(!done) { - switch(grammarID) { - case 173: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); - } - v2gSPKIDataType->SPKISexp.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 174; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 174: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); - } - v2gSPKIDataType->SPKISexp.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 174; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 175; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 175: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); - } - v2gSPKIDataType->SPKISexp.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 174; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType) { - int grammarID = 176; - int done = 0; - - init_v2gCurrentDemandResType(v2gCurrentDemandResType); - - while(!done) { - switch(grammarID) { - case 176: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gCurrentDemandResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 177; @@ -7718,68 +8189,153 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } break; case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gCurrentDemandResType->DC_EVSEStatus); - grammarID = 178; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 178: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentVoltage); - grammarID = 179; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 179: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentCurrent); - grammarID = 180; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 180: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSECurrentLimitAchieved); + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { + int grammarID = 178; + int done = 0; + + init_v2gDSAKeyValueType(v2gDSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 178: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->P.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->P.bytesLen) <= v2gDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->P.bytesLen, v2gDSAKeyValueType->P.bytes); + } + v2gDSAKeyValueType->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 179; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); + } + v2gDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 180; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 181; @@ -7794,24 +8350,31 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } } break; - case 181: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved)] */ + case 179: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEVoltageLimitAchieved); + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Q.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Q.bytesLen) <= v2gDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Q.bytesLen, v2gDSAKeyValueType->Q.bytes); + } + v2gDSAKeyValueType->Q_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 182; @@ -7827,23 +8390,134 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } break; case 182: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEPowerLimitAchieved); + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); + } + v2gDSAKeyValueType->G_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 180; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 181; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 180: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 181; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 181: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->J.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->J.bytesLen) <= v2gDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->J.bytesLen, v2gDSAKeyValueType->J.bytes); + } + v2gDSAKeyValueType->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 183; @@ -7852,6 +8526,38 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } } break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); + } + v2gDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 184; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 1; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -7859,58 +8565,42 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } break; case 183: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumVoltageLimit); - v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; - grammarID = 184; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); - v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 185; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 186; - break; - case 3: - /* FirstStartTag[CHARACTERS[STRING]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Seed.bytesLen); if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } + errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); } + v2gDSAKeyValueType->Seed_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 187; + grammarID = 184; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; + case 1: + done = 1; + grammarID = 1; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -7918,48 +8608,33 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } break; case 184: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); - v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 185; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 186; - break; - case 2: - /* FirstStartTag[CHARACTERS[STRING]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->PgenCounter.bytesLen); if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gDSAKeyValueType->PgenCounter.bytesLen) <= v2gDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } + errn = decodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytesLen, v2gDSAKeyValueType->PgenCounter.bytes); } + v2gDSAKeyValueType->PgenCounter_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 187; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7971,44 +8646,63 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } } break; - case 185: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 186; + done = 1; + grammarID = 1; break; - case 1: - /* FirstStartTag[CHARACTERS[STRING]] */ + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { + int grammarID = 185; + int done = 0; + + init_v2gChargingStatusResType(v2gChargingStatusResType); + + while(!done) { + switch(grammarID) { + case 185: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gChargingStatusResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 187; + grammarID = 186; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8030,14 +8724,14 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gChargingStatusResType->EVSEID.charactersLen); if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gChargingStatusResType->EVSEID.charactersLen - 2) <= v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + if (v2gChargingStatusResType->EVSEID.charactersLen >= 2) { + v2gChargingStatusResType->EVSEID.charactersLen = (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gChargingStatusResType->EVSEID.charactersLen, v2gChargingStatusResType->EVSEID.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; @@ -8075,7 +8769,7 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gCurrentDemandResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + v2gChargingStatusResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -8098,22 +8792,27 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } break; case 188: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo); - v2gCurrentDemandResType->MeterInfo_isUsed = 1u; + errn = decode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent); + v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; grammarID = 189; break; case 1: + errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); + v2gChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 190; + break; + case 2: /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); - v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; + errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); + v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -8123,15 +8822,15 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 191; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; - case 2: - done = 1; - grammarID = 4; + case 3: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8140,17 +8839,22 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } break; case 189: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: + errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); + v2gChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 190; + break; + case 1: /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); - v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; + errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); + v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -8160,202 +8864,52 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType) { - int grammarID = 190; - int done = 0; - - init_v2gKeyInfoType(v2gKeyInfoType); - - while(!done) { - switch(grammarID) { - case 190: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->Id.charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->Id.charactersLen - 2) <= v2gKeyInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->Id.charactersLen >= 2) { - v2gKeyInfoType->Id.charactersLen = (uint16_t)(v2gKeyInfoType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->Id.charactersLen, v2gKeyInfoType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->Id_isUsed = 1u; - grammarID = 191; - break; - case 1: - if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->KeyName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; + grammarID = 191; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; case 2: - if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 5; break; - case 3: - if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; - case 4: - if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 5: - if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 6: - if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 7: - if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->MgmtData.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + } + } + break; + case 190: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); + v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 192; + grammarID = 191; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; - case 8: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 192; - break; - case 9: - grammarID = 193; + case 1: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8364,133 +8918,13 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } break; case 191: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->KeyName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 2: - if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 3: - if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 4: - if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 5: - if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 6: - if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->MgmtData.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 7: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 192; - break; - case 8: - grammarID = 193; + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8498,138 +8932,105 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - case 192: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->KeyName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { + int grammarID = 192; + int done = 0; + + init_v2gReferenceType(v2gReferenceType); + + while(!done) { + switch(grammarID) { + case 192: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Id.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->Id.charactersLen - 2) <= v2gReferenceType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; + if (errn == 0) { + if (v2gReferenceType->Id.charactersLen >= 2) { + v2gReferenceType->Id.charactersLen = (uint16_t)(v2gReferenceType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->Id.charactersLen, v2gReferenceType->Id.characters); } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } + v2gReferenceType->Id_isUsed = 1u; + grammarID = 193; break; case 1: - if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - grammarID = 192; + if (errn == 0) { + if (v2gReferenceType->Type.charactersLen >= 2) { + v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->Type_isUsed = 1u; + grammarID = 194; break; case 2: - if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - grammarID = 192; + if (errn == 0) { + if (v2gReferenceType->URI.charactersLen >= 2) { + v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->URI_isUsed = 1u; + grammarID = 195; break; case 3: - if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; + grammarID = 196; break; case 4: - if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 5: - if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 6: - if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->MgmtData.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 7: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 192; - break; - case 8: - done = 1; - grammarID = 4; - break; - case 9: - grammarID = 192; + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 197; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8638,133 +9039,52 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } break; case 193: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= v2gKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].charactersLen, v2gKeyInfoType->KeyName.array[v2gKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->KeyName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; + if (errn == 0) { + if (v2gReferenceType->Type.charactersLen >= 2) { + v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } + v2gReferenceType->Type_isUsed = 1u; + grammarID = 194; break; case 1: - if (v2gKeyInfoType->KeyValue.arrayLen < v2gKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array[v2gKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - grammarID = 192; + if (errn == 0) { + if (v2gReferenceType->URI.charactersLen >= 2) { + v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->URI_isUsed = 1u; + grammarID = 195; break; case 2: - if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array[v2gKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; + grammarID = 196; break; case 3: - if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array[v2gKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 4: - if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array[v2gKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 5: - if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array[v2gKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 192; - break; - case 6: - if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= v2gKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].charactersLen, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gKeyInfoType->MgmtData.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 7: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 192; - break; - case 8: - grammarID = 193; + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 197; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8772,93 +9092,36 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { - int grammarID = 194; - int done = 0; - - init_v2gObjectType(v2gObjectType); - - while(!done) { - switch(grammarID) { case 194: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->Encoding.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); if (errn == 0) { - errn = (v2gObjectType->Encoding.charactersLen - 2) <= v2gObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gObjectType->Encoding.charactersLen >= 2) { - v2gObjectType->Encoding.charactersLen = (uint16_t)(v2gObjectType->Encoding.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->Encoding.charactersLen, v2gObjectType->Encoding.characters); + if (v2gReferenceType->URI.charactersLen >= 2) { + v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - v2gObjectType->Encoding_isUsed = 1u; + v2gReferenceType->URI_isUsed = 1u; grammarID = 195; break; case 1: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gObjectType->Id.charactersLen >= 2) { - v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gObjectType->Id_isUsed = 1u; + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; grammarID = 196; break; case 2: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gObjectType->MimeType.charactersLen >= 2) { - v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gObjectType->MimeType_isUsed = 1u; - grammarID = 68; - break; - case 3: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 4: - done = 1; - grammarID = 4; - break; - case 5: - grammarID = 24; + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 197; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8867,55 +9130,18 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } break; case 195: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gObjectType->Id.charactersLen >= 2) { - v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gObjectType->Id_isUsed = 1u; + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; grammarID = 196; break; case 1: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gObjectType->MimeType.charactersLen >= 2) { - v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gObjectType->MimeType_isUsed = 1u; - grammarID = 68; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 3: - done = 1; - grammarID = 4; - break; - case 4: - grammarID = 24; + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 197; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8924,38 +9150,51 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } break; case 196: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gObjectType->MimeType.charactersLen >= 2) { - v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 197; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 197: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->DigestValue.bytesLen); + if (errn == 0) { + errn = (v2gReferenceType->DigestValue.bytesLen) <= v2gReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gReferenceType->DigestValue.bytesLen, v2gReferenceType->DigestValue.bytes); + } } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - v2gObjectType->MimeType_isUsed = 1u; - grammarID = 68; - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 24; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8963,45 +9202,14 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } } break; - case 68: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 1: done = 1; - grammarID = 4; - break; - case 2: - grammarID = 24; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 24; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9020,37 +9228,42 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { - int grammarID = 197; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType) { + int grammarID = 198; int done = 0; - init_v2gSAScheduleTupleType(v2gSAScheduleTupleType); + init_v2gRSAKeyValueType(v2gRSAKeyValueType); while(!done) { switch(grammarID) { - case 197: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ + case 198: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSAScheduleTupleType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Modulus.bytesLen); + if (errn == 0) { + errn = (v2gRSAKeyValueType->Modulus.bytesLen) <= v2gRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gRSAKeyValueType->Modulus.bytesLen, v2gRSAKeyValueType->Modulus.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 198; + grammarID = 199; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9062,192 +9275,33 @@ static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSASchedu } } break; - case 198: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule); - grammarID = 199; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; case 199: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff); - v2gSAScheduleTupleType->SalesTariff_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { - int grammarID = 200; - int done = 0; - - init_v2gSignatureValueType(v2gSignatureValueType); - - while(!done) { - switch(grammarID) { - case 200: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSignatureValueType->Id.charactersLen - 2) <= v2gSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignatureValueType->Id.charactersLen >= 2) { - v2gSignatureValueType->Id.charactersLen = (uint16_t)(v2gSignatureValueType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignatureValueType->Id.charactersLen, v2gSignatureValueType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSignatureValueType->Id_isUsed = 1u; - grammarID = 6; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); - } - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 6: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); - } - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { - int grammarID = 69; - int done = 0; - - init_v2gPowerDeliveryResType(v2gPowerDeliveryResType); - - while(!done) { - switch(grammarID) { - case 69: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gPowerDeliveryResType->ResponseCode = (v2gresponseCodeType) uint32; + errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Exponent.bytesLen); + if (errn == 0) { + errn = (v2gRSAKeyValueType->Exponent.bytesLen) <= v2gRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gRSAKeyValueType->Exponent.bytesLen, v2gRSAKeyValueType->Exponent.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 70; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9259,40 +9313,14 @@ static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDe } } break; - case 70: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus); - v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus); - v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus); - v2gPowerDeliveryResType->EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9311,51 +9339,23 @@ static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDe return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ -static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { - int grammarID = 201; +/* Complex type name='urn:iso:15118:2:2013:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDef":Header,"urn:iso:15118:2:2013:MsgDef":Body)', derivedBy='RESTRICTION'. */ +static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { + int grammarID = 200; int done = 0; - init_v2gSubCertificatesType(v2gSubCertificatesType); + init_v2gAnonType_V2G_Message(v2gAnonType_V2G_Message); while(!done) { switch(grammarID) { - case 201: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + case 200: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 202; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header); + grammarID = 201; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9363,35 +9363,75 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } } break; + case 201: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ +static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { + int grammarID = 202; + int done = 0; + + init_v2gAC_EVChargeParameterType(v2gAC_EVChargeParameterType); + + while(!done) { + switch(grammarID) { case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gAC_EVChargeParameterType->DepartureTime); + v2gAC_EVChargeParameterType->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 203; @@ -9401,8 +9441,8 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } break; case 1: - done = 1; - grammarID = 4; + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); + grammarID = 204; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9411,45 +9451,13 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } break; case 203: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 204; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); + grammarID = 204; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9458,60 +9466,13 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } break; case 204: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 4; + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage); + grammarID = 205; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9519,80 +9480,15 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { - int grammarID = 205; - int done = 0; - - init_v2gAuthorizationReqType(v2gAuthorizationReqType); - - while(!done) { - switch(grammarID) { case 205: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->Id.charactersLen); - if (errn == 0) { - errn = (v2gAuthorizationReqType->Id.charactersLen - 2) <= v2gAuthorizationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gAuthorizationReqType->Id.charactersLen >= 2) { - v2gAuthorizationReqType->Id.charactersLen = (uint16_t)(v2gAuthorizationReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gAuthorizationReqType->Id.charactersLen, v2gAuthorizationReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gAuthorizationReqType->Id_isUsed = 1u; + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxCurrent); grammarID = 206; break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->GenChallenge.bytesLen); - if (errn == 0) { - errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); - } - v2gAuthorizationReqType->GenChallenge_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 4; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -9600,41 +9496,13 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori } break; case 206: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->GenChallenge.bytesLen); - if (errn == 0) { - errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); - } - v2gAuthorizationReqType->GenChallenge_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMinCurrent); + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9642,14 +9510,14 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9668,25 +9536,33 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { int grammarID = 207; int done = 0; - init_v2gChargingProfileType(v2gChargingProfileType); + init_v2gSignatureMethodType(v2gSignatureMethodType); while(!done) { switch(grammarID) { case 207: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &v2gSignatureMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (v2gSignatureMethodType->Algorithm.charactersLen - 2) <= v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignatureMethodType->Algorithm.charactersLen >= 2) { + v2gSignatureMethodType->Algorithm.charactersLen = (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignatureMethodType->Algorithm.charactersLen, v2gSignatureMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } } grammarID = 208; break; @@ -9697,131 +9573,159 @@ static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gCharging } break; case 208: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 208; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { - int grammarID = 209; - int done = 0; - - init_v2gEntryType(v2gEntryType); - - while(!done) { - switch(grammarID) { - case 209: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval); - v2gEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gEntryType->TimeInterval); - v2gEntryType->TimeInterval_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { - int grammarID = 210; - int done = 0; - - init_v2gCableCheckResType(v2gCableCheckResType); - - while(!done) { - switch(grammarID) { - case 210: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gCableCheckResType->ResponseCode = (v2gresponseCodeType) uint32; + errn = decodeInteger64(stream, &v2gSignatureMethodType->HMACOutputLength); + v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 211; + grammarID = 35; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 2: + done = 1; + grammarID = 1; + break; + case 3: + grammarID = 209; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 1: + done = 1; + grammarID = 1; + break; + case 2: + grammarID = 35; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 209: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gSignatureMethodType->HMACOutputLength); + v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 35; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 2: + done = 1; + grammarID = 1; + break; + case 3: + grammarID = 209; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { + int grammarID = 210; + int done = 0; + + init_v2gCertificateInstallationReqType(v2gCertificateInstallationReqType); + + while(!done) { + switch(grammarID) { + case 210: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->Id.charactersLen); + if (errn == 0) { + errn = (v2gCertificateInstallationReqType->Id.charactersLen - 2) <= v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCertificateInstallationReqType->Id.charactersLen >= 2) { + v2gCertificateInstallationReqType->Id.charactersLen = (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCertificateInstallationReqType->Id.charactersLen, v2gCertificateInstallationReqType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 211; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -9829,42 +9733,32 @@ static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheck } break; case 211: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus); - grammarID = 94; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gCableCheckResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; + errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 128; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9876,14 +9770,29 @@ static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheck } } break; - case 3: + case 128: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9902,42 +9811,59 @@ static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheck return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ -static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { int grammarID = 212; int done = 0; - init_v2gSupportedEnergyTransferModeType(v2gSupportedEnergyTransferModeType); + init_v2gCertificateChainType(v2gCertificateChainType); while(!done) { switch(grammarID) { case 212: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Id.charactersLen); + if (errn == 0) { + errn = (v2gCertificateChainType->Id.charactersLen - 2) <= v2gCertificateChainType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCertificateChainType->Id.charactersLen >= 2) { + v2gCertificateChainType->Id.charactersLen = (uint16_t)(v2gCertificateChainType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCertificateChainType->Id.charactersLen, v2gCertificateChainType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gCertificateChainType->Id_isUsed = 1u; + grammarID = 213; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); + if (errn == 0) { + errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 213; + grammarID = 214; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9950,29 +9876,29 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } break; case 213: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); + if (errn == 0) { + errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } + if (errn == 0) { + errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 214; @@ -9981,10 +9907,6 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 1: - done = 1; - grammarID = 4; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -9992,40 +9914,18 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } break; case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 215; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates); + v2gCertificateChainType->SubCertificates_isUsed = 1u; + grammarID = 5; break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10033,140 +9933,14 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 215: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 216; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 216: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 217; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 217: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10185,34 +9959,183 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { - int grammarID = 218; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { + int grammarID = 215; int done = 0; - init_v2gPhysicalValueType(v2gPhysicalValueType); + init_v2gSessionSetupResType(v2gSessionSetupResType); while(!done) { switch(grammarID) { - case 218: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier)] */ + case 215: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); - v2gPhysicalValueType->Multiplier = (int8_t)(uint32 -3); + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gSessionSetupResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 216; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 216: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSessionSetupResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gSessionSetupResType->EVSEID.charactersLen - 2) <= v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSessionSetupResType->EVSEID.charactersLen >= 2) { + v2gSessionSetupResType->EVSEID.charactersLen = (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSessionSetupResType->EVSEID.charactersLen, v2gSessionSetupResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 217; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gSessionSetupResType->EVSETimeStamp); + v2gSessionSetupResType->EVSETimeStamp_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { + int grammarID = 218; + int done = 0; + + init_v2gCostType(v2gCostType); + + while(!done) { + switch(grammarID) { + case 218: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gCostType->costKind = (v2gcostKindType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 219; @@ -10228,24 +10151,23 @@ static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalVa } break; case 219: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gPhysicalValueType->Unit = (v2gunitSymbolType) uint32; + errn = decodeUnsignedInteger32(stream, &v2gCostType->amount); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 220; @@ -10261,45 +10183,51 @@ static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalVa } break; case 220: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gPhysicalValueType->Value); + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + v2gCostType->amountMultiplier = (int8_t)(uint32 -3); + v2gCostType->amountMultiplier_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; + case 1: + done = 1; + grammarID = 1; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10318,34 +10246,52 @@ static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalVa return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { int grammarID = 221; int done = 0; - init_v2gChargeParameterDiscoveryResType(v2gChargeParameterDiscoveryResType); + init_v2gX509DataType(v2gX509DataType); while(!done) { switch(grammarID) { case 221: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gChargeParameterDiscoveryResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 222; + break; + case 1: + if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); + } + v2gX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 222; @@ -10354,6 +10300,113 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } } break; + case 2: + if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 222; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); + } + v2gX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 222; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); + } + v2gX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 222; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 222; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -10361,68 +10414,208 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } break; case 222: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gChargeParameterDiscoveryResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 222; + break; + case 1: + if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); + } + v2gX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 223; + grammarID = 222; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; + case 2: + if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 222; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); + } + v2gX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 222; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); + } + v2gX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 222; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 222; + break; + case 6: + done = 1; + grammarID = 1; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; } } break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { + int grammarID = 223; + int done = 0; + + init_v2gEMAIDType(v2gEMAIDType); + + while(!done) { + switch(grammarID) { case 223: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList); - v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; + errn = decodeUnsignedInteger16(stream, &v2gEMAIDType->Id.charactersLen); + if (errn == 0) { + errn = (v2gEMAIDType->Id.charactersLen - 2) <= v2gEMAIDType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gEMAIDType->Id.charactersLen >= 2) { + v2gEMAIDType->Id.charactersLen = (uint16_t)(v2gEMAIDType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gEMAIDType->Id.charactersLen, v2gEMAIDType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } grammarID = 224; break; - case 1: - errn = decode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules); - v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; - grammarID = 224; - break; - case 2: - errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 3: - errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 4: - errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -10430,24 +10623,25 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } break; case 224: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; - grammarID = 3; + errn = decodeUnsignedInteger16(stream, &v2gEMAIDType->CONTENT.charactersLen); + if (errn == 0) { + errn = (v2gEMAIDType->CONTENT.charactersLen - 2) <= v2gEMAIDType_CONTENT_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gEMAIDType->CONTENT.charactersLen >= 2) { + v2gEMAIDType->CONTENT.charactersLen = (uint16_t)(v2gEMAIDType->CONTENT.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gEMAIDType->CONTENT.charactersLen, v2gEMAIDType->CONTENT.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10455,202 +10649,14 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { - int grammarID = 225; - int done = 0; - - init_v2gParameterSetType(v2gParameterSetType); - - while(!done) { - switch(grammarID) { - case 225: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gParameterSetType->ParameterSetID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 226; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 226: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 227; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 227: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 227; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { - int grammarID = 228; - int done = 0; - - init_v2gPaymentDetailsReqType(v2gPaymentDetailsReqType); - - while(!done) { - switch(grammarID) { - case 228: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsReqType->eMAID.charactersLen); - if (errn == 0) { - errn = (v2gPaymentDetailsReqType->eMAID.charactersLen - 2) <= v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gPaymentDetailsReqType->eMAID.charactersLen >= 2) { - v2gPaymentDetailsReqType->eMAID.charactersLen = (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.charactersLen, v2gPaymentDetailsReqType->eMAID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 229; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10671,14 +10677,14 @@ static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymen /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType) { - int grammarID = 230; + int grammarID = 225; int done = 0; init_v2gMeterInfoType(v2gMeterInfoType); while(!done) { switch(grammarID) { - case 230: + case 225: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -10710,7 +10716,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 231; + grammarID = 226; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10722,7 +10728,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 231: + case 226: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -10743,7 +10749,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 232; + grammarID = 227; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10771,7 +10777,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 233; + grammarID = 228; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10793,7 +10799,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 234; + grammarID = 229; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10815,7 +10821,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10823,7 +10829,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 4: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10831,7 +10837,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 232: + case 227: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -10858,7 +10864,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 233; + grammarID = 228; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10880,7 +10886,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 234; + grammarID = 229; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10902,7 +10908,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10910,7 +10916,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 3: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10918,7 +10924,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 233: + case 228: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -10939,7 +10945,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 234; + grammarID = 229; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10961,7 +10967,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10969,7 +10975,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 2: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10977,7 +10983,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 234: + case 229: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -10998,7 +11004,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11006,7 +11012,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11014,14 +11020,14 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11040,17 +11046,17 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { - int grammarID = 235; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { + int grammarID = 230; int done = 0; - init_v2gPaymentServiceSelectionReqType(v2gPaymentServiceSelectionReqType); + init_v2gAuthorizationResType(v2gAuthorizationResType); while(!done) { switch(grammarID) { - case 235: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ + case 230: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -11059,15 +11065,271 @@ static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - v2gPaymentServiceSelectionReqType->SelectedPaymentOption = (v2gpaymentOptionType) uint32; + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gAuthorizationResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 231; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gAuthorizationResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { + int grammarID = 232; + int done = 0; + + init_v2gEntryType(v2gEntryType); + + while(!done) { + switch(grammarID) { + case 232: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval); + v2gEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 5; + break; + case 1: + errn = decode_v2gIntervalType(stream, &v2gEntryType->TimeInterval); + v2gEntryType->TimeInterval_isUsed = 1u; + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType) { + int grammarID = 233; + int done = 0; + + init_v2gServiceType(v2gServiceType); + + while(!done) { + switch(grammarID) { + case 233: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gServiceType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 234; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 234: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gServiceType->ServiceName.charactersLen); + if (errn == 0) { + errn = (v2gServiceType->ServiceName.charactersLen - 2) <= v2gServiceType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gServiceType->ServiceName.charactersLen >= 2) { + v2gServiceType->ServiceName.charactersLen = (uint16_t)(v2gServiceType->ServiceName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gServiceType->ServiceName.charactersLen, v2gServiceType->ServiceName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gServiceType->ServiceName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 235; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 236; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 235: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 236; @@ -11083,228 +11345,60 @@ static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct } break; case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { - int grammarID = 237; - int done = 0; - - init_v2gRetrievalMethodType(v2gRetrievalMethodType); - - while(!done) { - switch(grammarID) { - case 237: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->Type.charactersLen); - if (errn == 0) { - errn = (v2gRetrievalMethodType->Type.charactersLen - 2) <= v2gRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gRetrievalMethodType->Type.charactersLen >= 2) { - v2gRetrievalMethodType->Type.charactersLen = (uint16_t)(v2gRetrievalMethodType->Type.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gRetrievalMethodType->Type.charactersLen, v2gRetrievalMethodType->Type.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gRetrievalMethodType->Type_isUsed = 1u; - grammarID = 238; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); - if (errn == 0) { - errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gRetrievalMethodType->URI.charactersLen >= 2) { - v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gRetrievalMethodType->URI_isUsed = 1u; - grammarID = 239; - break; - case 2: - errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); - v2gRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 238: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); - if (errn == 0) { - errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gRetrievalMethodType->URI.charactersLen >= 2) { - v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gRetrievalMethodType->URI_isUsed = 1u; - grammarID = 239; - break; - case 1: - errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); - v2gRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 239: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); - v2gRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { - int grammarID = 240; - int done = 0; - - init_v2gSessionSetupReqType(v2gSessionSetupReqType); - - while(!done) { - switch(grammarID) { - case 240: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + /* FirstStartTag[CHARACTERS[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSessionSetupReqType->EVCCID.bytesLen); + errn = decodeUnsignedInteger16(stream, &v2gServiceType->ServiceScope.charactersLen); if (errn == 0) { - errn = (v2gSessionSetupReqType->EVCCID.bytesLen) <= v2gSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + errn = (v2gServiceType->ServiceScope.charactersLen - 2) <= v2gServiceType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - errn = decodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytesLen, v2gSessionSetupReqType->EVCCID.bytes); + if (v2gServiceType->ServiceScope.charactersLen >= 2) { + v2gServiceType->ServiceScope.charactersLen = (uint16_t)(v2gServiceType->ServiceScope.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gServiceType->ServiceScope.charactersLen, v2gServiceType->ServiceScope.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } } + v2gServiceType->ServiceScope_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 237; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11316,14 +11410,46 @@ static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionS } } break; - case 3: + case 237: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11342,34 +11468,140 @@ static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionS return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { - int grammarID = 241; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { + int grammarID = 238; int done = 0; - init_v2gDC_EVChargeParameterType(v2gDC_EVChargeParameterType); + init_v2gSelectedServiceListType(v2gSelectedServiceListType); while(!done) { switch(grammarID) { - case 241: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + case 238: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 239; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 239: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + if (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 239; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ +static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType) { + int grammarID = 240; + int done = 0; + + init_v2gChargeServiceType(v2gChargeServiceType); + + while(!done) { + switch(grammarID) { + case 240: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gDC_EVChargeParameterType->DepartureTime); - v2gDC_EVChargeParameterType->DepartureTime_isUsed = 1u; + errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceID); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 241; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 241: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceName.charactersLen); + if (errn == 0) { + errn = (v2gChargeServiceType->ServiceName.charactersLen - 2) <= v2gChargeServiceType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gChargeServiceType->ServiceName.charactersLen >= 2) { + v2gChargeServiceType->ServiceName.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gChargeServiceType->ServiceName.charactersLen, v2gChargeServiceType->ServiceName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gChargeServiceType->ServiceName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 242; @@ -11379,8 +11611,26 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } break; case 1: - errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); - grammarID = 243; + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gChargeServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 243; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11389,13 +11639,31 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } break; case 242: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); - grammarID = 243; + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gChargeServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 243; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11404,13 +11672,64 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } break; case 243: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit); - grammarID = 244; + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceScope.charactersLen); + if (errn == 0) { + errn = (v2gChargeServiceType->ServiceScope.charactersLen - 2) <= v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gChargeServiceType->ServiceScope.charactersLen >= 2) { + v2gChargeServiceType->ServiceScope.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gChargeServiceType->ServiceScope.charactersLen, v2gChargeServiceType->ServiceScope.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gChargeServiceType->ServiceScope_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 244; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 245; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11419,18 +11738,30 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } break; case 244: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit); - v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 245; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 246; + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 245; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11439,13 +11770,13 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } break; case 245: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 246; + errn = decode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode); + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11453,70 +11784,67 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } } break; - case 246: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity); - v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; - grammarID = 247; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); - v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 248; - break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 249; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: done = 1; - grammarID = 4; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { + int grammarID = 246; + int done = 0; + + init_v2gServiceDetailResType(v2gServiceDetailResType); + + while(!done) { + switch(grammarID) { + case 246: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gServiceDetailResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 247; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11525,65 +11853,31 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } break; case 247: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); - v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 248; - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; + errn = decodeUnsignedInteger16(stream, &v2gServiceDetailResType->ServiceID); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 249; + grammarID = 248; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - done = 1; - grammarID = 4; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -11591,59 +11885,18 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } break; case 248: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 249; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList); + v2gServiceDetailResType->ServiceParameterList_isUsed = 1u; + grammarID = 5; break; case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11651,52 +11904,14 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ } } break; - case 249: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11715,24 +11930,139 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDef":Header,"urn:iso:15118:2:2013:MsgDef":Body)', derivedBy='RESTRICTION'. */ -static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { - int grammarID = 250; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { + int grammarID = 249; int done = 0; - init_v2gAnonType_V2G_Message(v2gAnonType_V2G_Message); + init_v2gSignatureValueType(v2gSignatureValueType); while(!done) { switch(grammarID) { - case 250: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ + case 249: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignatureValueType->Id.charactersLen - 2) <= v2gSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignatureValueType->Id.charactersLen >= 2) { + v2gSignatureValueType->Id.charactersLen = (uint16_t)(v2gSignatureValueType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignatureValueType->Id.charactersLen, v2gSignatureValueType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignatureValueType->Id_isUsed = 1u; + grammarID = 58; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); + } + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 58: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header); + errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); + } + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { + int grammarID = 250; + int done = 0; + + init_v2gSignaturePropertiesType(v2gSignaturePropertiesType); + + while(!done) { + switch(grammarID) { + case 250: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertiesType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertiesType->Id.charactersLen - 2) <= v2gSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertiesType->Id.charactersLen >= 2) { + v2gSignaturePropertiesType->Id.charactersLen = (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertiesType->Id.charactersLen, v2gSignaturePropertiesType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignaturePropertiesType->Id_isUsed = 1u; grammarID = 251; break; + case 1: + if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 252; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -11740,13 +12070,17 @@ static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonTyp } break; case 251: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body); - grammarID = 3; + if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 252; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11754,49 +12088,22 @@ static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonTyp } } break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { - int grammarID = 252; - int done = 0; - - init_v2gDC_EVPowerDeliveryParameterType(v2gDC_EVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { case 252: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus); - grammarID = 253; + if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 252; + break; + case 1: + done = 1; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11804,727 +12111,61 @@ static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct } } break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { + int grammarID = 253; + int done = 0; + + init_v2gAuthorizationReqType(v2gAuthorizationReqType); + + while(!done) { + switch(grammarID) { case 253: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); - v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; + errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->Id.charactersLen); + if (errn == 0) { + errn = (v2gAuthorizationReqType->Id.charactersLen - 2) <= v2gAuthorizationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gAuthorizationReqType->Id.charactersLen >= 2) { + v2gAuthorizationReqType->Id.charactersLen = (uint16_t)(v2gAuthorizationReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gAuthorizationReqType->Id.charactersLen, v2gAuthorizationReqType->Id.characters); } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 254; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } + v2gAuthorizationReqType->Id_isUsed = 1u; + grammarID = 254; break; case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 254: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { - int grammarID = 255; - int done = 0; - - init_v2gRelativeTimeIntervalType(v2gRelativeTimeIntervalType); - - while(!done) { - switch(grammarID) { - case 255: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->start); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 256; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 256: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->duration); - v2gRelativeTimeIntervalType->duration_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType) { - int grammarID = 257; - int done = 0; - - init_v2gRSAKeyValueType(v2gRSAKeyValueType); - - while(!done) { - switch(grammarID) { - case 257: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Modulus.bytesLen); + errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->GenChallenge.bytesLen); if (errn == 0) { - errn = (v2gRSAKeyValueType->Modulus.bytesLen) <= v2gRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } if (errn == 0) { - errn = decodeBytes(stream, v2gRSAKeyValueType->Modulus.bytesLen, v2gRSAKeyValueType->Modulus.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 258; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 258: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Exponent.bytesLen); - if (errn == 0) { - errn = (v2gRSAKeyValueType->Exponent.bytesLen) <= v2gRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gRSAKeyValueType->Exponent.bytesLen, v2gRSAKeyValueType->Exponent.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { - int grammarID = 259; - int done = 0; - - init_v2gPGPDataType(v2gPGPDataType); - - while(!done) { - switch(grammarID) { - case 259: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyID.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyID.bytesLen) <= v2gPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyID.bytesLen, v2gPGPDataType->PGPKeyID.bytes); - } - v2gPGPDataType->PGPKeyID_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 260; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); - } - v2gPGPDataType->PGPKeyPacket_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 261; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 260: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); - } - v2gPGPDataType->PGPKeyPacket_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 261; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 261; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 261: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 261; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - int grammarID = 262; - int done = 0; - - init_v2gCertificateUpdateResType(v2gCertificateUpdateResType); - - while(!done) { - switch(grammarID) { - case 262: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gCertificateUpdateResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 263; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 263: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain); - grammarID = 264; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 264: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain); - grammarID = 265; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 265: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey); - grammarID = 266; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 266: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey); - grammarID = 267; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 267: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID); - grammarID = 268; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 268: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gCertificateUpdateResType->RetryCounter); - v2gCertificateUpdateResType->RetryCounter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ -static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { - int grammarID = 269; - int done = 0; - - init_v2gPaymentDetailsResType(v2gPaymentDetailsResType); - - while(!done) { - switch(grammarID) { - case 269: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gPaymentDetailsResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 270; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 270: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsResType->GenChallenge.bytesLen); - if (errn == 0) { - errn = (v2gPaymentDetailsResType->GenChallenge.bytesLen) <= v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytesLen, v2gPaymentDetailsResType->GenChallenge.bytes); + errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); } + v2gAuthorizationReqType->GenChallenge_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -12534,378 +12175,7 @@ static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 271; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 271: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gPaymentDetailsResType->EVSETimeStamp); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { - int grammarID = 272; - int done = 0; - - init_v2gDSAKeyValueType(v2gDSAKeyValueType); - - while(!done) { - switch(grammarID) { - case 272: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->P.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->P.bytesLen) <= v2gDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->P.bytesLen, v2gDSAKeyValueType->P.bytes); - } - v2gDSAKeyValueType->P_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 273; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); - } - v2gDSAKeyValueType->G_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 274; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 275; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 273: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Q.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Q.bytesLen) <= v2gDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Q.bytesLen, v2gDSAKeyValueType->Q.bytes); - } - v2gDSAKeyValueType->Q_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 276; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 276: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); - } - v2gDSAKeyValueType->G_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 274; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 275; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 274: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 275; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 275: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->J.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->J.bytesLen) <= v2gDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->J.bytesLen, v2gDSAKeyValueType->J.bytes); - } - v2gDSAKeyValueType->J_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 277; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Seed.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); - } - v2gDSAKeyValueType->Seed_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 278; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12913,7 +12183,7 @@ static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueT break; case 2: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12921,8 +12191,8 @@ static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueT } } break; - case 277: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + case 254: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { @@ -12931,24 +12201,24 @@ static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueT errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Seed.bytesLen); + errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->GenChallenge.bytesLen); if (errn == 0) { - errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); + errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); } - v2gDSAKeyValueType->Seed_isUsed = 1u; + v2gAuthorizationReqType->GenChallenge_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 278; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12956,7 +12226,7 @@ static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueT break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12964,455 +12234,14 @@ static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueT } } break; - case 278: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->PgenCounter.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->PgenCounter.bytesLen) <= v2gDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytesLen, v2gDSAKeyValueType->PgenCounter.bytes); - } - v2gDSAKeyValueType->PgenCounter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { - int grammarID = 279; - int done = 0; - - init_v2gBodyType(v2gBodyType); - - while(!done) { - switch(grammarID) { - case 279: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq); - v2gBodyType->AuthorizationReq_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes); - v2gBodyType->AuthorizationRes_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement); - v2gBodyType->BodyElement_isUsed = 1u; - grammarID = 3; - break; - case 3: - errn = decode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq); - v2gBodyType->CableCheckReq_isUsed = 1u; - grammarID = 3; - break; - case 4: - errn = decode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes); - v2gBodyType->CableCheckRes_isUsed = 1u; - grammarID = 3; - break; - case 5: - errn = decode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq); - v2gBodyType->CertificateInstallationReq_isUsed = 1u; - grammarID = 3; - break; - case 6: - errn = decode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes); - v2gBodyType->CertificateInstallationRes_isUsed = 1u; - grammarID = 3; - break; - case 7: - errn = decode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq); - v2gBodyType->CertificateUpdateReq_isUsed = 1u; - grammarID = 3; - break; - case 8: - errn = decode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes); - v2gBodyType->CertificateUpdateRes_isUsed = 1u; - grammarID = 3; - break; - case 9: - errn = decode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq); - v2gBodyType->ChargeParameterDiscoveryReq_isUsed = 1u; - grammarID = 3; - break; - case 10: - errn = decode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes); - v2gBodyType->ChargeParameterDiscoveryRes_isUsed = 1u; - grammarID = 3; - break; - case 11: - errn = decode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq); - v2gBodyType->ChargingStatusReq_isUsed = 1u; - grammarID = 3; - break; - case 12: - errn = decode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes); - v2gBodyType->ChargingStatusRes_isUsed = 1u; - grammarID = 3; - break; - case 13: - errn = decode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq); - v2gBodyType->CurrentDemandReq_isUsed = 1u; - grammarID = 3; - break; - case 14: - errn = decode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes); - v2gBodyType->CurrentDemandRes_isUsed = 1u; - grammarID = 3; - break; - case 15: - errn = decode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq); - v2gBodyType->MeteringReceiptReq_isUsed = 1u; - grammarID = 3; - break; - case 16: - errn = decode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes); - v2gBodyType->MeteringReceiptRes_isUsed = 1u; - grammarID = 3; - break; - case 17: - errn = decode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq); - v2gBodyType->PaymentDetailsReq_isUsed = 1u; - grammarID = 3; - break; - case 18: - errn = decode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes); - v2gBodyType->PaymentDetailsRes_isUsed = 1u; - grammarID = 3; - break; - case 19: - errn = decode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq); - v2gBodyType->PaymentServiceSelectionReq_isUsed = 1u; - grammarID = 3; - break; - case 20: - errn = decode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes); - v2gBodyType->PaymentServiceSelectionRes_isUsed = 1u; - grammarID = 3; - break; - case 21: - errn = decode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq); - v2gBodyType->PowerDeliveryReq_isUsed = 1u; - grammarID = 3; - break; - case 22: - errn = decode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes); - v2gBodyType->PowerDeliveryRes_isUsed = 1u; - grammarID = 3; - break; - case 23: - errn = decode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq); - v2gBodyType->PreChargeReq_isUsed = 1u; - grammarID = 3; - break; - case 24: - errn = decode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes); - v2gBodyType->PreChargeRes_isUsed = 1u; - grammarID = 3; - break; - case 25: - errn = decode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq); - v2gBodyType->ServiceDetailReq_isUsed = 1u; - grammarID = 3; - break; - case 26: - errn = decode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes); - v2gBodyType->ServiceDetailRes_isUsed = 1u; - grammarID = 3; - break; - case 27: - errn = decode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq); - v2gBodyType->ServiceDiscoveryReq_isUsed = 1u; - grammarID = 3; - break; - case 28: - errn = decode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes); - v2gBodyType->ServiceDiscoveryRes_isUsed = 1u; - grammarID = 3; - break; - case 29: - errn = decode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq); - v2gBodyType->SessionSetupReq_isUsed = 1u; - grammarID = 3; - break; - case 30: - errn = decode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes); - v2gBodyType->SessionSetupRes_isUsed = 1u; - grammarID = 3; - break; - case 31: - errn = decode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq); - v2gBodyType->SessionStopReq_isUsed = 1u; - grammarID = 3; - break; - case 32: - errn = decode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes); - v2gBodyType->SessionStopRes_isUsed = 1u; - grammarID = 3; - break; - case 33: - errn = decode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq); - v2gBodyType->WeldingDetectionReq_isUsed = 1u; - grammarID = 3; - break; - case 34: - errn = decode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes); - v2gBodyType->WeldingDetectionRes_isUsed = 1u; - grammarID = 3; - break; - case 35: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { - int grammarID = 280; - int done = 0; - - init_v2gCertificateInstallationReqType(v2gCertificateInstallationReqType); - - while(!done) { - switch(grammarID) { - case 280: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->Id.charactersLen); - if (errn == 0) { - errn = (v2gCertificateInstallationReqType->Id.charactersLen - 2) <= v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCertificateInstallationReqType->Id.charactersLen >= 2) { - v2gCertificateInstallationReqType->Id.charactersLen = (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCertificateInstallationReqType->Id.charactersLen, v2gCertificateInstallationReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 281; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 281: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - if (errn == 0) { - errn = (v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 100; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 100: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { - int grammarID = 282; - int done = 0; - - init_v2gServiceParameterListType(v2gServiceParameterListType); - - while(!done) { - switch(grammarID) { - case 282: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 283; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 283: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 283; - break; - case 1: - done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13433,21 +12262,201 @@ static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gSer /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ static int decode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType) { - int grammarID = 38; + int grammarID = 0; int done = 0; init_v2gEVStatusType(v2gEVStatusType); while(!done) { switch(grammarID) { - case 38: + case 0: /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { + int grammarID = 255; + int done = 0; + + init_v2gDC_EVSEChargeParameterType(v2gDC_EVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 255: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus); + grammarID = 256; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 256: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); + grammarID = 257; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 257: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); + grammarID = 258; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 258: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); + grammarID = 259; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 259: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); + grammarID = 260; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 260: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); + grammarID = 261; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 261: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); + v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; + grammarID = 262; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 263; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 262: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 263; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 263: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); + v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13468,14 +12477,14 @@ static int decode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType) { - int grammarID = 284; + int grammarID = 264; int done = 0; init_v2gSAScheduleListType(v2gSAScheduleListType); while(!done) { switch(grammarID) { - case 284: + case 264: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13486,7 +12495,7 @@ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSASchedul } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 285; + grammarID = 265; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13494,7 +12503,7 @@ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSASchedul } } break; - case 285: + case 265: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -13505,11 +12514,11 @@ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSASchedul } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 286; + grammarID = 266; break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13517,7 +12526,7 @@ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSASchedul } } break; - case 286: + case 266: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -13528,11 +12537,11 @@ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSASchedul } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 3; + grammarID = 5; break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13540,14 +12549,14 @@ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSASchedul } } break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13568,14 +12577,14 @@ static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSASchedul /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType) { - int grammarID = 67; + int grammarID = 267; int done = 0; init_v2gDigestMethodType(v2gDigestMethodType); while(!done) { switch(grammarID) { - case 67: + case 267: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13594,7 +12603,7 @@ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMetho errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 68; + grammarID = 47; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13602,7 +12611,7 @@ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMetho } } break; - case 68: + case 47: /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -13610,14 +12619,14 @@ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMetho case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; + grammarID = 35; break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; case 2: - grammarID = 24; + grammarID = 35; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13625,7 +12634,7 @@ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMetho } } break; - case 24: + case 35: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -13633,14 +12642,14 @@ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMetho case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 24; + grammarID = 35; break; case 1: done = 1; - grammarID = 4; + grammarID = 1; break; case 2: - grammarID = 24; + grammarID = 35; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13659,209 +12668,37 @@ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMetho return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { - int grammarID = 287; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { + int grammarID = 268; int done = 0; - init_v2gCostType(v2gCostType); + init_v2gKeyValueType(v2gKeyValueType); while(!done) { switch(grammarID) { - case 287: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 268: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gCostType->costKind = (v2gcostKindType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 288; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 288: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gCostType->amount); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 289; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 289: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); - v2gCostType->amountMultiplier = (int8_t)(uint32 -3); - v2gCostType->amountMultiplier_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); + v2gKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 269; break; case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { - int grammarID = 290; - int done = 0; - - init_v2gMessageHeaderType(v2gMessageHeaderType); - - while(!done) { - switch(grammarID) { - case 290: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gMessageHeaderType->SessionID.bytesLen); - if (errn == 0) { - errn = (v2gMessageHeaderType->SessionID.bytesLen) <= v2gMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gMessageHeaderType->SessionID.bytesLen, v2gMessageHeaderType->SessionID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 291; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 291: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification); - v2gMessageHeaderType->Notification_isUsed = 1u; - grammarID = 292; - break; - case 1: - errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); - v2gMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; + errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); + v2gKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 269; break; case 2: - done = 1; - grammarID = 4; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 269; + break; + case 3: + grammarID = 270; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13869,19 +12706,17 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea } } break; - case 292: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + case 269: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); - v2gMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; + done = 1; + grammarID = 1; break; case 1: - done = 1; - grammarID = 4; + grammarID = 269; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13889,642 +12724,28 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea } } break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 270: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { - int grammarID = 293; - int done = 0; - - init_v2gServiceDetailReqType(v2gServiceDetailReqType); - - while(!done) { - switch(grammarID) { - case 293: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceDetailReqType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType) { - int grammarID = 294; - int done = 0; - - init_v2gTransformsType(v2gTransformsType); - - while(!done) { - switch(grammarID) { - case 294: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { - errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 295; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 295: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { - errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 295; + errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); + v2gKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 269; break; case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { - int grammarID = 296; - int done = 0; - - init_v2gWeldingDetectionResType(v2gWeldingDetectionResType); - - while(!done) { - switch(grammarID) { - case 296: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gWeldingDetectionResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 297; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 297: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus); - grammarID = 298; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 298: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { - int grammarID = 296; - int done = 0; - - init_v2gPreChargeResType(v2gPreChargeResType); - - while(!done) { - switch(grammarID) { - case 296: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gPreChargeResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 297; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 297: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus); - grammarID = 298; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 298: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ -static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { - int grammarID = 299; - int done = 0; - - init_v2gAC_EVChargeParameterType(v2gAC_EVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 299: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gAC_EVChargeParameterType->DepartureTime); - v2gAC_EVChargeParameterType->DepartureTime_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 300; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); - grammarID = 301; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 300: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); - grammarID = 301; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 301: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage); - grammarID = 302; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 302: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxCurrent); - grammarID = 303; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 303: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMinCurrent); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ -static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { - int grammarID = 304; - int done = 0; - - init_v2gSalesTariffEntryType(v2gSalesTariffEntryType); - - while(!done) { - switch(grammarID) { - case 304: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval); - v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 305; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval); - v2gSalesTariffEntryType->TimeInterval_isUsed = 1u; - grammarID = 305; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 305: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); - v2gSalesTariffEntryType->EPriceLevel_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 306; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 307; + errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); + v2gKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 269; break; case 2: - done = 1; - grammarID = 4; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 269; break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 306: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 307; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 307: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 308; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 308: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + case 3: + grammarID = 270; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14543,357 +12764,23 @@ static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTa return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { - int grammarID = 309; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { + int grammarID = 0; int done = 0; - init_v2gPMaxScheduleEntryType(v2gPMaxScheduleEntryType); + init_v2gEVPowerDeliveryParameterType(v2gEVPowerDeliveryParameterType); while(!done) { switch(grammarID) { - case 309: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval); - v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 310; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval); - v2gPMaxScheduleEntryType->TimeInterval_isUsed = 1u; - grammarID = 310; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 310: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { - int grammarID = 38; - int done = 0; - - init_v2gBodyBaseType(v2gBodyBaseType); - - while(!done) { - switch(grammarID) { - case 38: + case 0: /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { - int grammarID = 311; - int done = 0; - - init_v2gSalesTariffType(v2gSalesTariffType); - - while(!done) { - switch(grammarID) { - case 311: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSalesTariffType->Id.charactersLen - 2) <= v2gSalesTariffType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSalesTariffType->Id.charactersLen >= 2) { - v2gSalesTariffType->Id.charactersLen = (uint16_t)(v2gSalesTariffType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSalesTariffType->Id.charactersLen, v2gSalesTariffType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSalesTariffType->Id_isUsed = 1u; - grammarID = 312; - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 313; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 312: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 313; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 313: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->SalesTariffDescription.charactersLen); - if (errn == 0) { - errn = (v2gSalesTariffType->SalesTariffDescription.charactersLen - 2) <= v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSalesTariffType->SalesTariffDescription.charactersLen >= 2) { - v2gSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.charactersLen, v2gSalesTariffType->SalesTariffDescription.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSalesTariffType->SalesTariffDescription_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 314; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 315; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 316; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 314: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 315; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 316; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 315: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 316; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 316: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 316; - break; - case 1: - done = 1; - grammarID = 4; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14914,14 +12801,14 @@ static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffT /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType) { - int grammarID = 317; + int grammarID = 271; int done = 0; init_v2gTransformType(v2gTransformType); while(!done) { switch(grammarID) { - case 317: + case 271: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -14940,7 +12827,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 318; + grammarID = 272; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14948,7 +12835,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* } } break; - case 318: + case 272: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -14985,7 +12872,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 319; + grammarID = 273; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14994,14 +12881,14 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 319; + grammarID = 273; break; case 2: done = 1; - grammarID = 4; + grammarID = 1; break; case 3: - grammarID = 319; + grammarID = 273; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15009,7 +12896,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* } } break; - case 319: + case 273: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -15046,7 +12933,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 319; + grammarID = 273; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -15055,14 +12942,14 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 319; + grammarID = 273; break; case 2: done = 1; - grammarID = 4; + grammarID = 1; break; case 3: - grammarID = 319; + grammarID = 273; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15081,35 +12968,76 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { - int grammarID = 5; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { + int grammarID = 0; int done = 0; - init_v2gDiffieHellmanPublickeyType(v2gDiffieHellmanPublickeyType); + init_v2gBodyBaseType(v2gBodyBaseType); while(!done) { switch(grammarID) { - case 5: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + case 0: + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->Id.charactersLen); - if (errn == 0) { - errn = (v2gDiffieHellmanPublickeyType->Id.charactersLen - 2) <= v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gDiffieHellmanPublickeyType->Id.charactersLen >= 2) { - v2gDiffieHellmanPublickeyType->Id.charactersLen = (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.charactersLen, v2gDiffieHellmanPublickeyType->Id.characters); + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { + int grammarID = 54; + int done = 0; + + init_v2gSessionStopResType(v2gSessionStopResType); + + while(!done) { + switch(grammarID) { + case 54: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gSessionStopResType->ResponseCode = (v2gresponseCodeType) uint32; } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15117,35 +13045,2107 @@ static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD } } break; - case 6: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gDiffieHellmanPublickeyType->CONTENT.bytesLen) <= v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen, v2gDiffieHellmanPublickeyType->CONTENT.bytes); - } - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { + int grammarID = 274; + int done = 0; + + init_v2gParameterType(v2gParameterType); + + while(!done) { + switch(grammarID) { + case 274: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gParameterType->Name.charactersLen); + if (errn == 0) { + errn = (v2gParameterType->Name.charactersLen - 2) <= v2gParameterType_Name_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gParameterType->Name.charactersLen >= 2) { + v2gParameterType->Name.charactersLen = (uint16_t)(v2gParameterType->Name.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gParameterType->Name.charactersLen, v2gParameterType->Name.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 275; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 275: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gParameterType->boolValue); + v2gParameterType->boolValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gParameterType->byteValue = (int8_t)(uint32 -128); + v2gParameterType->byteValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &v2gParameterType->shortValue); + v2gParameterType->shortValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger32(stream, &v2gParameterType->intValue); + v2gParameterType->intValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + errn = decode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue); + v2gParameterType->physicalValue_isUsed = 1u; + grammarID = 5; + break; + case 5: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gParameterType->stringValue.charactersLen); + if (errn == 0) { + errn = (v2gParameterType->stringValue.charactersLen - 2) <= v2gParameterType_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gParameterType->stringValue.charactersLen >= 2) { + v2gParameterType->stringValue.charactersLen = (uint16_t)(v2gParameterType->stringValue.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gParameterType->stringValue.charactersLen, v2gParameterType->stringValue.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gParameterType->stringValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ +static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { + int grammarID = 276; + int done = 0; + + init_v2gServiceListType(v2gServiceListType); + + while(!done) { + switch(grammarID) { + case 276: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 277; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 277: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 278; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 278: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 279; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 279: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 280; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 280: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 281; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 281: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 282; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 282: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 283; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 283: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { + int grammarID = 284; + int done = 0; + + init_v2gRetrievalMethodType(v2gRetrievalMethodType); + + while(!done) { + switch(grammarID) { + case 284: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->Type.charactersLen); + if (errn == 0) { + errn = (v2gRetrievalMethodType->Type.charactersLen - 2) <= v2gRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gRetrievalMethodType->Type.charactersLen >= 2) { + v2gRetrievalMethodType->Type.charactersLen = (uint16_t)(v2gRetrievalMethodType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gRetrievalMethodType->Type.charactersLen, v2gRetrievalMethodType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gRetrievalMethodType->Type_isUsed = 1u; + grammarID = 285; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gRetrievalMethodType->URI.charactersLen >= 2) { + v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gRetrievalMethodType->URI_isUsed = 1u; + grammarID = 286; + break; + case 2: + errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); + v2gRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 5; + break; + case 3: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 285: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gRetrievalMethodType->URI.charactersLen >= 2) { + v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gRetrievalMethodType->URI_isUsed = 1u; + grammarID = 286; + break; + case 1: + errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); + v2gRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 5; + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 286: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); + v2gRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { + int grammarID = 287; + int done = 0; + + init_v2gEVChargeParameterType(v2gEVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 287: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gEVChargeParameterType->DepartureTime); + v2gEVChargeParameterType->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { + int grammarID = 267; + int done = 0; + + init_v2gCanonicalizationMethodType(v2gCanonicalizationMethodType); + + while(!done) { + switch(grammarID) { + case 267: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gCanonicalizationMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (v2gCanonicalizationMethodType->Algorithm.charactersLen - 2) <= v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCanonicalizationMethodType->Algorithm.charactersLen >= 2) { + v2gCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.charactersLen, v2gCanonicalizationMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 47; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 47: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 1: + done = 1; + grammarID = 1; + break; + case 2: + grammarID = 35; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 35; + break; + case 1: + done = 1; + grammarID = 1; + break; + case 2: + grammarID = 35; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { + int grammarID = 0; + int done = 0; + + init_v2gIntervalType(v2gIntervalType); + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { + int grammarID = 288; + int done = 0; + + init_v2gPreChargeReqType(v2gPreChargeReqType); + + while(!done) { + switch(grammarID) { + case 288: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus); + grammarID = 289; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 289: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage); + grammarID = 290; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 290: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent); + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { + int grammarID = 291; + int done = 0; + + init_v2gDC_EVSEStatusType(v2gDC_EVSEStatusType); + + while(!done) { + switch(grammarID) { + case 291: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDC_EVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 292; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 292: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gDC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 293; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 293: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gDC_EVSEStatusType->EVSEIsolationStatus = (v2gisolationLevelType) uint32; + v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 294; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 294: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { + int grammarID = 295; + int done = 0; + + init_v2gSignatureType(v2gSignatureType); + + while(!done) { + switch(grammarID) { + case 295: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignatureType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignatureType->Id.charactersLen - 2) <= v2gSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignatureType->Id.charactersLen >= 2) { + v2gSignatureType->Id.charactersLen = (uint16_t)(v2gSignatureType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignatureType->Id.charactersLen, v2gSignatureType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignatureType->Id_isUsed = 1u; + grammarID = 296; + break; + case 1: + errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); + grammarID = 297; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 296: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); + grammarID = 297; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 297: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue); + grammarID = 298; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 298: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo); + v2gSignatureType->KeyInfo_isUsed = 1u; + grammarID = 299; + break; + case 1: + if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { + errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 299; + break; + case 2: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 299: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { + errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 299; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { + int grammarID = 300; + int done = 0; + + init_v2gCableCheckResType(v2gCableCheckResType); + + while(!done) { + switch(grammarID) { + case 300: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gCableCheckResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 301; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 301: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus); + grammarID = 231; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gCableCheckResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ +static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { + int grammarID = 302; + int done = 0; + + init_v2gPaymentDetailsResType(v2gPaymentDetailsResType); + + while(!done) { + switch(grammarID) { + case 302: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gPaymentDetailsResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 303; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 303: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsResType->GenChallenge.bytesLen); + if (errn == 0) { + errn = (v2gPaymentDetailsResType->GenChallenge.bytesLen) <= v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytesLen, v2gPaymentDetailsResType->GenChallenge.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 304; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 304: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gPaymentDetailsResType->EVSETimeStamp); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { + int grammarID = 0; + int done = 0; + + init_v2gChargingStatusReqType(v2gChargingStatusReqType); + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { + int grammarID = 305; + int done = 0; + + init_v2gPMaxScheduleType(v2gPMaxScheduleType); + + while(!done) { + switch(grammarID) { + case 305: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { + errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 306; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 306: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { + errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 306; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { + int grammarID = 307; + int done = 0; + + init_v2gChargeParameterDiscoveryResType(v2gChargeParameterDiscoveryResType); + + while(!done) { + switch(grammarID) { + case 307: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gChargeParameterDiscoveryResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 308; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 308: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gChargeParameterDiscoveryResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 309; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 309: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList); + v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; + grammarID = 310; + break; + case 1: + errn = decode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules); + v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; + grammarID = 310; + break; + case 2: + errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; + grammarID = 5; + break; + case 3: + errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; + grammarID = 5; + break; + case 4: + errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 310: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; + grammarID = 5; + break; + case 1: + errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; + grammarID = 5; + break; + case 2: + errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { + int grammarID = 311; + int done = 0; + + init_v2gPowerDeliveryResType(v2gPowerDeliveryResType); + + while(!done) { + switch(grammarID) { + case 311: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gPowerDeliveryResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 312; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 312: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus); + v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; + grammarID = 5; + break; + case 1: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus); + v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; + grammarID = 5; + break; + case 2: + errn = decode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus); + v2gPowerDeliveryResType->EVSEStatus_isUsed = 1u; + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { + int grammarID = 313; + int done = 0; + + init_v2gSAScheduleTupleType(v2gSAScheduleTupleType); + + while(!done) { + switch(grammarID) { + case 313: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSAScheduleTupleType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 314; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 314: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule); + grammarID = 315; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 315: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff); + v2gSAScheduleTupleType->SalesTariff_isUsed = 1u; + grammarID = 5; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { + int grammarID = 316; + int done = 0; + + init_v2gSignedInfoType(v2gSignedInfoType); + + while(!done) { + switch(grammarID) { + case 316: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignedInfoType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignedInfoType->Id.charactersLen - 2) <= v2gSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignedInfoType->Id.charactersLen >= 2) { + v2gSignedInfoType->Id.charactersLen = (uint16_t)(v2gSignedInfoType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignedInfoType->Id.charactersLen, v2gSignedInfoType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignedInfoType->Id_isUsed = 1u; + grammarID = 317; + break; + case 1: + errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); + grammarID = 318; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 317: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); + grammarID = 318; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 318: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod); + grammarID = 319; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 319: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 50; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 50: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 50; + break; + case 1: + done = 1; + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { + int grammarID = 311; + int done = 0; + + init_v2gMeteringReceiptResType(v2gMeteringReceiptResType); + + while(!done) { + switch(grammarID) { + case 311: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gMeteringReceiptResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 312; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 312: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus); + v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 1u; + grammarID = 5; + break; + case 1: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus); + v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 1u; + grammarID = 5; + break; + case 2: + errn = decode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus); + v2gMeteringReceiptResType->EVSEStatus_isUsed = 1u; + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 1; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15643,6 +15643,2115 @@ int decode_v2gExiDocument(bitstream_t* stream, struct v2gEXIDocument* exiDoc) { return errn; } + +#if DEPLOY_ISO_CODEC_FRAGMENT == SUPPORT_YES +int decode_v2gExiFragment(bitstream_t* stream, struct v2gEXIFragment* exiFrag) { + errn = readEXIHeader(stream); + + if(errn == 0) { + /* FragmentContent[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Entry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier), START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID), START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2013:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue), START_ELEMENT_GENERIC, END_DOCUMENT] */ + init_v2gEXIFragment(exiFrag); + errn = decodeNBitUnsignedInteger(stream, 8, &eventCode); + if(errn == 0) { + switch(eventCode) { + case 0: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter) */ + errn = decode_v2gAC_EVChargeParameterType(stream, &exiFrag->AC_EVChargeParameter); + exiFrag->AC_EVChargeParameter_isUsed = 1u; + break; + case 1: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter) */ + errn = decode_v2gAC_EVSEChargeParameterType(stream, &exiFrag->AC_EVSEChargeParameter); + exiFrag->AC_EVSEChargeParameter_isUsed = 1u; + break; + case 2: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + break; + case 3: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + break; + case 4: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq) */ + errn = decode_v2gAuthorizationReqType(stream, &exiFrag->AuthorizationReq); + exiFrag->AuthorizationReq_isUsed = 1u; + break; + case 5: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes) */ + errn = decode_v2gAuthorizationResType(stream, &exiFrag->AuthorizationRes); + exiFrag->AuthorizationRes_isUsed = 1u; + break; + case 6: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body) */ + errn = decode_v2gBodyType(stream, &exiFrag->Body); + exiFrag->Body_isUsed = 1u; + break; + case 7: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement) */ + errn = decode_v2gBodyBaseType(stream, &exiFrag->BodyElement); + exiFrag->BodyElement_isUsed = 1u; + break; + case 8: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + break; + case 9: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + break; + case 10: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + exiFrag->BulkSOC = (int8_t)(uint32 + 0); + exiFrag->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 11: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq) */ + errn = decode_v2gCableCheckReqType(stream, &exiFrag->CableCheckReq); + exiFrag->CableCheckReq_isUsed = 1u; + break; + case 12: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes) */ + errn = decode_v2gCableCheckResType(stream, &exiFrag->CableCheckRes); + exiFrag->CableCheckRes_isUsed = 1u; + break; + case 13: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = decode_v2gCanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod); + exiFrag->CanonicalizationMethod_isUsed = 1u; + break; + case 14: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name Certificate */ + break; + case 15: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq) */ + errn = decode_v2gCertificateInstallationReqType(stream, &exiFrag->CertificateInstallationReq); + exiFrag->CertificateInstallationReq_isUsed = 1u; + break; + case 16: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes) */ + errn = decode_v2gCertificateInstallationResType(stream, &exiFrag->CertificateInstallationRes); + exiFrag->CertificateInstallationRes_isUsed = 1u; + break; + case 17: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq) */ + errn = decode_v2gCertificateUpdateReqType(stream, &exiFrag->CertificateUpdateReq); + exiFrag->CertificateUpdateReq_isUsed = 1u; + break; + case 18: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes) */ + errn = decode_v2gCertificateUpdateResType(stream, &exiFrag->CertificateUpdateRes); + exiFrag->CertificateUpdateRes_isUsed = 1u; + break; + case 19: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq) */ + errn = decode_v2gChargeParameterDiscoveryReqType(stream, &exiFrag->ChargeParameterDiscoveryReq); + exiFrag->ChargeParameterDiscoveryReq_isUsed = 1u; + break; + case 20: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes) */ + errn = decode_v2gChargeParameterDiscoveryResType(stream, &exiFrag->ChargeParameterDiscoveryRes); + exiFrag->ChargeParameterDiscoveryRes_isUsed = 1u; + break; + case 21: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + exiFrag->ChargeProgress = (v2gchargeProgressType) uint32; + exiFrag->ChargeProgress_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 22: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService) */ + errn = decode_v2gChargeServiceType(stream, &exiFrag->ChargeService); + exiFrag->ChargeService_isUsed = 1u; + break; + case 23: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + break; + case 24: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + break; + case 25: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile) */ + errn = decode_v2gChargingProfileType(stream, &exiFrag->ChargingProfile); + exiFrag->ChargingProfile_isUsed = 1u; + break; + case 26: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &(uint32)); + exiFrag->ChargingProfileEntryMaxNumberOfPhasesInUse = (int8_t)(uint32 + 1); + exiFrag->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 27: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->ChargingProfileEntryMaxPower); + exiFrag->ChargingProfileEntryMaxPower_isUsed = 1u; + break; + case 28: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->ChargingProfileEntryStart); + exiFrag->ChargingProfileEntryStart_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 29: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + exiFrag->ChargingSession = (v2gchargingSessionType) uint32; + exiFrag->ChargingSession_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 30: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq) */ + errn = decode_v2gChargingStatusReqType(stream, &exiFrag->ChargingStatusReq); + exiFrag->ChargingStatusReq_isUsed = 1u; + break; + case 31: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes) */ + errn = decode_v2gChargingStatusResType(stream, &exiFrag->ChargingStatusRes); + exiFrag->ChargingStatusRes_isUsed = 1u; + break; + case 32: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost) */ + errn = decode_v2gConsumptionCostType(stream, &exiFrag->ConsumptionCost); + exiFrag->ConsumptionCost_isUsed = 1u; + break; + case 33: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureCertChain */ + break; + case 34: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureEncryptedPrivateKey */ + break; + case 35: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost) */ + errn = decode_v2gCostType(stream, &exiFrag->Cost); + exiFrag->Cost_isUsed = 1u; + break; + case 36: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq) */ + errn = decode_v2gCurrentDemandReqType(stream, &exiFrag->CurrentDemandReq); + exiFrag->CurrentDemandReq_isUsed = 1u; + break; + case 37: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes) */ + errn = decode_v2gCurrentDemandResType(stream, &exiFrag->CurrentDemandRes); + exiFrag->CurrentDemandRes_isUsed = 1u; + break; + case 38: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter) */ + errn = decode_v2gDC_EVChargeParameterType(stream, &exiFrag->DC_EVChargeParameter); + exiFrag->DC_EVChargeParameter_isUsed = 1u; + break; + case 39: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter) */ + errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &exiFrag->DC_EVPowerDeliveryParameter); + exiFrag->DC_EVPowerDeliveryParameter_isUsed = 1u; + break; + case 40: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter) */ + errn = decode_v2gDC_EVSEChargeParameterType(stream, &exiFrag->DC_EVSEChargeParameter); + exiFrag->DC_EVSEChargeParameter_isUsed = 1u; + break; + case 41: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + break; + case 42: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + break; + case 43: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + break; + case 44: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + break; + case 45: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DHpublickey */ + break; + case 46: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = decode_v2gDSAKeyValueType(stream, &exiFrag->DSAKeyValue); + exiFrag->DSAKeyValue_isUsed = 1u; + break; + case 47: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->DepartureTime); + exiFrag->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 48: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = decode_v2gDigestMethodType(stream, &exiFrag->DigestMethod); + exiFrag->DigestMethod_isUsed = 1u; + break; + case 49: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->DigestValue.bytesLen); + if (errn == 0) { + errn = (exiFrag->DigestValue.bytesLen) <= EXIFragment_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->DigestValue.bytesLen, exiFrag->DigestValue.bytes); + } + exiFrag->DigestValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 50: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EAmount); + exiFrag->EAmount_isUsed = 1u; + break; + case 51: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel) */ + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + exiFrag->EPriceLevel = (uint8_t)(uint32 + 0); + exiFrag->EPriceLevel_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 52: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID) */ + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->EVCCID.bytesLen); + if (errn == 0) { + errn = (exiFrag->EVCCID.bytesLen) <= EXIFragment_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->EVCCID.bytesLen, exiFrag->EVCCID.bytes); + } + exiFrag->EVCCID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 53: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter) */ + errn = decode_v2gEVChargeParameterType(stream, &exiFrag->EVChargeParameter); + exiFrag->EVChargeParameter_isUsed = 1u; + break; + case 54: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVEnergyCapacity); + exiFrag->EVEnergyCapacity_isUsed = 1u; + break; + case 55: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVEnergyRequest); + exiFrag->EVEnergyRequest_isUsed = 1u; + break; + case 56: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + exiFrag->EVErrorCode = (v2gDC_EVErrorCodeType) uint32; + exiFrag->EVErrorCode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 57: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVMaxCurrent); + exiFrag->EVMaxCurrent_isUsed = 1u; + break; + case 58: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVMaxVoltage); + exiFrag->EVMaxVoltage_isUsed = 1u; + break; + case 59: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + break; + case 60: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + break; + case 61: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + break; + case 62: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + break; + case 63: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + break; + case 64: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + break; + case 65: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVMinCurrent); + exiFrag->EVMinCurrent_isUsed = 1u; + break; + case 66: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter) */ + errn = decode_v2gEVPowerDeliveryParameterType(stream, &exiFrag->EVPowerDeliveryParameter); + exiFrag->EVPowerDeliveryParameter_isUsed = 1u; + break; + case 67: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + exiFrag->EVRESSSOC = (int8_t)(uint32 + 0); + exiFrag->EVRESSSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 68: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVReady); + exiFrag->EVReady_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 69: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter) */ + errn = decode_v2gEVSEChargeParameterType(stream, &exiFrag->EVSEChargeParameter); + exiFrag->EVSEChargeParameter_isUsed = 1u; + break; + case 70: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVSECurrentLimitAchieved); + exiFrag->EVSECurrentLimitAchieved_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 71: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVSECurrentRegulationTolerance); + exiFrag->EVSECurrentRegulationTolerance_isUsed = 1u; + break; + case 72: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVSEEnergyToBeDelivered); + exiFrag->EVSEEnergyToBeDelivered_isUsed = 1u; + break; + case 73: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEID */ + break; + case 74: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + exiFrag->EVSEIsolationStatus = (v2gisolationLevelType) uint32; + exiFrag->EVSEIsolationStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 75: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + break; + case 76: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + break; + case 77: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + break; + case 78: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + break; + case 79: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + break; + case 80: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + break; + case 81: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + break; + case 82: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + break; + case 83: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVSEMinimumCurrentLimit); + exiFrag->EVSEMinimumCurrentLimit_isUsed = 1u; + break; + case 84: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVSEMinimumVoltageLimit); + exiFrag->EVSEMinimumVoltageLimit_isUsed = 1u; + break; + case 85: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVSENominalVoltage); + exiFrag->EVSENominalVoltage_isUsed = 1u; + break; + case 86: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + exiFrag->EVSENotification = (v2gEVSENotificationType) uint32; + exiFrag->EVSENotification_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 87: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVSEPeakCurrentRipple); + exiFrag->EVSEPeakCurrentRipple_isUsed = 1u; + break; + case 88: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVSEPowerLimitAchieved); + exiFrag->EVSEPowerLimitAchieved_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 89: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->EVSEPresentCurrent); + exiFrag->EVSEPresentCurrent_isUsed = 1u; + break; + case 90: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEPresentVoltage */ + break; + case 91: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEProcessing */ + break; + case 92: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus) */ + errn = decode_v2gEVSEStatusType(stream, &exiFrag->EVSEStatus); + exiFrag->EVSEStatus_isUsed = 1u; + break; + case 93: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + exiFrag->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; + exiFrag->EVSEStatusCode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 94: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSETimeStamp */ + break; + case 95: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVSEVoltageLimitAchieved); + exiFrag->EVSEVoltageLimitAchieved_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 96: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVStatus) */ + errn = decode_v2gEVStatusType(stream, &exiFrag->EVStatus); + exiFrag->EVStatus_isUsed = 1u; + break; + case 97: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetCurrent */ + break; + case 98: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetVoltage */ + break; + case 99: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + exiFrag->EnergyTransferMode = (v2gEnergyTransferModeType) uint32; + exiFrag->EnergyTransferMode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 100: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Entry) */ + errn = decode_v2gEntryType(stream, &exiFrag->Entry); + exiFrag->Entry_isUsed = 1u; + break; + case 101: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Exponent.bytesLen); + if (errn == 0) { + errn = (exiFrag->Exponent.bytesLen) <= EXIFragment_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Exponent.bytesLen, exiFrag->Exponent.bytes); + } + exiFrag->Exponent_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 102: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + exiFrag->FaultCode = (v2gfaultCodeType) uint32; + exiFrag->FaultCode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 103: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->FaultMsg.charactersLen); + if (errn == 0) { + errn = (exiFrag->FaultMsg.charactersLen - 2) <= EXIFragment_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->FaultMsg.charactersLen >= 2) { + exiFrag->FaultMsg.charactersLen = (uint16_t)(exiFrag->FaultMsg.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->FaultMsg.charactersLen, exiFrag->FaultMsg.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->FaultMsg_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 104: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->FreeService); + exiFrag->FreeService_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 105: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + exiFrag->FullSOC = (int8_t)(uint32 + 0); + exiFrag->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 106: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->G.bytesLen); + if (errn == 0) { + errn = (exiFrag->G.bytesLen) <= EXIFragment_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->G.bytesLen, exiFrag->G.bytes); + } + exiFrag->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 107: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name GenChallenge */ + break; + case 108: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->HMACOutputLength); + exiFrag->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 109: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header) */ + errn = decode_v2gMessageHeaderType(stream, &exiFrag->Header); + exiFrag->Header_isUsed = 1u; + break; + case 110: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->J.bytesLen); + if (errn == 0) { + errn = (exiFrag->J.bytesLen) <= EXIFragment_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->J.bytesLen, exiFrag->J.bytes); + } + exiFrag->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 111: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = decode_v2gKeyInfoType(stream, &exiFrag->KeyInfo); + exiFrag->KeyInfo_isUsed = 1u; + break; + case 112: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->KeyName.charactersLen); + if (errn == 0) { + errn = (exiFrag->KeyName.charactersLen - 2) <= EXIFragment_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->KeyName.charactersLen >= 2) { + exiFrag->KeyName.charactersLen = (uint16_t)(exiFrag->KeyName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->KeyName.charactersLen, exiFrag->KeyName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->KeyName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 113: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = decode_v2gKeyValueType(stream, &exiFrag->KeyValue); + exiFrag->KeyValue_isUsed = 1u; + break; + case 114: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ListOfRootCertificateIDs */ + break; + case 115: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = decode_v2gManifestType(stream, &exiFrag->Manifest); + exiFrag->Manifest_isUsed = 1u; + break; + case 116: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->MaxEntriesSAScheduleTuple); + exiFrag->MaxEntriesSAScheduleTuple_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 117: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->MeterID.charactersLen); + if (errn == 0) { + errn = (exiFrag->MeterID.charactersLen - 2) <= EXIFragment_MeterID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->MeterID.charactersLen >= 2) { + exiFrag->MeterID.charactersLen = (uint16_t)(exiFrag->MeterID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->MeterID.charactersLen, exiFrag->MeterID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->MeterID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 118: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name MeterInfo */ + break; + case 119: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger64(stream, &exiFrag->MeterReading); + exiFrag->MeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 120: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->MeterStatus); + exiFrag->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 121: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq) */ + errn = decode_v2gMeteringReceiptReqType(stream, &exiFrag->MeteringReceiptReq); + exiFrag->MeteringReceiptReq_isUsed = 1u; + break; + case 122: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes) */ + errn = decode_v2gMeteringReceiptResType(stream, &exiFrag->MeteringReceiptRes); + exiFrag->MeteringReceiptRes_isUsed = 1u; + break; + case 123: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->MgmtData.charactersLen); + if (errn == 0) { + errn = (exiFrag->MgmtData.charactersLen - 2) <= EXIFragment_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->MgmtData.charactersLen >= 2) { + exiFrag->MgmtData.charactersLen = (uint16_t)(exiFrag->MgmtData.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->MgmtData.charactersLen, exiFrag->MgmtData.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->MgmtData_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 124: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Modulus.bytesLen); + if (errn == 0) { + errn = (exiFrag->Modulus.bytesLen) <= EXIFragment_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Modulus.bytesLen, exiFrag->Modulus.bytes); + } + exiFrag->Modulus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 125: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + exiFrag->Multiplier = (int8_t)(uint32 -3); + exiFrag->Multiplier_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 126: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification) */ + errn = decode_v2gNotificationType(stream, &exiFrag->Notification); + exiFrag->Notification_isUsed = 1u; + break; + case 127: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->NotificationMaxDelay); + exiFrag->NotificationMaxDelay_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 128: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) */ + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + exiFrag->NumEPriceLevels = (uint8_t)(uint32 + 0); + exiFrag->NumEPriceLevels_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 129: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (exiFrag->OEMProvisioningCert.bytesLen) <= EXIFragment_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->OEMProvisioningCert.bytesLen, exiFrag->OEMProvisioningCert.bytes); + } + exiFrag->OEMProvisioningCert_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 130: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = decode_v2gObjectType(stream, &exiFrag->Object); + exiFrag->Object_isUsed = 1u; + break; + case 131: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->P.bytesLen); + if (errn == 0) { + errn = (exiFrag->P.bytesLen) <= EXIFragment_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->P.bytesLen, exiFrag->P.bytes); + } + exiFrag->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 132: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = decode_v2gPGPDataType(stream, &exiFrag->PGPData); + exiFrag->PGPData_isUsed = 1u; + break; + case 133: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->PGPKeyID.bytesLen); + if (errn == 0) { + errn = (exiFrag->PGPKeyID.bytesLen) <= EXIFragment_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->PGPKeyID.bytesLen, exiFrag->PGPKeyID.bytes); + } + exiFrag->PGPKeyID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 134: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name PGPKeyPacket */ + break; + case 135: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->PMax); + exiFrag->PMax_isUsed = 1u; + break; + case 136: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule) */ + errn = decode_v2gPMaxScheduleType(stream, &exiFrag->PMaxSchedule); + exiFrag->PMaxSchedule_isUsed = 1u; + break; + case 137: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry) */ + errn = decode_v2gPMaxScheduleEntryType(stream, &exiFrag->PMaxScheduleEntry); + exiFrag->PMaxScheduleEntry_isUsed = 1u; + break; + case 138: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter) */ + errn = decode_v2gParameterType(stream, &exiFrag->Parameter); + exiFrag->Parameter_isUsed = 1u; + break; + case 139: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet) */ + errn = decode_v2gParameterSetType(stream, &exiFrag->ParameterSet); + exiFrag->ParameterSet_isUsed = 1u; + break; + case 140: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ParameterSetID */ + break; + case 141: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq) */ + errn = decode_v2gPaymentDetailsReqType(stream, &exiFrag->PaymentDetailsReq); + exiFrag->PaymentDetailsReq_isUsed = 1u; + break; + case 142: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes) */ + errn = decode_v2gPaymentDetailsResType(stream, &exiFrag->PaymentDetailsRes); + exiFrag->PaymentDetailsRes_isUsed = 1u; + break; + case 143: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + exiFrag->PaymentOption = (v2gpaymentOptionType) uint32; + exiFrag->PaymentOption_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 144: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList) */ + errn = decode_v2gPaymentOptionListType(stream, &exiFrag->PaymentOptionList); + exiFrag->PaymentOptionList_isUsed = 1u; + break; + case 145: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq) */ + errn = decode_v2gPaymentServiceSelectionReqType(stream, &exiFrag->PaymentServiceSelectionReq); + exiFrag->PaymentServiceSelectionReq_isUsed = 1u; + break; + case 146: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes) */ + errn = decode_v2gPaymentServiceSelectionResType(stream, &exiFrag->PaymentServiceSelectionRes); + exiFrag->PaymentServiceSelectionRes_isUsed = 1u; + break; + case 147: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->PgenCounter.bytesLen); + if (errn == 0) { + errn = (exiFrag->PgenCounter.bytesLen) <= EXIFragment_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->PgenCounter.bytesLen, exiFrag->PgenCounter.bytes); + } + exiFrag->PgenCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 148: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq) */ + errn = decode_v2gPowerDeliveryReqType(stream, &exiFrag->PowerDeliveryReq); + exiFrag->PowerDeliveryReq_isUsed = 1u; + break; + case 149: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes) */ + errn = decode_v2gPowerDeliveryResType(stream, &exiFrag->PowerDeliveryRes); + exiFrag->PowerDeliveryRes_isUsed = 1u; + break; + case 150: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq) */ + errn = decode_v2gPreChargeReqType(stream, &exiFrag->PreChargeReq); + exiFrag->PreChargeReq_isUsed = 1u; + break; + case 151: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes) */ + errn = decode_v2gPreChargeResType(stream, &exiFrag->PreChargeRes); + exiFrag->PreChargeRes_isUsed = 1u; + break; + case 152: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry) */ + errn = decode_v2gProfileEntryType(stream, &exiFrag->ProfileEntry); + exiFrag->ProfileEntry_isUsed = 1u; + break; + case 153: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Q.bytesLen); + if (errn == 0) { + errn = (exiFrag->Q.bytesLen) <= EXIFragment_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Q.bytesLen, exiFrag->Q.bytes); + } + exiFrag->Q_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 154: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->RCD); + exiFrag->RCD_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 155: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = decode_v2gRSAKeyValueType(stream, &exiFrag->RSAKeyValue); + exiFrag->RSAKeyValue_isUsed = 1u; + break; + case 156: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ReceiptRequired */ + break; + case 157: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = decode_v2gReferenceType(stream, &exiFrag->Reference); + exiFrag->Reference_isUsed = 1u; + break; + case 158: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval) */ + errn = decode_v2gRelativeTimeIntervalType(stream, &exiFrag->RelativeTimeInterval); + exiFrag->RelativeTimeInterval_isUsed = 1u; + break; + case 159: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->RemainingTimeToBulkSoC); + exiFrag->RemainingTimeToBulkSoC_isUsed = 1u; + break; + case 160: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->RemainingTimeToFullSoC); + exiFrag->RemainingTimeToFullSoC_isUsed = 1u; + break; + case 161: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + exiFrag->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; + exiFrag->RequestedEnergyTransferMode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 162: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ResponseCode */ + break; + case 163: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = decode_v2gRetrievalMethodType(stream, &exiFrag->RetrievalMethod); + exiFrag->RetrievalMethod_isUsed = 1u; + break; + case 164: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->RetryCounter); + exiFrag->RetryCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 165: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID) */ + errn = decode_v2gX509IssuerSerialType(stream, &exiFrag->RootCertificateID); + exiFrag->RootCertificateID_isUsed = 1u; + break; + case 166: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAProvisioningCertificateChain */ + break; + case 167: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList) */ + errn = decode_v2gSAScheduleListType(stream, &exiFrag->SAScheduleList); + exiFrag->SAScheduleList_isUsed = 1u; + break; + case 168: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple) */ + errn = decode_v2gSAScheduleTupleType(stream, &exiFrag->SAScheduleTuple); + exiFrag->SAScheduleTuple_isUsed = 1u; + break; + case 169: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + break; + case 170: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + break; + case 171: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules) */ + errn = decode_v2gSASchedulesType(stream, &exiFrag->SASchedules); + exiFrag->SASchedules_isUsed = 1u; + break; + case 172: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = decode_v2gSPKIDataType(stream, &exiFrag->SPKIData); + exiFrag->SPKIData_isUsed = 1u; + break; + case 173: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->SPKISexp.bytesLen); + if (errn == 0) { + errn = (exiFrag->SPKISexp.bytesLen) <= EXIFragment_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->SPKISexp.bytesLen, exiFrag->SPKISexp.bytes); + } + exiFrag->SPKISexp_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 174: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff) */ + errn = decode_v2gSalesTariffType(stream, &exiFrag->SalesTariff); + exiFrag->SalesTariff_isUsed = 1u; + break; + case 175: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->SalesTariffDescription.charactersLen); + if (errn == 0) { + errn = (exiFrag->SalesTariffDescription.charactersLen - 2) <= EXIFragment_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->SalesTariffDescription.charactersLen >= 2) { + exiFrag->SalesTariffDescription.charactersLen = (uint16_t)(exiFrag->SalesTariffDescription.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->SalesTariffDescription.charactersLen, exiFrag->SalesTariffDescription.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->SalesTariffDescription_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 176: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry) */ + errn = decode_v2gSalesTariffEntryType(stream, &exiFrag->SalesTariffEntry); + exiFrag->SalesTariffEntry_isUsed = 1u; + break; + case 177: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + exiFrag->SalesTariffID = (uint8_t)(uint32 + 1); + exiFrag->SalesTariffID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 178: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Seed.bytesLen); + if (errn == 0) { + errn = (exiFrag->Seed.bytesLen) <= EXIFragment_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Seed.bytesLen, exiFrag->Seed.bytes); + } + exiFrag->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 179: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + exiFrag->SelectedPaymentOption = (v2gpaymentOptionType) uint32; + exiFrag->SelectedPaymentOption_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 180: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService) */ + errn = decode_v2gSelectedServiceType(stream, &exiFrag->SelectedService); + exiFrag->SelectedService_isUsed = 1u; + break; + case 181: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList) */ + errn = decode_v2gSelectedServiceListType(stream, &exiFrag->SelectedServiceList); + exiFrag->SelectedServiceList_isUsed = 1u; + break; + case 182: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service) */ + errn = decode_v2gServiceType(stream, &exiFrag->Service); + exiFrag->Service_isUsed = 1u; + break; + case 183: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + break; + case 184: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + break; + case 185: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq) */ + errn = decode_v2gServiceDetailReqType(stream, &exiFrag->ServiceDetailReq); + exiFrag->ServiceDetailReq_isUsed = 1u; + break; + case 186: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes) */ + errn = decode_v2gServiceDetailResType(stream, &exiFrag->ServiceDetailRes); + exiFrag->ServiceDetailRes_isUsed = 1u; + break; + case 187: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq) */ + errn = decode_v2gServiceDiscoveryReqType(stream, &exiFrag->ServiceDiscoveryReq); + exiFrag->ServiceDiscoveryReq_isUsed = 1u; + break; + case 188: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes) */ + errn = decode_v2gServiceDiscoveryResType(stream, &exiFrag->ServiceDiscoveryRes); + exiFrag->ServiceDiscoveryRes_isUsed = 1u; + break; + case 189: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + break; + case 190: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + break; + case 191: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList) */ + errn = decode_v2gServiceListType(stream, &exiFrag->ServiceList); + exiFrag->ServiceList_isUsed = 1u; + break; + case 192: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceName.charactersLen); + if (errn == 0) { + errn = (exiFrag->ServiceName.charactersLen - 2) <= EXIFragment_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->ServiceName.charactersLen >= 2) { + exiFrag->ServiceName.charactersLen = (uint16_t)(exiFrag->ServiceName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->ServiceName.charactersLen, exiFrag->ServiceName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->ServiceName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 193: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList) */ + errn = decode_v2gServiceParameterListType(stream, &exiFrag->ServiceParameterList); + exiFrag->ServiceParameterList_isUsed = 1u; + break; + case 194: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + break; + case 195: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + break; + case 196: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + break; + case 197: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + break; + case 198: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq) */ + errn = decode_v2gSessionSetupReqType(stream, &exiFrag->SessionSetupReq); + exiFrag->SessionSetupReq_isUsed = 1u; + break; + case 199: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes) */ + errn = decode_v2gSessionSetupResType(stream, &exiFrag->SessionSetupRes); + exiFrag->SessionSetupRes_isUsed = 1u; + break; + case 200: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq) */ + errn = decode_v2gSessionStopReqType(stream, &exiFrag->SessionStopReq); + exiFrag->SessionStopReq_isUsed = 1u; + break; + case 201: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes) */ + errn = decode_v2gSessionStopResType(stream, &exiFrag->SessionStopRes); + exiFrag->SessionStopRes_isUsed = 1u; + break; + case 202: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (exiFrag->SigMeterReading.bytesLen) <= EXIFragment_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->SigMeterReading.bytesLen, exiFrag->SigMeterReading.bytes); + } + exiFrag->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 203: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = decode_v2gSignatureType(stream, &exiFrag->Signature); + exiFrag->Signature_isUsed = 1u; + break; + case 204: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = decode_v2gSignatureMethodType(stream, &exiFrag->SignatureMethod); + exiFrag->SignatureMethod_isUsed = 1u; + break; + case 205: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = decode_v2gSignaturePropertiesType(stream, &exiFrag->SignatureProperties); + exiFrag->SignatureProperties_isUsed = 1u; + break; + case 206: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = decode_v2gSignaturePropertyType(stream, &exiFrag->SignatureProperty); + exiFrag->SignatureProperty_isUsed = 1u; + break; + case 207: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = decode_v2gSignatureValueType(stream, &exiFrag->SignatureValue); + exiFrag->SignatureValue_isUsed = 1u; + break; + case 208: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = decode_v2gSignedInfoType(stream, &exiFrag->SignedInfo); + exiFrag->SignedInfo_isUsed = 1u; + break; + case 209: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates) */ + errn = decode_v2gSubCertificatesType(stream, &exiFrag->SubCertificates); + exiFrag->SubCertificates_isUsed = 1u; + break; + case 210: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode) */ + errn = decode_v2gSupportedEnergyTransferModeType(stream, &exiFrag->SupportedEnergyTransferMode); + exiFrag->SupportedEnergyTransferMode_isUsed = 1u; + break; + case 211: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->TMeter); + exiFrag->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 212: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval) */ + errn = decode_v2gIntervalType(stream, &exiFrag->TimeInterval); + exiFrag->TimeInterval_isUsed = 1u; + break; + case 213: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = decode_v2gTransformType(stream, &exiFrag->Transform); + exiFrag->Transform_isUsed = 1u; + break; + case 214: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = decode_v2gTransformsType(stream, &exiFrag->Transforms); + exiFrag->Transforms_isUsed = 1u; + break; + case 215: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + exiFrag->Unit = (v2gunitSymbolType) uint32; + exiFrag->Unit_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 216: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}V2G_Message) */ + errn = decode_v2gAnonType_V2G_Message(stream, &exiFrag->V2G_Message); + exiFrag->V2G_Message_isUsed = 1u; + break; + case 217: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->Value); + exiFrag->Value_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 218: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq) */ + errn = decode_v2gWeldingDetectionReqType(stream, &exiFrag->WeldingDetectionReq); + exiFrag->WeldingDetectionReq_isUsed = 1u; + break; + case 219: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes) */ + errn = decode_v2gWeldingDetectionResType(stream, &exiFrag->WeldingDetectionRes); + exiFrag->WeldingDetectionRes_isUsed = 1u; + break; + case 220: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509CRL.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509CRL.bytesLen) <= EXIFragment_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509CRL.bytesLen, exiFrag->X509CRL.bytes); + } + exiFrag->X509CRL_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 221: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509Certificate.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509Certificate.bytesLen) <= EXIFragment_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509Certificate.bytesLen, exiFrag->X509Certificate.bytes); + } + exiFrag->X509Certificate_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 222: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = decode_v2gX509DataType(stream, &exiFrag->X509Data); + exiFrag->X509Data_isUsed = 1u; + break; + case 223: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509IssuerName.charactersLen); + if (errn == 0) { + errn = (exiFrag->X509IssuerName.charactersLen - 2) <= EXIFragment_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->X509IssuerName.charactersLen >= 2) { + exiFrag->X509IssuerName.charactersLen = (uint16_t)(exiFrag->X509IssuerName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->X509IssuerName.charactersLen, exiFrag->X509IssuerName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->X509IssuerName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 224: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial) */ + errn = decode_v2gX509IssuerSerialType(stream, &exiFrag->X509IssuerSerial); + exiFrag->X509IssuerSerial_isUsed = 1u; + break; + case 225: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509SKI.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509SKI.bytesLen) <= EXIFragment_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509SKI.bytesLen, exiFrag->X509SKI.bytes); + } + exiFrag->X509SKI_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 226: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->X509SerialNumber); + exiFrag->X509SerialNumber_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 227: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509SubjectName.charactersLen); + if (errn == 0) { + errn = (exiFrag->X509SubjectName.charactersLen - 2) <= EXIFragment_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->X509SubjectName.charactersLen >= 2) { + exiFrag->X509SubjectName.charactersLen = (uint16_t)(exiFrag->X509SubjectName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->X509SubjectName.charactersLen, exiFrag->X509SubjectName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->X509SubjectName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 228: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->XPath.charactersLen); + if (errn == 0) { + errn = (exiFrag->XPath.charactersLen - 2) <= EXIFragment_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->XPath.charactersLen >= 2) { + exiFrag->XPath.charactersLen = (uint16_t)(exiFrag->XPath.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->XPath.charactersLen, exiFrag->XPath.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->XPath_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 229: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Y.bytesLen); + if (errn == 0) { + errn = (exiFrag->Y.bytesLen) <= EXIFragment_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Y.bytesLen, exiFrag->Y.bytes); + } + exiFrag->Y_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 230: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->amount); + exiFrag->amount_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 231: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + exiFrag->amountMultiplier = (int8_t)(uint32 -3); + exiFrag->amountMultiplier_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 232: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->boolValue); + exiFrag->boolValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 233: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue) */ + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + exiFrag->byteValue = (int8_t)(uint32 -128); + exiFrag->byteValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 234: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + exiFrag->costKind = (v2gcostKindType) uint32; + exiFrag->costKind_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 235: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration) */ + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->duration); + exiFrag->duration_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 236: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name eMAID */ + break; + case 237: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger32(stream, &exiFrag->intValue); + exiFrag->intValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 238: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->physicalValue); + exiFrag->physicalValue_isUsed = 1u; + break; + case 239: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->shortValue); + exiFrag->shortValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 240: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start) */ + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->start); + exiFrag->start_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 241: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue) */ + errn = decode_v2gPhysicalValueType(stream, &exiFrag->startValue); + exiFrag->startValue_isUsed = 1u; + break; + case 242: + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->stringValue.charactersLen); + if (errn == 0) { + errn = (exiFrag->stringValue.charactersLen - 2) <= EXIFragment_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->stringValue.charactersLen >= 2) { + exiFrag->stringValue.charactersLen = (uint16_t)(exiFrag->stringValue.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->stringValue.charactersLen, exiFrag->stringValue.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->stringValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + default: + errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1; + break; + } + } + if(errn == 0) { + /* EndDocument */ + errn = decodeNBitUnsignedInteger(stream, 8, &eventCode); + if (eventCode != 244) { + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; + } + } + + } + + return errn; +} +#endif /* DEPLOY_ISO_CODEC_FRAGMENT */ + #endif /* DEPLOY_ISO_CODEC */ diff --git a/src/codec/v2gEXIDatatypesDecoder.h b/src/codec/v2gEXIDatatypesDecoder.h index 442c4db..dc6741c 100644 --- a/src/codec/v2gEXIDatatypesDecoder.h +++ b/src/codec/v2gEXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -50,6 +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 */ diff --git a/src/codec/v2gEXIDatatypesEncoder.c b/src/codec/v2gEXIDatatypesEncoder.c index 4001a74..935790f 100644 --- a/src/codec/v2gEXIDatatypesEncoder.c +++ b/src/codec/v2gEXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -46,116 +46,116 @@ static int errn; /* Forward Declarations */ -static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); -static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); -static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); -static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); -static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); -static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); -static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); -static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); -static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); -static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); -static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); -static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); -static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); -static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); -static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); -static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); -static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); -static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); -static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); -static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); -static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); -static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); -static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); -static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); -static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); -static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); -static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); -static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); -static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); -static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); -static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); -static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); -static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); -static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); -static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); -static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); -static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); -static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); -static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); -static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); -static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); -static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); -static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); -static int encode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); -static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); -static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); -static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); -static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); -static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); -static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); -static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); -static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); -static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); static int encode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); +static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); +static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); +static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); +static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); +static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); +static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); +static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); +static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); +static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); +static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); +static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); +static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); static int encode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType); -static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); -static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); -static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); -static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); -static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); +static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); +static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); +static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); +static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); +static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); +static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); +static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); +static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); +static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +static int encode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); +static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); +static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); -static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); -static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); -static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); -static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); -static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); +static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); +static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); +static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); +static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); +static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); -static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); -static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); -static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); +static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); +static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); +static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); +static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); +static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); +static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); -static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); -static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); +static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); +static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); +static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); +static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); +static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); +static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); +static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); +static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); +static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); +static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); +static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); +static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); +static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); +static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); +static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); +static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); +static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); +static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); +static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); +static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); +static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); +static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); +static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); +static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); +static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); +static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); +static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); +static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); +static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); +static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); +static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); +static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); +static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); +static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); +static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); +static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); +static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); +static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); +static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); +static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); +static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); +static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); +static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); +static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); +static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); +static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); +static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); +static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); +static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); +static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); +static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); +static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); +static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); +static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); +static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); +static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); +static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); +static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); +static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); +static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { + /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { int grammarID = 0; int done = 0; @@ -163,5250 +163,104 @@ static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntr while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ - if ( 1 == 1 ) { + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gProfileEntryType->ChargingProfileEntryStart); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + done = 1; } grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower ); - } - grammarID = 2; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { + int grammarID = 2; + int done = 0; + + + while(!done) { + switch(grammarID) { case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ - if ( v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, (uint32_t)(v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus ); } grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + if ( v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - done = 1; + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } grammarID = 4; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + case 4: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { - int grammarID = 5; - int done = 0; - - - while(!done) { - switch(grammarID) { case 5: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.characters, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); - } - } - grammarID = 6; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 6: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { - int grammarID = 7; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 7: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( v2gServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gServiceDiscoveryReqType->ServiceScope.characters, v2gServiceDiscoveryReqType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 8; - } else if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 8: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { - int grammarID = 9; - int done = 0; - - unsigned int v2gSignatureType_Object_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( v2gSignatureType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignatureType->Id.characters, v2gSignatureType->Id.charactersLen); - } - } - grammarID = 10; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); - } - grammarID = 11; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 10: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); - } - grammarID = 11; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 11: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue ); - } - grammarID = 12; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 12: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if ( v2gSignatureType->KeyInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo ); - } - grammarID = 13; - } else if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); - } - grammarID = 13; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 13: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); - } - grammarID = 13; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType) { - int grammarID = 14; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 14: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gNotificationType->FaultCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 15: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ - if ( v2gNotificationType->FaultMsg_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gNotificationType->FaultMsg.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gNotificationType->FaultMsg.characters, v2gNotificationType->FaultMsg.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ -static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { - int grammarID = 16; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 16: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus ); - } - grammarID = 17; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 17: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage ); - } - grammarID = 18; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 18: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { - int grammarID = 19; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 19: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.characters, v2gX509IssuerSerialType->X509IssuerName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 20; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 20: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gX509IssuerSerialType->X509SerialNumber); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - int grammarID = 21; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 21: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - if ( v2gSignaturePropertyType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertyType->Id.characters, v2gSignaturePropertyType->Id.charactersLen); - } - } - grammarID = 22; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 23; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 22: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 23; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 23: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 25: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { - int grammarID = 26; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 26: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( v2gReferenceType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->Id.characters, v2gReferenceType->Id.charactersLen); - } - } - grammarID = 27; - } else if ( v2gReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); - } - } - grammarID = 28; - } else if ( v2gReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); - } - } - grammarID = 29; - } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); - } - grammarID = 30; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 31; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 27: - /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( v2gReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); - } - } - grammarID = 28; - } else if ( v2gReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); - } - } - grammarID = 29; - } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); - } - grammarID = 30; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 31; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 28: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( v2gReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); - } - } - grammarID = 29; - } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); - } - grammarID = 30; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 31; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 29: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( v2gReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); - } - grammarID = 30; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 31; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 30: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 31; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 31: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->DigestValue.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gReferenceType->DigestValue.bytes, v2gReferenceType->DigestValue.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType) { - int grammarID = 32; - int done = 0; - - unsigned int v2gManifestType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 32: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if ( v2gManifestType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gManifestType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gManifestType->Id.characters, v2gManifestType->Id.charactersLen); - } - } - grammarID = 33; - } else if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); - } - grammarID = 34; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 33: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); - } - grammarID = 34; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 34: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); - } - grammarID = 34; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType) { - int grammarID = 35; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 35: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gSelectedServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 36; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 36: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID), END_ELEMENT] */ - if ( v2gSelectedServiceType->ParameterSetID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gSelectedServiceType->ParameterSetID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { - int grammarID = 37; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 37: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ - if ( v2gEVChargeParameterType->DepartureTime_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gEVChargeParameterType->DepartureTime); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { - int grammarID = 38; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { - int grammarID = 39; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 39: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gChargingStatusResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 40; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 40: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gChargingStatusResType->EVSEID.characters, v2gChargingStatusResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gChargingStatusResType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 42; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( v2gChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent ); - } - grammarID = 43; - } else if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); - } - grammarID = 44; - } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 45; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 43: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); - } - grammarID = 44; - } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 45; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 44: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 45; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 45: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ -static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { - int grammarID = 46; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 46: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gEVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 47; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 47: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gEVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { - int grammarID = 48; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 48: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ - if ( v2gMeteringReceiptReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gMeteringReceiptReqType->Id.characters, v2gMeteringReceiptReqType->Id.charactersLen); - } - } - grammarID = 49; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 50; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 49: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 50; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 50: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ - if ( v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gMeteringReceiptReqType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 51; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 51: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { - int grammarID = 52; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 52: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus ); - } - grammarID = 53; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 53: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); - } - grammarID = 54; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 54: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); - } - grammarID = 55; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 55: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); - } - grammarID = 56; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 56: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); - } - grammarID = 57; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 57: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); - } - grammarID = 58; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 58: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); - } - grammarID = 59; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 59: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 60: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ - if ( v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { - int grammarID = 61; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 61: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDetailResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 62; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 62: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceDetailResType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 63; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 63: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ - if ( v2gServiceDetailResType->ServiceParameterList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { - int grammarID = 64; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 64: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - if ( v2gCertificateChainType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateChainType->Id.characters, v2gCertificateChainType->Id.charactersLen); - } - } - grammarID = 65; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 66; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 65: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 66; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 66: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), END_ELEMENT] */ - if ( v2gCertificateChainType->SubCertificates_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { - int grammarID = 67; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 67: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.characters, v2gCanonicalizationMethodType->Algorithm.charactersLen); - } - } - grammarID = 68; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 68: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { - int grammarID = 69; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 69: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gMeteringReceiptResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 70; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 70: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ - if ( v2gMeteringReceiptResType->AC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus ); - } - grammarID = 3; - } else if ( v2gMeteringReceiptResType->DC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus ); - } - grammarID = 3; - } else if ( v2gMeteringReceiptResType->EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { - int grammarID = 71; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 71: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gPowerDeliveryReqType->ChargeProgress); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 72; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 72: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gPowerDeliveryReqType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 73; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( v2gPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile ); - } - grammarID = 74; - } else if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 74: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { - int grammarID = 75; - int done = 0; - - unsigned int v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 75: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ - if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); - } - grammarID = 76; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 76: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ - if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); - } - grammarID = 76; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ -static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { - int grammarID = 77; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 77: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gSessionStopReqType->ChargingSession); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ -static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType) { - int grammarID = 78; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 78: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gChargeServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 79; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( v2gChargeServiceType->ServiceName_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gChargeServiceType->ServiceName.characters, v2gChargeServiceType->ServiceName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 80; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 81; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 80: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 81; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( v2gChargeServiceType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gChargeServiceType->ServiceScope.characters, v2gChargeServiceType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 82; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 83; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 83; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ -static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { - int grammarID = 84; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 84: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->Name.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gParameterType->Name.characters, v2gParameterType->Name.charactersLen); - } - } - grammarID = 85; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 85: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ - if ( v2gParameterType->boolValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gParameterType->boolValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( v2gParameterType->byteValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gParameterType->byteValue + 128)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( v2gParameterType->shortValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gParameterType->shortValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( v2gParameterType->intValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger32(stream, v2gParameterType->intValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( v2gParameterType->physicalValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue ); - } - grammarID = 3; - } else if ( v2gParameterType->stringValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 5); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->stringValue.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gParameterType->stringValue.characters, v2gParameterType->stringValue.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { - int grammarID = 38; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { - int grammarID = 86; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 86: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentServiceSelectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { - int grammarID = 87; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 87: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); - } - grammarID = 88; - } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); - } - grammarID = 88; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 88; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 88: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 88; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 89: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); - } - grammarID = 88; - } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); - } - grammarID = 88; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 88; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { - int grammarID = 90; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 90: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionSetupResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 91; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 91: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSessionSetupResType->EVSEID.characters, v2gSessionSetupResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 92; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 92: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ - if ( v2gSessionSetupResType->EVSETimeStamp_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gSessionSetupResType->EVSETimeStamp); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { - int grammarID = 93; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 93: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gAuthorizationResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 94; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gAuthorizationResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { - int grammarID = 95; - int done = 0; - - unsigned int v2gX509DataType_X509IssuerSerial_currArrayIndex = 0; - unsigned int v2gX509DataType_X509SKI_currArrayIndex = 0; - unsigned int v2gX509DataType_X509SubjectName_currArrayIndex = 0; - unsigned int v2gX509DataType_X509Certificate_currArrayIndex = 0; - unsigned int v2gX509DataType_X509CRL_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); - } - grammarID = 96; - } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); - v2gX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); - v2gX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); - v2gX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); - v2gX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 96; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 96: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); - } - grammarID = 96; - } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); - v2gX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); - v2gX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); - v2gX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); - v2gX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 96; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 6); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { - int grammarID = 97; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 97: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateUpdateReqType->Id.characters, v2gCertificateUpdateReqType->Id.charactersLen); - } - } - grammarID = 98; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 98: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain ); - } - grammarID = 99; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 99: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->eMAID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateUpdateReqType->eMAID.characters, v2gCertificateUpdateReqType->eMAID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 100; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 100: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ -static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType) { - int grammarID = 101; - int done = 0; - - unsigned int v2gPaymentOptionListType_PaymentOption_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 101: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ - if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 102; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 102: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ - if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { - int grammarID = 103; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 103: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignatureMethodType->Algorithm.characters, v2gSignatureMethodType->Algorithm.charactersLen); - } - } - grammarID = 104; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 104: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 24; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 105; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 105: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 24; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 105; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { - int grammarID = 106; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 106: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ - if ( v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 107; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 108; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 107: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 108; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 108: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ - if ( v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter ); - } - grammarID = 3; - } else if ( v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter ); - } - grammarID = 3; - } else if ( v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { - int grammarID = 38; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { - int grammarID = 109; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 109: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateInstallationResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain ); - } - grammarID = 111; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 111: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain ); - } - grammarID = 112; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 112: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey ); - } - grammarID = 113; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey ); - } - grammarID = 114; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 114: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { - int grammarID = 115; - int done = 0; - - unsigned int v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 115: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */ - if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); - } - grammarID = 116; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 116: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), END_ELEMENT] */ - if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); - } - grammarID = 116; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { - int grammarID = 117; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 117: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVStatusType->EVReady); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 118; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 118: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 119; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 119: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVStatusType->EVRESSSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { - int grammarID = 120; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 120: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus ); - } - grammarID = 121; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 121: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent ); - } - grammarID = 122; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit ); - } - grammarID = 123; - } else if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 124; - } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 125; - } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 126; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 127; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 124; - } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 125; - } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 126; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 127; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 124: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 125; - } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 126; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 127; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 125: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 126; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 127; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 126: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 127; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC ); - } - grammarID = 128; - } else if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 129; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 128: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 129; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 129: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType) { - int grammarID = 130; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 130: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 131; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 131: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( v2gServiceType->ServiceName_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gServiceType->ServiceName.characters, v2gServiceType->ServiceName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 132; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 133; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 132: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 133; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 133: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( v2gServiceType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gServiceType->ServiceScope.characters, v2gServiceType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 134; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 134: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { - int grammarID = 86; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 86: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionStopResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ -static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { - int grammarID = 135; - int done = 0; - - unsigned int v2gConsumptionCostType_Cost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 135: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue ); - } - grammarID = 136; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 136: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ - if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 137; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 137: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 138; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 138: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { - int grammarID = 38; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { - int grammarID = 139; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 139: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus ); - } - grammarID = 140; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 140: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage ); - } - grammarID = 141; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 141: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { - int grammarID = 142; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 142: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { - int grammarID = 143; - int done = 0; - - unsigned int v2gSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - if ( v2gSignaturePropertiesType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertiesType->Id.characters, v2gSignaturePropertiesType->Id.charactersLen); - } - } - grammarID = 144; - } else if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 145; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 144: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 145; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 145: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ - if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 145; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { - int grammarID = 146; - int done = 0; - - unsigned int v2gSelectedServiceListType_SelectedService_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 146: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ - if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 147; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 147: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ - if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 147; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { - int grammarID = 148; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 148: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 149; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 149: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList ); - } - grammarID = 150; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 150: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService ); - } - grammarID = 151; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 151: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ - if ( v2gServiceDiscoveryResType->ServiceList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { - int grammarID = 152; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 152: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gEMAIDType->Id.characters, v2gEMAIDType->Id.charactersLen); - } - } - grammarID = 153; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 153: - /* StartTag[CHARACTERS[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->CONTENT.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gEMAIDType->CONTENT.characters, v2gEMAIDType->CONTENT.charactersLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { - int grammarID = 38; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { - int grammarID = 154; - int done = 0; - - unsigned int v2gSignedInfoType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 154: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( v2gSignedInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignedInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignedInfoType->Id.characters, v2gSignedInfoType->Id.charactersLen); - } - } - grammarID = 155; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); - } - grammarID = 156; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 155: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); - } - grammarID = 156; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 156: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod ); - } - grammarID = 157; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 157: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 34; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 34: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 34; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType) { - int grammarID = 142; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 142: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gCableCheckReqType->DC_EVStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ -static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { - int grammarID = 158; - int done = 0; - - unsigned int v2gServiceListType_Service_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 158: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 159; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 160; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 160: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 161; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 161: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 162; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 162: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 163; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 163: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 164; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 164: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 165; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 165: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ -static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { - int grammarID = 166; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 166: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gAC_EVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 167; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 167: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gAC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 168; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 168: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gAC_EVSEStatusType->RCD); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { - int grammarID = 169; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 169: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gDC_EVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 170; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 170: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gDC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 171: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ - if ( v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gDC_EVSEStatusType->EVSEIsolationStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 172; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 172: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { - int grammarID = 173; - int done = 0; - - unsigned int v2gSPKIDataType_SPKISexp_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 173: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - v2gSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 174; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 174: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - v2gSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 174; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 175; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 175: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ - if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - v2gSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 174; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -5424,13 +278,13 @@ static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v /* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType) { - int grammarID = 176; + int grammarID = 6; int done = 0; while(!done) { switch(grammarID) { - case 176: + case 6: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5443,48 +297,48 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 177; + grammarID = 7; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 177: + case 7: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gDC_EVSEStatusType(stream, &v2gCurrentDemandResType->DC_EVSEStatus ); } - grammarID = 178; + grammarID = 8; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 178: + case 8: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentVoltage ); } - grammarID = 179; + grammarID = 9; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 179: + case 9: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentCurrent ); } - grammarID = 180; + grammarID = 10; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 180: + case 10: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5497,12 +351,12 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 181; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 181: + case 11: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5515,12 +369,12 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 182; + grammarID = 12; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 182: + case 12: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5533,31 +387,31 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 183; + grammarID = 13; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 183: + case 13: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ if ( v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumVoltageLimit ); } - grammarID = 184; + grammarID = 14; } else if ( v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit ); } - grammarID = 185; + grammarID = 15; } else if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); } - grammarID = 186; + grammarID = 16; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { @@ -5573,25 +427,25 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 187; + grammarID = 17; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 184: + case 14: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ if ( v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit ); } - grammarID = 185; + grammarID = 15; } else if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); } - grammarID = 186; + grammarID = 16; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { @@ -5607,19 +461,19 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 187; + grammarID = 17; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 185: + case 15: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); } - grammarID = 186; + grammarID = 16; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -5635,7 +489,5621 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 187; + grammarID = 17; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 16: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 17; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 17: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gCurrentDemandResType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 18; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + if ( v2gCurrentDemandResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo ); + } + grammarID = 19; + } else if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ +static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { + int grammarID = 20; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 20: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gAC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 21; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 21: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gAC_EVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 22; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 22: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gAC_EVSEStatusType->RCD); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { + int grammarID = 23; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 23: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPreChargeResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 24: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus ); + } + grammarID = 25; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { + int grammarID = 26; + int done = 0; + + unsigned int v2gSalesTariffType_SalesTariffEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 26: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ + if ( v2gSalesTariffType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSalesTariffType->Id.characters, v2gSalesTariffType->Id.charactersLen); + } + } + grammarID = 27; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 28; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 27: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 28; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 28: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + if ( v2gSalesTariffType->SalesTariffDescription_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.characters, v2gSalesTariffType->SalesTariffDescription.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 29; + } else if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 30; + } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 31; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 29: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 30; + } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 31; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 30: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 31; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 31: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 31; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { + int grammarID = 32; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 32: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + if ( v2gSignaturePropertyType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertyType->Id.characters, v2gSignaturePropertyType->Id.charactersLen); + } + } + grammarID = 33; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 34; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 33: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 34; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 34: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 36; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 36: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 36; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { + int grammarID = 37; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 37: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentServiceSelectionReqType->SelectedPaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 38: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { + int grammarID = 39; + int done = 0; + + unsigned int v2gSPKIDataType_SPKISexp_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 39: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + v2gSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 40; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 40: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + v2gSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 40; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 41; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 41: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + v2gSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 40; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType) { + int grammarID = 42; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 42: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gNotificationType->FaultCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 43; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 43: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ + if ( v2gNotificationType->FaultMsg_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gNotificationType->FaultMsg.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gNotificationType->FaultMsg.characters, v2gNotificationType->FaultMsg.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gObjectType->Encoding_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Encoding.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->Encoding.characters, v2gObjectType->Encoding.charactersLen); + } + } + grammarID = 45; + } else if ( v2gObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); + } + } + grammarID = 46; + } else if ( v2gObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); + } + } + grammarID = 47; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 45: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); + } + } + grammarID = 46; + } else if ( v2gObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); + } + } + grammarID = 47; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 46: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); + } + } + grammarID = 47; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 47: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType) { + int grammarID = 48; + int done = 0; + + unsigned int v2gManifestType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 48: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if ( v2gManifestType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gManifestType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gManifestType->Id.characters, v2gManifestType->Id.charactersLen); + } + } + grammarID = 49; + } else if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); + } + grammarID = 50; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 49: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); + } + grammarID = 50; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 50: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); + } + grammarID = 50; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { + int grammarID = 51; + int done = 0; + + unsigned int v2gParameterSetType_Parameter_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 51: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gParameterSetType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 52; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 52: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ + if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 53; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ + if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 53; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { + int grammarID = 54; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 54: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentServiceSelectionResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { + int grammarID = 55; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 55: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->start); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 56; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 56: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ + if ( v2gRelativeTimeIntervalType->duration_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->duration); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { + int grammarID = 57; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.characters, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); + } + } + grammarID = 58; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ +static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { + int grammarID = 59; + int done = 0; + + unsigned int v2gSubCertificatesType_Certificate_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 59: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 60; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 60: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 61; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 61: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 62; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 62: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ +static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType) { + int grammarID = 63; + int done = 0; + + unsigned int v2gPaymentOptionListType_PaymentOption_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 63: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ + if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 64: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ + if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ +static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { + int grammarID = 65; + int done = 0; + + unsigned int v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 65: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + if ( v2gSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval ); + } + grammarID = 66; + } else if ( v2gSalesTariffEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval ); + } + grammarID = 66; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 66: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if ( v2gSalesTariffEntryType->EPriceLevel_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffEntryType->EPriceLevel - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 67; + } else if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 68; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 67: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 68; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 68: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 69; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 69: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ +static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { + int grammarID = 70; + int done = 0; + + unsigned int v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 70: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 71: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 72; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 72: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 73; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 74; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 74: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 75; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 75: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType) { + int grammarID = 76; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 76: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gSelectedServiceType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 77; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 77: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID), END_ELEMENT] */ + if ( v2gSelectedServiceType->ParameterSetID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gSelectedServiceType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { + int grammarID = 23; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 23: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gWeldingDetectionResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 24: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus ); + } + grammarID = 25; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + int grammarID = 78; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 78: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gPowerDeliveryReqType->ChargeProgress); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 79; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 79: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gPowerDeliveryReqType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 80; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 80: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( v2gPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile ); + } + grammarID = 81; + } else if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 5; + } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 81: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 5; + } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ +static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { + int grammarID = 82; + int done = 0; + + unsigned int v2gConsumptionCostType_Cost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 82: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue ); + } + grammarID = 83; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ + if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 84; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 84: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 85; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 85: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { + int grammarID = 86; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 86: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + if ( v2gDC_EVChargeParameterType->DepartureTime_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gDC_EVChargeParameterType->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 87; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); + } + grammarID = 88; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 87: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); + } + grammarID = 88; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 88: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit ); + } + grammarID = 89; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 89: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + if ( v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit ); + } + grammarID = 90; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); + } + grammarID = 91; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 90: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); + } + grammarID = 91; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 91: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity ); + } + grammarID = 92; + } else if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 93; + } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 94; + } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 93; + } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 94; + } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 93: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 94; + } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { + int grammarID = 95; + int done = 0; + + unsigned int v2gChargingProfileType_ProfileEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ + if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 96; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 96: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 96; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { + int grammarID = 97; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 97: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ + if ( v2gMeteringReceiptReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gMeteringReceiptReqType->Id.characters, v2gMeteringReceiptReqType->Id.charactersLen); + } + } + grammarID = 98; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 99; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 98: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 99; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 99: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ + if ( v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gMeteringReceiptReqType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 100; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 100: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { + int grammarID = 101; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 101: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ + if ( v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 102; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 103; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 102: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 103; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 103: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ + if ( v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter ); + } + grammarID = 5; + } else if ( v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter ); + } + grammarID = 5; + } else if ( v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { + int grammarID = 104; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 104: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + if ( v2gBodyType->AuthorizationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 0); + if(errn == 0) { + errn = encode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq ); + } + grammarID = 5; + } else if ( v2gBodyType->AuthorizationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 1); + if(errn == 0) { + errn = encode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes ); + } + grammarID = 5; + } else if ( v2gBodyType->BodyElement_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 2); + if(errn == 0) { + errn = encode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement ); + } + grammarID = 5; + } else if ( v2gBodyType->CableCheckReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 3); + if(errn == 0) { + errn = encode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq ); + } + grammarID = 5; + } else if ( v2gBodyType->CableCheckRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 4); + if(errn == 0) { + errn = encode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes ); + } + grammarID = 5; + } else if ( v2gBodyType->CertificateInstallationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 5); + if(errn == 0) { + errn = encode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq ); + } + grammarID = 5; + } else if ( v2gBodyType->CertificateInstallationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 6); + if(errn == 0) { + errn = encode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes ); + } + grammarID = 5; + } else if ( v2gBodyType->CertificateUpdateReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 7); + if(errn == 0) { + errn = encode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq ); + } + grammarID = 5; + } else if ( v2gBodyType->CertificateUpdateRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 8); + if(errn == 0) { + errn = encode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes ); + } + grammarID = 5; + } else if ( v2gBodyType->ChargeParameterDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 9); + if(errn == 0) { + errn = encode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq ); + } + grammarID = 5; + } else if ( v2gBodyType->ChargeParameterDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 10); + if(errn == 0) { + errn = encode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes ); + } + grammarID = 5; + } else if ( v2gBodyType->ChargingStatusReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 11); + if(errn == 0) { + errn = encode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq ); + } + grammarID = 5; + } else if ( v2gBodyType->ChargingStatusRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 12); + if(errn == 0) { + errn = encode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes ); + } + grammarID = 5; + } else if ( v2gBodyType->CurrentDemandReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 13); + if(errn == 0) { + errn = encode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq ); + } + grammarID = 5; + } else if ( v2gBodyType->CurrentDemandRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 14); + if(errn == 0) { + errn = encode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes ); + } + grammarID = 5; + } else if ( v2gBodyType->MeteringReceiptReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 15); + if(errn == 0) { + errn = encode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq ); + } + grammarID = 5; + } else if ( v2gBodyType->MeteringReceiptRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 16); + if(errn == 0) { + errn = encode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes ); + } + grammarID = 5; + } else if ( v2gBodyType->PaymentDetailsReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 17); + if(errn == 0) { + errn = encode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq ); + } + grammarID = 5; + } else if ( v2gBodyType->PaymentDetailsRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 18); + if(errn == 0) { + errn = encode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes ); + } + grammarID = 5; + } else if ( v2gBodyType->PaymentServiceSelectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 19); + if(errn == 0) { + errn = encode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq ); + } + grammarID = 5; + } else if ( v2gBodyType->PaymentServiceSelectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 20); + if(errn == 0) { + errn = encode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes ); + } + grammarID = 5; + } else if ( v2gBodyType->PowerDeliveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 21); + if(errn == 0) { + errn = encode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq ); + } + grammarID = 5; + } else if ( v2gBodyType->PowerDeliveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 22); + if(errn == 0) { + errn = encode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes ); + } + grammarID = 5; + } else if ( v2gBodyType->PreChargeReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 23); + if(errn == 0) { + errn = encode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq ); + } + grammarID = 5; + } else if ( v2gBodyType->PreChargeRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 24); + if(errn == 0) { + errn = encode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes ); + } + grammarID = 5; + } else if ( v2gBodyType->ServiceDetailReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 25); + if(errn == 0) { + errn = encode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq ); + } + grammarID = 5; + } else if ( v2gBodyType->ServiceDetailRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 26); + if(errn == 0) { + errn = encode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes ); + } + grammarID = 5; + } else if ( v2gBodyType->ServiceDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 27); + if(errn == 0) { + errn = encode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq ); + } + grammarID = 5; + } else if ( v2gBodyType->ServiceDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 28); + if(errn == 0) { + errn = encode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes ); + } + grammarID = 5; + } else if ( v2gBodyType->SessionSetupReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 29); + if(errn == 0) { + errn = encode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq ); + } + grammarID = 5; + } else if ( v2gBodyType->SessionSetupRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 30); + if(errn == 0) { + errn = encode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes ); + } + grammarID = 5; + } else if ( v2gBodyType->SessionStopReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 31); + if(errn == 0) { + errn = encode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq ); + } + grammarID = 5; + } else if ( v2gBodyType->SessionStopRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 32); + if(errn == 0) { + errn = encode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes ); + } + grammarID = 5; + } else if ( v2gBodyType->WeldingDetectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 33); + if(errn == 0) { + errn = encode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq ); + } + grammarID = 5; + } else if ( v2gBodyType->WeldingDetectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 34); + if(errn == 0) { + errn = encode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 6, 35); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType) { + int grammarID = 105; + int done = 0; + + unsigned int v2gTransformsType_Transform_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 105: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); + } + grammarID = 106; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 106: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); + } + grammarID = 106; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { + int grammarID = 107; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 107: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( v2gServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gServiceDiscoveryReqType->ServiceScope.characters, v2gServiceDiscoveryReqType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 108; + } else if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 108: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ +static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { + int grammarID = 109; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 109: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gEVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 110; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 110: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gEVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { + int grammarID = 111; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 111: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gProfileEntryType->ChargingProfileEntryStart); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 112; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 112: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower ); + } + grammarID = 113; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 113: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ + if ( v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, (uint32_t)(v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType) { + int grammarID = 114; + int done = 0; + + unsigned int v2gKeyInfoType_KeyName_currArrayIndex = 0; + unsigned int v2gKeyInfoType_KeyValue_currArrayIndex = 0; + unsigned int v2gKeyInfoType_RetrievalMethod_currArrayIndex = 0; + unsigned int v2gKeyInfoType_X509Data_currArrayIndex = 0; + unsigned int v2gKeyInfoType_PGPData_currArrayIndex = 0; + unsigned int v2gKeyInfoType_SPKIData_currArrayIndex = 0; + unsigned int v2gKeyInfoType_MgmtData_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 114: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( v2gKeyInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->Id.characters, v2gKeyInfoType->Id.charactersLen); + } + } + grammarID = 115; + } else if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 7); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 116; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 117; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 115: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 116; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 117; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 116: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 116; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 4, 8); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 116; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 117: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 116; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 116; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 116; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 117; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { + int grammarID = 118; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 118: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMessageHeaderType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMessageHeaderType->SessionID.bytes, v2gMessageHeaderType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 119; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( v2gMessageHeaderType->Notification_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification ); + } + grammarID = 120; + } else if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 120: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { + int grammarID = 121; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 121: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gServiceDetailReqType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ +static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { + int grammarID = 122; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 122: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus ); + } + grammarID = 123; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 123: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage ); + } + grammarID = 124; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 124: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { + int grammarID = 125; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 125: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateUpdateReqType->Id.characters, v2gCertificateUpdateReqType->Id.charactersLen); + } + } + grammarID = 126; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 126: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain ); + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 127: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->eMAID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateUpdateReqType->eMAID.characters, v2gCertificateUpdateReqType->eMAID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 128; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 128: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { + int grammarID = 129; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 129: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gPhysicalValueType->Multiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 130; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 130: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gPhysicalValueType->Unit); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 131; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 131: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gPhysicalValueType->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { + int grammarID = 132; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 132: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.characters, v2gX509IssuerSerialType->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 133; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 133: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gX509IssuerSerialType->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { + int grammarID = 134; + int done = 0; + + unsigned int v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 134: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */ + if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); + } + grammarID = 135; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 135: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), END_ELEMENT] */ + if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); + } + grammarID = 135; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { + int grammarID = 136; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 136: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 137; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 137: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList ); + } + grammarID = 138; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 138: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService ); + } + grammarID = 139; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 139: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ + if ( v2gServiceDiscoveryResType->ServiceList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { + int grammarID = 140; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 140: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.characters, v2gPaymentDetailsReqType->eMAID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 141; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 141: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { + int grammarID = 142; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 142: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + if ( v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval ); + } + grammarID = 143; + } else if ( v2gPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval ); + } + grammarID = 143; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 143: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { + int grammarID = 144; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 144: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateUpdateResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 145: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain ); + } + grammarID = 146; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 146: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain ); + } + grammarID = 147; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 147: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey ); + } + grammarID = 148; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 148: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey ); + } + grammarID = 149; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 149: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID ); + } + grammarID = 150; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 150: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ + if ( v2gCertificateUpdateResType->RetryCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gCertificateUpdateResType->RetryCounter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ +static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { + int grammarID = 151; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 151: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateInstallationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 152; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 152: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain ); + } + grammarID = 153; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 153: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain ); + } + grammarID = 154; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 154: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey ); + } + grammarID = 155; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 155: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey ); + } + grammarID = 156; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 156: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType) { + int grammarID = 157; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 157: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gCableCheckReqType->DC_EVStatus ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { + int grammarID = 158; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 158: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + if ( v2gPGPDataType->PGPKeyID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPGPDataType->PGPKeyID.bytes, v2gPGPDataType->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 159; + } else if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 160; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 159: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 160; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 160; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 160: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 160; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { + int grammarID = 161; + int done = 0; + + unsigned int v2gServiceParameterListType_ParameterSet_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 161: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ + if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 162; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 162: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ + if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 162; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ +static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { + int grammarID = 163; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 163: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gSessionStopReqType->ChargingSession); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { + int grammarID = 0; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { + int grammarID = 157; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 157: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { + int grammarID = 57; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.characters, v2gDiffieHellmanPublickeyType->Id.charactersLen); + } + } + grammarID = 58; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytes, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { + int grammarID = 164; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 164: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupReqType->EVCCID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytes, v2gSessionSetupReqType->EVCCID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { + int grammarID = 165; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 165: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus ); + } + grammarID = 166; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 166: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent ); + } + grammarID = 167; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 167: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit ); + } + grammarID = 168; + } else if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 169; + } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 170; + } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 171; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 172; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 168: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 169; + } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 170; + } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 171; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 172; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 169: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 170; + } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 171; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 172; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 170: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 171; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 172; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 171: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 172; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 172: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC ); + } + grammarID = 173; + } else if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 174; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 173: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 174; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 174: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { + int grammarID = 175; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 175: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVStatusType->EVReady); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 176; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 176: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 177; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 177: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVStatusType->EVRESSSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { + int grammarID = 178; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 178: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( v2gDSAKeyValueType->P_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->P.bytes, v2gDSAKeyValueType->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 179; + } else if ( v2gDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 180; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 181; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 179: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + if ( v2gDSAKeyValueType->Q_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Q.bytes, v2gDSAKeyValueType->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 182; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 182: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( v2gDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 180; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 181; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 180: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 181; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 181: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( v2gDSAKeyValueType->J_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->J.bytes, v2gDSAKeyValueType->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 183; + } else if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 184; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 183: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 184; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 184: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + if ( v2gDSAKeyValueType->PgenCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytes, v2gDSAKeyValueType->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { + int grammarID = 185; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 185: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gChargingStatusResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 186; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -5649,9 +6117,9 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); + errn = encodeCharacters(stream, v2gChargingStatusResType->EVSEID.characters, v2gChargingStatusResType->EVSEID.charactersLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5670,7 +6138,7 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gCurrentDemandResType->SAScheduleTupleID - 1)); + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gChargingStatusResType->SAScheduleTupleID - 1)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -5681,2664 +6149,311 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } break; case 188: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ - if ( v2gCurrentDemandResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( v2gChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo ); + errn = encode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent ); } grammarID = 189; - } else if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); + } else if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); + } + grammarID = 190; + } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); + grammarID = 191; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { - done = 1; + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 189: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ - if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); + } + grammarID = 190; + } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 191; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 190: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType) { - int grammarID = 190; - int done = 0; - - unsigned int v2gKeyInfoType_KeyName_currArrayIndex = 0; - unsigned int v2gKeyInfoType_KeyValue_currArrayIndex = 0; - unsigned int v2gKeyInfoType_RetrievalMethod_currArrayIndex = 0; - unsigned int v2gKeyInfoType_X509Data_currArrayIndex = 0; - unsigned int v2gKeyInfoType_PGPData_currArrayIndex = 0; - unsigned int v2gKeyInfoType_SPKIData_currArrayIndex = 0; - unsigned int v2gKeyInfoType_MgmtData_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 190: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( v2gKeyInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->Id.characters, v2gKeyInfoType->Id.charactersLen); - } - } grammarID = 191; - } else if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); } - grammarID = 192; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 7); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 193; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 191: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); } - grammarID = 192; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 193; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 192: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 192; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 192; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 4, 8); + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 192; + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { + int grammarID = 192; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 192: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( v2gReferenceType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->Id.characters, v2gReferenceType->Id.charactersLen); + } + } + grammarID = 193; + } else if ( v2gReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); + } + } + grammarID = 194; + } else if ( v2gReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); + } + } + grammarID = 195; + } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); + } + grammarID = 196; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); + } + grammarID = 197; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 193: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( v2gReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); } } - grammarID = 192; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); + grammarID = 194; + } else if ( v2gReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 192; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); } } - grammarID = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 193; + grammarID = 195; + } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); + } + grammarID = 196; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); + } + grammarID = 197; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { - int grammarID = 194; - int done = 0; - - - while(!done) { - switch(grammarID) { case 194: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gObjectType->Encoding_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( v2gReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Encoding.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->Encoding.characters, v2gObjectType->Encoding.charactersLen); + errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); } } grammarID = 195; - } else if ( v2gObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); + } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); - } + errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); } grammarID = 196; - } else if ( v2gObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); - } + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 68; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; + grammarID = 197; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 195: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( v2gReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); - } + errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); } grammarID = 196; - } else if ( v2gObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); - } + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 68; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; + grammarID = 197; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 196: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); - } + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 68; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; + grammarID = 197; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 68: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { - int grammarID = 197; - int done = 0; - - - while(!done) { - switch(grammarID) { case 197: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSAScheduleTupleType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 198; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 198: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule ); - } - grammarID = 199; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 199: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ - if ( v2gSAScheduleTupleType->SalesTariff_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { - int grammarID = 200; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 200: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - if ( v2gSignatureValueType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignatureValueType->Id.characters, v2gSignatureValueType->Id.charactersLen); - } - } - grammarID = 6; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 6: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { - int grammarID = 69; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 69: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPowerDeliveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 70; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 70: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ - if ( v2gPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus ); - } - grammarID = 3; - } else if ( v2gPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus ); - } - grammarID = 3; - } else if ( v2gPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ -static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { - int grammarID = 201; - int done = 0; - - unsigned int v2gSubCertificatesType_Certificate_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 201: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->DigestValue.bytesLen)); if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; + errn = encodeBytes(stream, v2gReferenceType->DigestValue.bytes, v2gReferenceType->DigestValue.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 202; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 203; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 203: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 204; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 204: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { - int grammarID = 205; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 205: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ - if ( v2gAuthorizationReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gAuthorizationReqType->Id.characters, v2gAuthorizationReqType->Id.charactersLen); - } - } - grammarID = 206; - } else if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 206: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ - if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { - int grammarID = 207; - int done = 0; - - unsigned int v2gChargingProfileType_ProfileEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 207: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ - if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 208; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 208: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 208; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { - int grammarID = 209; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 209: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - if ( v2gEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval ); - } - grammarID = 3; - } else if ( v2gEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gEntryType->TimeInterval ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { - int grammarID = 210; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 210: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCableCheckResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 211; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 211: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus ); - } - grammarID = 94; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gCableCheckResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ -static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { - int grammarID = 212; - int done = 0; - - unsigned int v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 212: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 213; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 213: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 214; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 215; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 215: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 216; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 216: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 217; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 217: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { - int grammarID = 218; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 218: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gPhysicalValueType->Multiplier + 3)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 219; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 219: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gPhysicalValueType->Unit); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 220; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 220: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gPhysicalValueType->Value); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { - int grammarID = 221; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 221: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gChargeParameterDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 222; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 222: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeParameterDiscoveryResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 223; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 223: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ - if ( v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList ); - } - grammarID = 224; - } else if ( v2gChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules ); - } - grammarID = 224; - } else if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 224: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ - if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { - int grammarID = 225; - int done = 0; - - unsigned int v2gParameterSetType_Parameter_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 225: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gParameterSetType->ParameterSetID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 226; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 226: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ - if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 227; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 227: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ - if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 227; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { - int grammarID = 228; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 228: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.characters, v2gPaymentDetailsReqType->eMAID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 229; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType) { - int grammarID = 230; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 230: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->MeterID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gMeterInfoType->MeterID.characters, v2gMeterInfoType->MeterID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 231: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->MeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger64(stream, v2gMeterInfoType->MeterReading); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 232; - } else if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 233; - } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 234; - } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 232: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 233; - } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 234; - } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 233: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 234; - } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 234: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { - int grammarID = 235; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 235: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentServiceSelectionReqType->SelectedPaymentOption); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 236; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { - int grammarID = 237; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 237: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( v2gRetrievalMethodType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gRetrievalMethodType->Type.characters, v2gRetrievalMethodType->Type.charactersLen); - } - } - grammarID = 238; - } else if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 239; - } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 238: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 239; - } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 239: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { - int grammarID = 240; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 240: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupReqType->EVCCID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytes, v2gSessionSetupReqType->EVCCID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { - int grammarID = 241; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 241: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - if ( v2gDC_EVChargeParameterType->DepartureTime_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gDC_EVChargeParameterType->DepartureTime); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 242; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); - } - grammarID = 243; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 242: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); - } - grammarID = 243; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 243: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit ); - } - grammarID = 244; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 244: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit ); - } - grammarID = 245; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 246; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 245: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 246; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 246: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity ); - } - grammarID = 247; - } else if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 248; - } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 249; - } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 247: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 248; - } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 249; - } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 248: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 249; - } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 249: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDef":Header,"urn:iso:15118:2:2013:MsgDef":Body)', derivedBy='RESTRICTION'. */ -static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { - int grammarID = 250; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 250: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header ); - } - grammarID = 251; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 251: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { - int grammarID = 252; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 252: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus ); - } - grammarID = 253; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 253: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ - if ( v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 254; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 254: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { - int grammarID = 255; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 255: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->start); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 256; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 256: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ - if ( v2gRelativeTimeIntervalType->duration_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->duration); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -8356,13 +6471,13 @@ static int encode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRel /* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType) { - int grammarID = 257; + int grammarID = 198; int done = 0; while(!done) { switch(grammarID) { - case 257: + case 198: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -8378,12 +6493,12 @@ static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 258; + grammarID = 199; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 258: + case 199: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -8399,19 +6514,19 @@ static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -8427,1557 +6542,46 @@ static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueT return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { - int grammarID = 259; +/* Complex type name='urn:iso:15118:2:2013:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDef":Header,"urn:iso:15118:2:2013:MsgDef":Body)', derivedBy='RESTRICTION'. */ +static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { + int grammarID = 200; int done = 0; while(!done) { switch(grammarID) { - case 259: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - if ( v2gPGPDataType->PGPKeyID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPGPDataType->PGPKeyID.bytes, v2gPGPDataType->PGPKeyID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 260; - } else if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 261; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 260: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 261; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 261; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 261: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 261; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - int grammarID = 262; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 262: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + case 200: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateUpdateResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header ); } - grammarID = 263; + grammarID = 201; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 263: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + case 201: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain ); + errn = encode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body ); } - grammarID = 264; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 264: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain ); - } - grammarID = 265; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 265: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey ); - } - grammarID = 266; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 266: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey ); - } - grammarID = 267; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 267: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID ); - } - grammarID = 268; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 268: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ - if ( v2gCertificateUpdateResType->RetryCounter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gCertificateUpdateResType->RetryCounter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { - int grammarID = 269; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 269: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentDetailsResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 270; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 270: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsResType->GenChallenge.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytes, v2gPaymentDetailsResType->GenChallenge.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 271; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 271: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gPaymentDetailsResType->EVSETimeStamp); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { - int grammarID = 272; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 272: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( v2gDSAKeyValueType->P_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->P.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->P.bytes, v2gDSAKeyValueType->P.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 273; - } else if ( v2gDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 274; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 275; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 273: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - if ( v2gDSAKeyValueType->Q_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Q.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Q.bytes, v2gDSAKeyValueType->Q.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 276; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 276: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( v2gDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 274; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 275; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 274: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 275; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 275: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( v2gDSAKeyValueType->J_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->J.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->J.bytes, v2gDSAKeyValueType->J.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 277; - } else if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 278; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 277: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 278; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 278: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - if ( v2gDSAKeyValueType->PgenCounter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->PgenCounter.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytes, v2gDSAKeyValueType->PgenCounter.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { - int grammarID = 279; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 279: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ - if ( v2gBodyType->AuthorizationReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 0); - if(errn == 0) { - errn = encode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq ); - } - grammarID = 3; - } else if ( v2gBodyType->AuthorizationRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 1); - if(errn == 0) { - errn = encode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes ); - } - grammarID = 3; - } else if ( v2gBodyType->BodyElement_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 2); - if(errn == 0) { - errn = encode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement ); - } - grammarID = 3; - } else if ( v2gBodyType->CableCheckReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 3); - if(errn == 0) { - errn = encode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq ); - } - grammarID = 3; - } else if ( v2gBodyType->CableCheckRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 4); - if(errn == 0) { - errn = encode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes ); - } - grammarID = 3; - } else if ( v2gBodyType->CertificateInstallationReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 5); - if(errn == 0) { - errn = encode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq ); - } - grammarID = 3; - } else if ( v2gBodyType->CertificateInstallationRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 6); - if(errn == 0) { - errn = encode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes ); - } - grammarID = 3; - } else if ( v2gBodyType->CertificateUpdateReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 7); - if(errn == 0) { - errn = encode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq ); - } - grammarID = 3; - } else if ( v2gBodyType->CertificateUpdateRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 8); - if(errn == 0) { - errn = encode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes ); - } - grammarID = 3; - } else if ( v2gBodyType->ChargeParameterDiscoveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 9); - if(errn == 0) { - errn = encode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq ); - } - grammarID = 3; - } else if ( v2gBodyType->ChargeParameterDiscoveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 10); - if(errn == 0) { - errn = encode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes ); - } - grammarID = 3; - } else if ( v2gBodyType->ChargingStatusReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 11); - if(errn == 0) { - errn = encode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq ); - } - grammarID = 3; - } else if ( v2gBodyType->ChargingStatusRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 12); - if(errn == 0) { - errn = encode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes ); - } - grammarID = 3; - } else if ( v2gBodyType->CurrentDemandReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 13); - if(errn == 0) { - errn = encode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq ); - } - grammarID = 3; - } else if ( v2gBodyType->CurrentDemandRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 14); - if(errn == 0) { - errn = encode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes ); - } - grammarID = 3; - } else if ( v2gBodyType->MeteringReceiptReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 15); - if(errn == 0) { - errn = encode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq ); - } - grammarID = 3; - } else if ( v2gBodyType->MeteringReceiptRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 16); - if(errn == 0) { - errn = encode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes ); - } - grammarID = 3; - } else if ( v2gBodyType->PaymentDetailsReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 17); - if(errn == 0) { - errn = encode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq ); - } - grammarID = 3; - } else if ( v2gBodyType->PaymentDetailsRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 18); - if(errn == 0) { - errn = encode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes ); - } - grammarID = 3; - } else if ( v2gBodyType->PaymentServiceSelectionReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 19); - if(errn == 0) { - errn = encode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq ); - } - grammarID = 3; - } else if ( v2gBodyType->PaymentServiceSelectionRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 20); - if(errn == 0) { - errn = encode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes ); - } - grammarID = 3; - } else if ( v2gBodyType->PowerDeliveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 21); - if(errn == 0) { - errn = encode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq ); - } - grammarID = 3; - } else if ( v2gBodyType->PowerDeliveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 22); - if(errn == 0) { - errn = encode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes ); - } - grammarID = 3; - } else if ( v2gBodyType->PreChargeReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 23); - if(errn == 0) { - errn = encode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq ); - } - grammarID = 3; - } else if ( v2gBodyType->PreChargeRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 24); - if(errn == 0) { - errn = encode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes ); - } - grammarID = 3; - } else if ( v2gBodyType->ServiceDetailReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 25); - if(errn == 0) { - errn = encode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq ); - } - grammarID = 3; - } else if ( v2gBodyType->ServiceDetailRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 26); - if(errn == 0) { - errn = encode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes ); - } - grammarID = 3; - } else if ( v2gBodyType->ServiceDiscoveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 27); - if(errn == 0) { - errn = encode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq ); - } - grammarID = 3; - } else if ( v2gBodyType->ServiceDiscoveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 28); - if(errn == 0) { - errn = encode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes ); - } - grammarID = 3; - } else if ( v2gBodyType->SessionSetupReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 29); - if(errn == 0) { - errn = encode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq ); - } - grammarID = 3; - } else if ( v2gBodyType->SessionSetupRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 30); - if(errn == 0) { - errn = encode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes ); - } - grammarID = 3; - } else if ( v2gBodyType->SessionStopReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 31); - if(errn == 0) { - errn = encode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq ); - } - grammarID = 3; - } else if ( v2gBodyType->SessionStopRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 32); - if(errn == 0) { - errn = encode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes ); - } - grammarID = 3; - } else if ( v2gBodyType->WeldingDetectionReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 33); - if(errn == 0) { - errn = encode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq ); - } - grammarID = 3; - } else if ( v2gBodyType->WeldingDetectionRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 34); - if(errn == 0) { - errn = encode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 6, 35); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { - int grammarID = 280; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 280: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateInstallationReqType->Id.characters, v2gCertificateInstallationReqType->Id.charactersLen); - } - } - grammarID = 281; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 281: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 100; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 100: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { - int grammarID = 282; - int done = 0; - - unsigned int v2gServiceParameterListType_ParameterSet_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 282: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ - if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 283; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 283: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ - if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 283; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType) { - int grammarID = 38; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ -static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType) { - int grammarID = 284; - int done = 0; - - unsigned int v2gSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 284: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */ - if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 285; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 285: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ - if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 286; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 286: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ - if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType) { - int grammarID = 67; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 67: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDigestMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gDigestMethodType->Algorithm.characters, v2gDigestMethodType->Algorithm.charactersLen); - } - } - grammarID = 68; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 68: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { - int grammarID = 287; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 287: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gCostType->costKind); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 288; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 288: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gCostType->amount); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 289; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 289: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ - if ( v2gCostType->amountMultiplier_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gCostType->amountMultiplier + 3)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { - int grammarID = 290; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 290: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMessageHeaderType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMessageHeaderType->SessionID.bytes, v2gMessageHeaderType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 291; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 291: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( v2gMessageHeaderType->Notification_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification ); - } - grammarID = 292; - } else if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 292: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { - int grammarID = 293; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 293: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceDetailReqType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType) { - int grammarID = 294; - int done = 0; - - unsigned int v2gTransformsType_Transform_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 294: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); - } - grammarID = 295; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 295: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ - if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); - } - grammarID = 295; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { - int grammarID = 296; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 296: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gWeldingDetectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 297; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 297: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus ); - } - grammarID = 298; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 298: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { - int grammarID = 296; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 296: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPreChargeResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 297; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 297: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus ); - } - grammarID = 298; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 298: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9995,13 +6599,13 @@ static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeRe /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { - int grammarID = 299; + int grammarID = 202; int done = 0; while(!done) { switch(grammarID) { - case 299: + case 202: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ if ( v2gAC_EVChargeParameterType->DepartureTime_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -10014,73 +6618,73 @@ static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 300; + grammarID = 203; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount ); } - grammarID = 301; + grammarID = 204; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 300: + case 203: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount ); } - grammarID = 301; + grammarID = 204; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 301: + case 204: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage ); } - grammarID = 302; + grammarID = 205; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 302: + case 205: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxCurrent ); } - grammarID = 303; + grammarID = 206; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 303: + case 206: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMinCurrent ); } - grammarID = 3; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10096,125 +6700,951 @@ static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_ return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ -static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { - int grammarID = 304; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { + int grammarID = 207; int done = 0; - unsigned int v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 304: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - if ( v2gSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + case 207: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval ); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignatureMethodType->Algorithm.characters, v2gSignatureMethodType->Algorithm.charactersLen); + } } - grammarID = 305; - } else if ( v2gSalesTariffEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval ); - } - grammarID = 305; + grammarID = 208; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 305: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if ( v2gSalesTariffEntryType->EPriceLevel_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + case 208: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffEntryType->EPriceLevel - 0)); + errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 306; - } else if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + grammarID = 35; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 209; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + done = 1; } - grammarID = 307; + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 209: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 35; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 209; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { + int grammarID = 210; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 210: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateInstallationReqType->Id.characters, v2gCertificateInstallationReqType->Id.charactersLen); + } + } + grammarID = 211; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 211: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 128; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 128: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { + int grammarID = 212; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 212: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + if ( v2gCertificateChainType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateChainType->Id.characters, v2gCertificateChainType->Id.charactersLen); + } + } + grammarID = 213; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 214; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 213: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 214; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 214: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), END_ELEMENT] */ + if ( v2gCertificateChainType->SubCertificates_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { + int grammarID = 215; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 215: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionSetupResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 216; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 216: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSessionSetupResType->EVSEID.characters, v2gSessionSetupResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 217; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ + if ( v2gSessionSetupResType->EVSETimeStamp_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gSessionSetupResType->EVSETimeStamp); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { + int grammarID = 218; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 218: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gCostType->costKind); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 219; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 219: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gCostType->amount); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 220; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 220: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + if ( v2gCostType->amountMultiplier_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gCostType->amountMultiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { + int grammarID = 221; + int done = 0; + + unsigned int v2gX509DataType_X509IssuerSerial_currArrayIndex = 0; + unsigned int v2gX509DataType_X509SKI_currArrayIndex = 0; + unsigned int v2gX509DataType_X509SubjectName_currArrayIndex = 0; + unsigned int v2gX509DataType_X509Certificate_currArrayIndex = 0; + unsigned int v2gX509DataType_X509CRL_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 221: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 222; + } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); + v2gX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); + v2gX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); + v2gX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); + v2gX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 222; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 222: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 222; + } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); + v2gX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); + v2gX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); + v2gX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); + v2gX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 222; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 6); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { + int grammarID = 223; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 223: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gEMAIDType->Id.characters, v2gEMAIDType->Id.charactersLen); + } + } + grammarID = 224; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 224: + /* StartTag[CHARACTERS[STRING]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->CONTENT.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gEMAIDType->CONTENT.characters, v2gEMAIDType->CONTENT.charactersLen); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType) { + int grammarID = 225; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 225: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->MeterID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gMeterInfoType->MeterID.characters, v2gMeterInfoType->MeterID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 226; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 226: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->MeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger64(stream, v2gMeterInfoType->MeterReading); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 227; + } else if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 228; + } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 229; + } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 227: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 228; + } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 229; + } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 228: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 229; + } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 306: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + case 229: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 307; + grammarID = 5; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 307: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 308; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 308: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10230,52 +7660,107 @@ static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTa return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { - int grammarID = 309; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { + int grammarID = 230; int done = 0; while(!done) { switch(grammarID) { - case 309: + case 230: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gAuthorizationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 231; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gAuthorizationResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { + int grammarID = 232; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 232: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - if ( v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { + if ( v2gEntryType->RelativeTimeInterval_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval ); + errn = encode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval ); } - grammarID = 310; - } else if ( v2gPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { + grammarID = 5; + } else if ( v2gEntryType->TimeInterval_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval ); + errn = encode_v2gIntervalType(stream, &v2gEntryType->TimeInterval ); } - grammarID = 310; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 310: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10291,182 +7776,1128 @@ static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxSc return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { - int grammarID = 38; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType) { + int grammarID = 233; int done = 0; while(!done) { switch(grammarID) { - case 38: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { - int grammarID = 311; - int done = 0; - - unsigned int v2gSalesTariffType_SalesTariffEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 311: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ - if ( v2gSalesTariffType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSalesTariffType->Id.characters, v2gSalesTariffType->Id.charactersLen); - } - } - grammarID = 312; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 313; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 312: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ + case 233: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); + errn = encodeUnsignedInteger16(stream, v2gServiceType->ServiceID); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 313; + grammarID = 234; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 313: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - if ( v2gSalesTariffType->SalesTariffDescription_isUsed == 1u ) { + case 234: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( v2gServiceType->ServiceName_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[STRING]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceName.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.characters, v2gSalesTariffType->SalesTariffDescription.charactersLen); + errn = encodeCharacters(stream, v2gServiceType->ServiceName.characters, v2gServiceType->ServiceName.charactersLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 314; - } else if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { + grammarID = 235; + } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 315; - } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 316; + grammarID = 236; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 314: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 315; - } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 316; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 315: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + case 235: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 316; + grammarID = 236; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 316: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + case 236: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( v2gServiceType->ServiceScope_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gServiceType->ServiceScope.characters, v2gServiceType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 316; + grammarID = 237; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 237: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { + int grammarID = 238; + int done = 0; + + unsigned int v2gSelectedServiceListType_SelectedService_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 238: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ + if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 239; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 239: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ + if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 239; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ +static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType) { + int grammarID = 240; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 240: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gChargeServiceType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 241; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 241: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( v2gChargeServiceType->ServiceName_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gChargeServiceType->ServiceName.characters, v2gChargeServiceType->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 242; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 243; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 242: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 243; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 243: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( v2gChargeServiceType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gChargeServiceType->ServiceScope.characters, v2gChargeServiceType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 244; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 245; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 244: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 245; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 245: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { + int grammarID = 246; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 246: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDetailResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 247; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 247: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gServiceDetailResType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 248; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 248: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ + if ( v2gServiceDetailResType->ServiceParameterList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { + int grammarID = 249; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 249: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + if ( v2gSignatureValueType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignatureValueType->Id.characters, v2gSignatureValueType->Id.charactersLen); + } + } + grammarID = 58; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { + int grammarID = 250; + int done = 0; + + unsigned int v2gSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 250: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if ( v2gSignaturePropertiesType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertiesType->Id.characters, v2gSignaturePropertiesType->Id.charactersLen); + } + } + grammarID = 251; + } else if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 252; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 251: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 252; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 252: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 252; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { + int grammarID = 253; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 253: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ + if ( v2gAuthorizationReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gAuthorizationReqType->Id.characters, v2gAuthorizationReqType->Id.charactersLen); + } + } + grammarID = 254; + } else if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 254: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ + if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType) { + int grammarID = 0; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { + int grammarID = 255; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 255: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus ); + } + grammarID = 256; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 256: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); + } + grammarID = 257; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 257: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); + } + grammarID = 258; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 258: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); + } + grammarID = 259; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 259: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); + } + grammarID = 260; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 260: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); + } + grammarID = 261; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 261: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); + } + grammarID = 262; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 263; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 262: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 263; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 263: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + if ( v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ +static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType) { + int grammarID = 264; + int done = 0; + + unsigned int v2gSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 264: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */ + if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 265; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 265: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ + if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 266; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 266: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ + if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType) { + int grammarID = 267; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 267: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDigestMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gDigestMethodType->Algorithm.characters, v2gDigestMethodType->Algorithm.charactersLen); + } + } + grammarID = 47; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 47: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { + int grammarID = 268; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 268: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); + } + grammarID = 269; + } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); + } + grammarID = 269; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 269; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 270; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 269: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 269; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 270: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); + } + grammarID = 269; + } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); + } + grammarID = 269; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 269; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 270; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { + int grammarID = 0; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10484,14 +8915,14 @@ static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffT /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType) { - int grammarID = 317; + int grammarID = 271; int done = 0; unsigned int v2gTransformType_XPath_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 317: + case 271: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -10502,12 +8933,12 @@ static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* errn = encodeCharacters(stream, v2gTransformType->Algorithm.characters, v2gTransformType->Algorithm.charactersLen); } } - grammarID = 318; + grammarID = 272; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 318: + case 272: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (v2gTransformType_XPath_currArrayIndex < v2gTransformType->XPath.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -10525,24 +8956,24 @@ static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 319; + grammarID = 273; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 319; + grammarID = 273; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 319; + grammarID = 273; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 319: + case 273: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (v2gTransformType_XPath_currArrayIndex < v2gTransformType->XPath.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -10560,19 +8991,19 @@ static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 319; + grammarID = 273; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 319; + grammarID = 273; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 319; + grammarID = 273; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10588,53 +9019,1622 @@ static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { - int grammarID = 5; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { + int grammarID = 0; int done = 0; while(!done) { switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { + int grammarID = 54; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 54: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionStopResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; case 5: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.characters, v2gDiffieHellmanPublickeyType->Id.charactersLen); - } - } - grammarID = 6; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 6: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytes, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { + int grammarID = 274; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 274: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->Name.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gParameterType->Name.characters, v2gParameterType->Name.charactersLen); + } + } + grammarID = 275; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 275: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ + if ( v2gParameterType->boolValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gParameterType->boolValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if ( v2gParameterType->byteValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gParameterType->byteValue + 128)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if ( v2gParameterType->shortValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gParameterType->shortValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if ( v2gParameterType->intValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger32(stream, v2gParameterType->intValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if ( v2gParameterType->physicalValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue ); + } + grammarID = 5; + } else if ( v2gParameterType->stringValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 5); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->stringValue.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gParameterType->stringValue.characters, v2gParameterType->stringValue.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ +static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { + int grammarID = 276; + int done = 0; + + unsigned int v2gServiceListType_Service_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 276: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 277; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 277: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 278; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 278: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 279; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 279: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 280; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 280: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 281; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 281: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 282; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 282: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 283; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 283: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { + int grammarID = 284; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 284: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( v2gRetrievalMethodType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gRetrievalMethodType->Type.characters, v2gRetrievalMethodType->Type.charactersLen); + } + } + grammarID = 285; + } else if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 286; + } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 285: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 286; + } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 286: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { + int grammarID = 287; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 287: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ + if ( v2gEVChargeParameterType->DepartureTime_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gEVChargeParameterType->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { + int grammarID = 267; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 267: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.characters, v2gCanonicalizationMethodType->Algorithm.charactersLen); + } + } + grammarID = 47; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 47: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 35: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { + int grammarID = 0; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { + int grammarID = 288; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 288: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus ); + } + grammarID = 289; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 289: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage ); + } + grammarID = 290; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 290: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { + int grammarID = 291; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 291: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gDC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 292; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 292: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gDC_EVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 293; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 293: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + if ( v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gDC_EVSEStatusType->EVSEIsolationStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 294; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 294: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { + int grammarID = 295; + int done = 0; + + unsigned int v2gSignatureType_Object_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 295: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( v2gSignatureType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignatureType->Id.characters, v2gSignatureType->Id.charactersLen); + } + } + grammarID = 296; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); + } + grammarID = 297; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 296: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); + } + grammarID = 297; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 297: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue ); + } + grammarID = 298; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 298: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if ( v2gSignatureType->KeyInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo ); + } + grammarID = 299; + } else if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); + } + grammarID = 299; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 299: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); + } + grammarID = 299; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { + int grammarID = 300; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 300: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gCableCheckResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 301; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 301: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus ); + } + grammarID = 231; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gCableCheckResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { + int grammarID = 302; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 302: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentDetailsResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 303; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 303: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsResType->GenChallenge.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytes, v2gPaymentDetailsResType->GenChallenge.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 304; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 304: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gPaymentDetailsResType->EVSETimeStamp); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { + int grammarID = 0; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { + int grammarID = 305; + int done = 0; + + unsigned int v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 305: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ + if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 306; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 306: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 306; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { + int grammarID = 307; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 307: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gChargeParameterDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 308; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 308: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeParameterDiscoveryResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 309; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 309: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + if ( v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList ); + } + grammarID = 310; + } else if ( v2gChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules ); + } + grammarID = 310; + } else if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); + } + grammarID = 5; + } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); + } + grammarID = 5; + } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 310: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); + } + grammarID = 5; + } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); + } + grammarID = 5; + } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { + int grammarID = 311; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 311: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPowerDeliveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 312; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 312: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + if ( v2gPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus ); + } + grammarID = 5; + } else if ( v2gPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus ); + } + grammarID = 5; + } else if ( v2gPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { + int grammarID = 313; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 313: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSAScheduleTupleType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 314; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 314: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule ); + } + grammarID = 315; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 315: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ + if ( v2gSAScheduleTupleType->SalesTariff_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff ); + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { + int grammarID = 316; + int done = 0; + + unsigned int v2gSignedInfoType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 316: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( v2gSignedInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignedInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignedInfoType->Id.characters, v2gSignedInfoType->Id.charactersLen); + } + } + grammarID = 317; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); + } + grammarID = 318; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 317: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); + } + grammarID = 318; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 318: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod ); + } + grammarID = 319; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 319: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 50; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 50: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 50; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { + int grammarID = 311; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 311: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gMeteringReceiptResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 312; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 312: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + if ( v2gMeteringReceiptResType->AC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus ); + } + grammarID = 5; + } else if ( v2gMeteringReceiptResType->DC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus ); + } + grammarID = 5; + } else if ( v2gMeteringReceiptResType->EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus ); + } + grammarID = 5; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -11179,6 +11179,1870 @@ int encode_v2gExiDocument(bitstream_t* stream, struct v2gEXIDocument* exiDoc) { return errn; } + +#if DEPLOY_ISO_CODEC_FRAGMENT == SUPPORT_YES +int encode_v2gExiFragment(bitstream_t* stream, struct v2gEXIFragment* exiFrag) { + errn = writeEXIHeader(stream); + + if(errn == 0) { + /* FragmentContent[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Entry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier), START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID), START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2013:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue), START_ELEMENT_GENERIC, END_DOCUMENT] */ + if ( exiFrag->AC_EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 0); + if(errn == 0) { + errn = encode_v2gAC_EVChargeParameterType(stream, &exiFrag->AC_EVChargeParameter ); + } + } else if ( exiFrag->AC_EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 1); + if(errn == 0) { + errn = encode_v2gAC_EVSEChargeParameterType(stream, &exiFrag->AC_EVSEChargeParameter ); + } + } else if ( exiFrag->AC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + } else if ( exiFrag->AC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + } else if ( exiFrag->AuthorizationReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 4); + if(errn == 0) { + errn = encode_v2gAuthorizationReqType(stream, &exiFrag->AuthorizationReq ); + } + } else if ( exiFrag->AuthorizationRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 5); + if(errn == 0) { + errn = encode_v2gAuthorizationResType(stream, &exiFrag->AuthorizationRes ); + } + } else if ( exiFrag->Body_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body) */ + errn = encodeNBitUnsignedInteger(stream, 8, 6); + if(errn == 0) { + errn = encode_v2gBodyType(stream, &exiFrag->Body ); + } + } else if ( exiFrag->BodyElement_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement) */ + errn = encodeNBitUnsignedInteger(stream, 8, 7); + if(errn == 0) { + errn = encode_v2gBodyBaseType(stream, &exiFrag->BodyElement ); + } + } else if ( exiFrag->BulkChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + } else if ( exiFrag->BulkChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + } else if ( exiFrag->BulkSOC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 10); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(exiFrag->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->CableCheckReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 11); + if(errn == 0) { + errn = encode_v2gCableCheckReqType(stream, &exiFrag->CableCheckReq ); + } + } else if ( exiFrag->CableCheckRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 12); + if(errn == 0) { + errn = encode_v2gCableCheckResType(stream, &exiFrag->CableCheckRes ); + } + } else if ( exiFrag->CanonicalizationMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 13); + if(errn == 0) { + errn = encode_v2gCanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod ); + } + } else if ( exiFrag->Certificate_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name Certificate */ + } else if ( exiFrag->CertificateInstallationReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 15); + if(errn == 0) { + errn = encode_v2gCertificateInstallationReqType(stream, &exiFrag->CertificateInstallationReq ); + } + } else if ( exiFrag->CertificateInstallationRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 16); + if(errn == 0) { + errn = encode_v2gCertificateInstallationResType(stream, &exiFrag->CertificateInstallationRes ); + } + } else if ( exiFrag->CertificateUpdateReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 17); + if(errn == 0) { + errn = encode_v2gCertificateUpdateReqType(stream, &exiFrag->CertificateUpdateReq ); + } + } else if ( exiFrag->CertificateUpdateRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 18); + if(errn == 0) { + errn = encode_v2gCertificateUpdateResType(stream, &exiFrag->CertificateUpdateRes ); + } + } else if ( exiFrag->ChargeParameterDiscoveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 19); + if(errn == 0) { + errn = encode_v2gChargeParameterDiscoveryReqType(stream, &exiFrag->ChargeParameterDiscoveryReq ); + } + } else if ( exiFrag->ChargeParameterDiscoveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 20); + if(errn == 0) { + errn = encode_v2gChargeParameterDiscoveryResType(stream, &exiFrag->ChargeParameterDiscoveryRes ); + } + } else if ( exiFrag->ChargeProgress_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress) */ + errn = encodeNBitUnsignedInteger(stream, 8, 21); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, exiFrag->ChargeProgress); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ChargeService_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService) */ + errn = encodeNBitUnsignedInteger(stream, 8, 22); + if(errn == 0) { + errn = encode_v2gChargeServiceType(stream, &exiFrag->ChargeService ); + } + } else if ( exiFrag->ChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + } else if ( exiFrag->ChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + } else if ( exiFrag->ChargingProfile_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile) */ + errn = encodeNBitUnsignedInteger(stream, 8, 25); + if(errn == 0) { + errn = encode_v2gChargingProfileType(stream, &exiFrag->ChargingProfile ); + } + } else if ( exiFrag->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse) */ + errn = encodeNBitUnsignedInteger(stream, 8, 26); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, (uint32_t)(exiFrag->ChargingProfileEntryMaxNumberOfPhasesInUse - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ChargingProfileEntryMaxPower_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower) */ + errn = encodeNBitUnsignedInteger(stream, 8, 27); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->ChargingProfileEntryMaxPower ); + } + } else if ( exiFrag->ChargingProfileEntryStart_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart) */ + errn = encodeNBitUnsignedInteger(stream, 8, 28); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->ChargingProfileEntryStart); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ChargingSession_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) */ + errn = encodeNBitUnsignedInteger(stream, 8, 29); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, exiFrag->ChargingSession); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ChargingStatusReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 30); + if(errn == 0) { + errn = encode_v2gChargingStatusReqType(stream, &exiFrag->ChargingStatusReq ); + } + } else if ( exiFrag->ChargingStatusRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 31); + if(errn == 0) { + errn = encode_v2gChargingStatusResType(stream, &exiFrag->ChargingStatusRes ); + } + } else if ( exiFrag->ConsumptionCost_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost) */ + errn = encodeNBitUnsignedInteger(stream, 8, 32); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &exiFrag->ConsumptionCost ); + } + } else if ( exiFrag->ContractSignatureCertChain_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureCertChain */ + } else if ( exiFrag->ContractSignatureEncryptedPrivateKey_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureEncryptedPrivateKey */ + } else if ( exiFrag->Cost_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost) */ + errn = encodeNBitUnsignedInteger(stream, 8, 35); + if(errn == 0) { + errn = encode_v2gCostType(stream, &exiFrag->Cost ); + } + } else if ( exiFrag->CurrentDemandReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 36); + if(errn == 0) { + errn = encode_v2gCurrentDemandReqType(stream, &exiFrag->CurrentDemandReq ); + } + } else if ( exiFrag->CurrentDemandRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 37); + if(errn == 0) { + errn = encode_v2gCurrentDemandResType(stream, &exiFrag->CurrentDemandRes ); + } + } else if ( exiFrag->DC_EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 38); + if(errn == 0) { + errn = encode_v2gDC_EVChargeParameterType(stream, &exiFrag->DC_EVChargeParameter ); + } + } else if ( exiFrag->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 39); + if(errn == 0) { + errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &exiFrag->DC_EVPowerDeliveryParameter ); + } + } else if ( exiFrag->DC_EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 40); + if(errn == 0) { + errn = encode_v2gDC_EVSEChargeParameterType(stream, &exiFrag->DC_EVSEChargeParameter ); + } + } else if ( exiFrag->DC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + } else if ( exiFrag->DC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + } else if ( exiFrag->DC_EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + } else if ( exiFrag->DC_EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + } else if ( exiFrag->DHpublickey_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DHpublickey */ + } else if ( exiFrag->DSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 46); + if(errn == 0) { + errn = encode_v2gDSAKeyValueType(stream, &exiFrag->DSAKeyValue ); + } + } else if ( exiFrag->DepartureTime_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) */ + errn = encodeNBitUnsignedInteger(stream, 8, 47); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->DigestMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 48); + if(errn == 0) { + errn = encode_v2gDigestMethodType(stream, &exiFrag->DigestMethod ); + } + } else if ( exiFrag->DigestValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 49); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->DigestValue.bytes, exiFrag->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EAmount_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount) */ + errn = encodeNBitUnsignedInteger(stream, 8, 50); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EAmount ); + } + } else if ( exiFrag->EPriceLevel_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel) */ + errn = encodeNBitUnsignedInteger(stream, 8, 51); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(exiFrag->EPriceLevel - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVCCID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 52); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->EVCCID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->EVCCID.bytes, exiFrag->EVCCID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 53); + if(errn == 0) { + errn = encode_v2gEVChargeParameterType(stream, &exiFrag->EVChargeParameter ); + } + } else if ( exiFrag->EVEnergyCapacity_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity) */ + errn = encodeNBitUnsignedInteger(stream, 8, 54); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVEnergyCapacity ); + } + } else if ( exiFrag->EVEnergyRequest_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest) */ + errn = encodeNBitUnsignedInteger(stream, 8, 55); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVEnergyRequest ); + } + } else if ( exiFrag->EVErrorCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 56); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, exiFrag->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVMaxCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 57); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVMaxCurrent ); + } + } else if ( exiFrag->EVMaxVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage) */ + errn = encodeNBitUnsignedInteger(stream, 8, 58); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVMaxVoltage ); + } + } else if ( exiFrag->EVMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + } else if ( exiFrag->EVMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + } else if ( exiFrag->EVMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + } else if ( exiFrag->EVMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + } else if ( exiFrag->EVMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + } else if ( exiFrag->EVMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + } else if ( exiFrag->EVMinCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 65); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVMinCurrent ); + } + } else if ( exiFrag->EVPowerDeliveryParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 66); + if(errn == 0) { + errn = encode_v2gEVPowerDeliveryParameterType(stream, &exiFrag->EVPowerDeliveryParameter ); + } + } else if ( exiFrag->EVRESSSOC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 67); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(exiFrag->EVRESSSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVReady_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady) */ + errn = encodeNBitUnsignedInteger(stream, 8, 68); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVReady); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 69); + if(errn == 0) { + errn = encode_v2gEVSEChargeParameterType(stream, &exiFrag->EVSEChargeParameter ); + } + } else if ( exiFrag->EVSECurrentLimitAchieved_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved) */ + errn = encodeNBitUnsignedInteger(stream, 8, 70); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVSECurrentLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSECurrentRegulationTolerance_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance) */ + errn = encodeNBitUnsignedInteger(stream, 8, 71); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVSECurrentRegulationTolerance ); + } + } else if ( exiFrag->EVSEEnergyToBeDelivered_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered) */ + errn = encodeNBitUnsignedInteger(stream, 8, 72); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVSEEnergyToBeDelivered ); + } + } else if ( exiFrag->EVSEID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEID */ + } else if ( exiFrag->EVSEIsolationStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 74); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, exiFrag->EVSEIsolationStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEMaxCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + } else if ( exiFrag->EVSEMaxCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + } else if ( exiFrag->EVSEMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + } else if ( exiFrag->EVSEMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + } else if ( exiFrag->EVSEMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + } else if ( exiFrag->EVSEMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + } else if ( exiFrag->EVSEMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + } else if ( exiFrag->EVSEMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + } else if ( exiFrag->EVSEMinimumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit) */ + errn = encodeNBitUnsignedInteger(stream, 8, 83); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVSEMinimumCurrentLimit ); + } + } else if ( exiFrag->EVSEMinimumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit) */ + errn = encodeNBitUnsignedInteger(stream, 8, 84); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVSEMinimumVoltageLimit ); + } + } else if ( exiFrag->EVSENominalVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage) */ + errn = encodeNBitUnsignedInteger(stream, 8, 85); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVSENominalVoltage ); + } + } else if ( exiFrag->EVSENotification_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) */ + errn = encodeNBitUnsignedInteger(stream, 8, 86); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, exiFrag->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEPeakCurrentRipple_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple) */ + errn = encodeNBitUnsignedInteger(stream, 8, 87); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVSEPeakCurrentRipple ); + } + } else if ( exiFrag->EVSEPowerLimitAchieved_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved) */ + errn = encodeNBitUnsignedInteger(stream, 8, 88); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVSEPowerLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEPresentCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 89); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->EVSEPresentCurrent ); + } + } else if ( exiFrag->EVSEPresentVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEPresentVoltage */ + } else if ( exiFrag->EVSEProcessing_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEProcessing */ + } else if ( exiFrag->EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 92); + if(errn == 0) { + errn = encode_v2gEVSEStatusType(stream, &exiFrag->EVSEStatus ); + } + } else if ( exiFrag->EVSEStatusCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 93); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, exiFrag->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSETimeStamp_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSETimeStamp */ + } else if ( exiFrag->EVSEVoltageLimitAchieved_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved) */ + errn = encodeNBitUnsignedInteger(stream, 8, 95); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVSEVoltageLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 96); + if(errn == 0) { + errn = encode_v2gEVStatusType(stream, &exiFrag->EVStatus ); + } + } else if ( exiFrag->EVTargetCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetCurrent */ + } else if ( exiFrag->EVTargetVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetVoltage */ + } else if ( exiFrag->EnergyTransferMode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 99); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, exiFrag->EnergyTransferMode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Entry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Entry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 100); + if(errn == 0) { + errn = encode_v2gEntryType(stream, &exiFrag->Entry ); + } + } else if ( exiFrag->Exponent_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 101); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Exponent.bytes, exiFrag->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FaultCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 102); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, exiFrag->FaultCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FaultMsg_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg) */ + errn = encodeNBitUnsignedInteger(stream, 8, 103); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->FaultMsg.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->FaultMsg.characters, exiFrag->FaultMsg.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FreeService_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) */ + errn = encodeNBitUnsignedInteger(stream, 8, 104); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FullSOC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 105); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(exiFrag->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->G_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) */ + errn = encodeNBitUnsignedInteger(stream, 8, 106); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->G.bytes, exiFrag->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->GenChallenge_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name GenChallenge */ + } else if ( exiFrag->HMACOutputLength_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) */ + errn = encodeNBitUnsignedInteger(stream, 8, 108); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Header_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header) */ + errn = encodeNBitUnsignedInteger(stream, 8, 109); + if(errn == 0) { + errn = encode_v2gMessageHeaderType(stream, &exiFrag->Header ); + } + } else if ( exiFrag->J_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) */ + errn = encodeNBitUnsignedInteger(stream, 8, 110); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->J.bytes, exiFrag->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->KeyInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = encodeNBitUnsignedInteger(stream, 8, 111); + if(errn == 0) { + errn = encode_v2gKeyInfoType(stream, &exiFrag->KeyInfo ); + } + } else if ( exiFrag->KeyName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 112); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->KeyName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->KeyName.characters, exiFrag->KeyName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->KeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 113); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &exiFrag->KeyValue ); + } + } else if ( exiFrag->ListOfRootCertificateIDs_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ListOfRootCertificateIDs */ + } else if ( exiFrag->Manifest_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = encodeNBitUnsignedInteger(stream, 8, 115); + if(errn == 0) { + errn = encode_v2gManifestType(stream, &exiFrag->Manifest ); + } + } else if ( exiFrag->MaxEntriesSAScheduleTuple_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple) */ + errn = encodeNBitUnsignedInteger(stream, 8, 116); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, exiFrag->MaxEntriesSAScheduleTuple); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->MeterID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 117); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->MeterID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->MeterID.characters, exiFrag->MeterID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->MeterInfo_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name MeterInfo */ + } else if ( exiFrag->MeterReading_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading) */ + errn = encodeNBitUnsignedInteger(stream, 8, 119); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger64(stream, exiFrag->MeterReading); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->MeterStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 120); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->MeteringReceiptReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 121); + if(errn == 0) { + errn = encode_v2gMeteringReceiptReqType(stream, &exiFrag->MeteringReceiptReq ); + } + } else if ( exiFrag->MeteringReceiptRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 122); + if(errn == 0) { + errn = encode_v2gMeteringReceiptResType(stream, &exiFrag->MeteringReceiptRes ); + } + } else if ( exiFrag->MgmtData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + errn = encodeNBitUnsignedInteger(stream, 8, 123); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->MgmtData.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->MgmtData.characters, exiFrag->MgmtData.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Modulus_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 124); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Modulus.bytes, exiFrag->Modulus.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Multiplier_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier) */ + errn = encodeNBitUnsignedInteger(stream, 8, 125); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(exiFrag->Multiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Notification_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification) */ + errn = encodeNBitUnsignedInteger(stream, 8, 126); + if(errn == 0) { + errn = encode_v2gNotificationType(stream, &exiFrag->Notification ); + } + } else if ( exiFrag->NotificationMaxDelay_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) */ + errn = encodeNBitUnsignedInteger(stream, 8, 127); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, exiFrag->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->NumEPriceLevels_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) */ + errn = encodeNBitUnsignedInteger(stream, 8, 128); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(exiFrag->NumEPriceLevels - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->OEMProvisioningCert_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert) */ + errn = encodeNBitUnsignedInteger(stream, 8, 129); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->OEMProvisioningCert.bytes, exiFrag->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Object_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = encodeNBitUnsignedInteger(stream, 8, 130); + if(errn == 0) { + errn = encode_v2gObjectType(stream, &exiFrag->Object ); + } + } else if ( exiFrag->P_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) */ + errn = encodeNBitUnsignedInteger(stream, 8, 131); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->P.bytes, exiFrag->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PGPData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = encodeNBitUnsignedInteger(stream, 8, 132); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &exiFrag->PGPData ); + } + } else if ( exiFrag->PGPKeyID_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 133); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->PGPKeyID.bytes, exiFrag->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PGPKeyPacket_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name PGPKeyPacket */ + } else if ( exiFrag->PMax_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax) */ + errn = encodeNBitUnsignedInteger(stream, 8, 135); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->PMax ); + } + } else if ( exiFrag->PMaxSchedule_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule) */ + errn = encodeNBitUnsignedInteger(stream, 8, 136); + if(errn == 0) { + errn = encode_v2gPMaxScheduleType(stream, &exiFrag->PMaxSchedule ); + } + } else if ( exiFrag->PMaxScheduleEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 137); + if(errn == 0) { + errn = encode_v2gPMaxScheduleEntryType(stream, &exiFrag->PMaxScheduleEntry ); + } + } else if ( exiFrag->Parameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 138); + if(errn == 0) { + errn = encode_v2gParameterType(stream, &exiFrag->Parameter ); + } + } else if ( exiFrag->ParameterSet_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet) */ + errn = encodeNBitUnsignedInteger(stream, 8, 139); + if(errn == 0) { + errn = encode_v2gParameterSetType(stream, &exiFrag->ParameterSet ); + } + } else if ( exiFrag->ParameterSetID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ParameterSetID */ + } else if ( exiFrag->PaymentDetailsReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 141); + if(errn == 0) { + errn = encode_v2gPaymentDetailsReqType(stream, &exiFrag->PaymentDetailsReq ); + } + } else if ( exiFrag->PaymentDetailsRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 142); + if(errn == 0) { + errn = encode_v2gPaymentDetailsResType(stream, &exiFrag->PaymentDetailsRes ); + } + } else if ( exiFrag->PaymentOption_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) */ + errn = encodeNBitUnsignedInteger(stream, 8, 143); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, exiFrag->PaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PaymentOptionList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 144); + if(errn == 0) { + errn = encode_v2gPaymentOptionListType(stream, &exiFrag->PaymentOptionList ); + } + } else if ( exiFrag->PaymentServiceSelectionReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 145); + if(errn == 0) { + errn = encode_v2gPaymentServiceSelectionReqType(stream, &exiFrag->PaymentServiceSelectionReq ); + } + } else if ( exiFrag->PaymentServiceSelectionRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 146); + if(errn == 0) { + errn = encode_v2gPaymentServiceSelectionResType(stream, &exiFrag->PaymentServiceSelectionRes ); + } + } else if ( exiFrag->PgenCounter_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 147); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->PgenCounter.bytes, exiFrag->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PowerDeliveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 148); + if(errn == 0) { + errn = encode_v2gPowerDeliveryReqType(stream, &exiFrag->PowerDeliveryReq ); + } + } else if ( exiFrag->PowerDeliveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 149); + if(errn == 0) { + errn = encode_v2gPowerDeliveryResType(stream, &exiFrag->PowerDeliveryRes ); + } + } else if ( exiFrag->PreChargeReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 150); + if(errn == 0) { + errn = encode_v2gPreChargeReqType(stream, &exiFrag->PreChargeReq ); + } + } else if ( exiFrag->PreChargeRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 151); + if(errn == 0) { + errn = encode_v2gPreChargeResType(stream, &exiFrag->PreChargeRes ); + } + } else if ( exiFrag->ProfileEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 152); + if(errn == 0) { + errn = encode_v2gProfileEntryType(stream, &exiFrag->ProfileEntry ); + } + } else if ( exiFrag->Q_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) */ + errn = encodeNBitUnsignedInteger(stream, 8, 153); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Q.bytes, exiFrag->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->RCD_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD) */ + errn = encodeNBitUnsignedInteger(stream, 8, 154); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->RCD); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->RSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 155); + if(errn == 0) { + errn = encode_v2gRSAKeyValueType(stream, &exiFrag->RSAKeyValue ); + } + } else if ( exiFrag->ReceiptRequired_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ReceiptRequired */ + } else if ( exiFrag->Reference_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = encodeNBitUnsignedInteger(stream, 8, 157); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &exiFrag->Reference ); + } + } else if ( exiFrag->RelativeTimeInterval_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval) */ + errn = encodeNBitUnsignedInteger(stream, 8, 158); + if(errn == 0) { + errn = encode_v2gRelativeTimeIntervalType(stream, &exiFrag->RelativeTimeInterval ); + } + } else if ( exiFrag->RemainingTimeToBulkSoC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 159); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->RemainingTimeToBulkSoC ); + } + } else if ( exiFrag->RemainingTimeToFullSoC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 160); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->RemainingTimeToFullSoC ); + } + } else if ( exiFrag->RequestedEnergyTransferMode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 161); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, exiFrag->RequestedEnergyTransferMode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ResponseCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ResponseCode */ + } else if ( exiFrag->RetrievalMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 163); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &exiFrag->RetrievalMethod ); + } + } else if ( exiFrag->RetryCounter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 164); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->RetryCounter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->RootCertificateID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 165); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &exiFrag->RootCertificateID ); + } + } else if ( exiFrag->SAProvisioningCertificateChain_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAProvisioningCertificateChain */ + } else if ( exiFrag->SAScheduleList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 167); + if(errn == 0) { + errn = encode_v2gSAScheduleListType(stream, &exiFrag->SAScheduleList ); + } + } else if ( exiFrag->SAScheduleTuple_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple) */ + errn = encodeNBitUnsignedInteger(stream, 8, 168); + if(errn == 0) { + errn = encode_v2gSAScheduleTupleType(stream, &exiFrag->SAScheduleTuple ); + } + } else if ( exiFrag->SAScheduleTupleID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + } else if ( exiFrag->SAScheduleTupleID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + } else if ( exiFrag->SASchedules_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules) */ + errn = encodeNBitUnsignedInteger(stream, 8, 171); + if(errn == 0) { + errn = encode_v2gSASchedulesType(stream, &exiFrag->SASchedules ); + } + } else if ( exiFrag->SPKIData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = encodeNBitUnsignedInteger(stream, 8, 172); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &exiFrag->SPKIData ); + } + } else if ( exiFrag->SPKISexp_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) */ + errn = encodeNBitUnsignedInteger(stream, 8, 173); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->SPKISexp.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->SPKISexp.bytes, exiFrag->SPKISexp.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SalesTariff_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff) */ + errn = encodeNBitUnsignedInteger(stream, 8, 174); + if(errn == 0) { + errn = encode_v2gSalesTariffType(stream, &exiFrag->SalesTariff ); + } + } else if ( exiFrag->SalesTariffDescription_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription) */ + errn = encodeNBitUnsignedInteger(stream, 8, 175); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->SalesTariffDescription.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->SalesTariffDescription.characters, exiFrag->SalesTariffDescription.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SalesTariffEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 176); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &exiFrag->SalesTariffEntry ); + } + } else if ( exiFrag->SalesTariffID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 177); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(exiFrag->SalesTariffID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Seed_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) */ + errn = encodeNBitUnsignedInteger(stream, 8, 178); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Seed.bytes, exiFrag->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SelectedPaymentOption_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption) */ + errn = encodeNBitUnsignedInteger(stream, 8, 179); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, exiFrag->SelectedPaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SelectedService_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService) */ + errn = encodeNBitUnsignedInteger(stream, 8, 180); + if(errn == 0) { + errn = encode_v2gSelectedServiceType(stream, &exiFrag->SelectedService ); + } + } else if ( exiFrag->SelectedServiceList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 181); + if(errn == 0) { + errn = encode_v2gSelectedServiceListType(stream, &exiFrag->SelectedServiceList ); + } + } else if ( exiFrag->Service_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service) */ + errn = encodeNBitUnsignedInteger(stream, 8, 182); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &exiFrag->Service ); + } + } else if ( exiFrag->ServiceCategory_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + } else if ( exiFrag->ServiceCategory_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + } else if ( exiFrag->ServiceDetailReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 185); + if(errn == 0) { + errn = encode_v2gServiceDetailReqType(stream, &exiFrag->ServiceDetailReq ); + } + } else if ( exiFrag->ServiceDetailRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 186); + if(errn == 0) { + errn = encode_v2gServiceDetailResType(stream, &exiFrag->ServiceDetailRes ); + } + } else if ( exiFrag->ServiceDiscoveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 187); + if(errn == 0) { + errn = encode_v2gServiceDiscoveryReqType(stream, &exiFrag->ServiceDiscoveryReq ); + } + } else if ( exiFrag->ServiceDiscoveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 188); + if(errn == 0) { + errn = encode_v2gServiceDiscoveryResType(stream, &exiFrag->ServiceDiscoveryRes ); + } + } else if ( exiFrag->ServiceID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + } else if ( exiFrag->ServiceID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + } else if ( exiFrag->ServiceList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 191); + if(errn == 0) { + errn = encode_v2gServiceListType(stream, &exiFrag->ServiceList ); + } + } else if ( exiFrag->ServiceName_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 192); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->ServiceName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->ServiceName.characters, exiFrag->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ServiceParameterList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 193); + if(errn == 0) { + errn = encode_v2gServiceParameterListType(stream, &exiFrag->ServiceParameterList ); + } + } else if ( exiFrag->ServiceScope_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + } else if ( exiFrag->ServiceScope_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + } else if ( exiFrag->SessionID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + } else if ( exiFrag->SessionID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + } else if ( exiFrag->SessionSetupReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 198); + if(errn == 0) { + errn = encode_v2gSessionSetupReqType(stream, &exiFrag->SessionSetupReq ); + } + } else if ( exiFrag->SessionSetupRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 199); + if(errn == 0) { + errn = encode_v2gSessionSetupResType(stream, &exiFrag->SessionSetupRes ); + } + } else if ( exiFrag->SessionStopReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 200); + if(errn == 0) { + errn = encode_v2gSessionStopReqType(stream, &exiFrag->SessionStopReq ); + } + } else if ( exiFrag->SessionStopRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 201); + if(errn == 0) { + errn = encode_v2gSessionStopResType(stream, &exiFrag->SessionStopRes ); + } + } else if ( exiFrag->SigMeterReading_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) */ + errn = encodeNBitUnsignedInteger(stream, 8, 202); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->SigMeterReading.bytes, exiFrag->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Signature_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = encodeNBitUnsignedInteger(stream, 8, 203); + if(errn == 0) { + errn = encode_v2gSignatureType(stream, &exiFrag->Signature ); + } + } else if ( exiFrag->SignatureMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 204); + if(errn == 0) { + errn = encode_v2gSignatureMethodType(stream, &exiFrag->SignatureMethod ); + } + } else if ( exiFrag->SignatureProperties_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = encodeNBitUnsignedInteger(stream, 8, 205); + if(errn == 0) { + errn = encode_v2gSignaturePropertiesType(stream, &exiFrag->SignatureProperties ); + } + } else if ( exiFrag->SignatureProperty_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = encodeNBitUnsignedInteger(stream, 8, 206); + if(errn == 0) { + errn = encode_v2gSignaturePropertyType(stream, &exiFrag->SignatureProperty ); + } + } else if ( exiFrag->SignatureValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 207); + if(errn == 0) { + errn = encode_v2gSignatureValueType(stream, &exiFrag->SignatureValue ); + } + } else if ( exiFrag->SignedInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = encodeNBitUnsignedInteger(stream, 8, 208); + if(errn == 0) { + errn = encode_v2gSignedInfoType(stream, &exiFrag->SignedInfo ); + } + } else if ( exiFrag->SubCertificates_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates) */ + errn = encodeNBitUnsignedInteger(stream, 8, 209); + if(errn == 0) { + errn = encode_v2gSubCertificatesType(stream, &exiFrag->SubCertificates ); + } + } else if ( exiFrag->SupportedEnergyTransferMode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 210); + if(errn == 0) { + errn = encode_v2gSupportedEnergyTransferModeType(stream, &exiFrag->SupportedEnergyTransferMode ); + } + } else if ( exiFrag->TMeter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 211); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->TimeInterval_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval) */ + errn = encodeNBitUnsignedInteger(stream, 8, 212); + if(errn == 0) { + errn = encode_v2gIntervalType(stream, &exiFrag->TimeInterval ); + } + } else if ( exiFrag->Transform_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = encodeNBitUnsignedInteger(stream, 8, 213); + if(errn == 0) { + errn = encode_v2gTransformType(stream, &exiFrag->Transform ); + } + } else if ( exiFrag->Transforms_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = encodeNBitUnsignedInteger(stream, 8, 214); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &exiFrag->Transforms ); + } + } else if ( exiFrag->Unit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit) */ + errn = encodeNBitUnsignedInteger(stream, 8, 215); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, exiFrag->Unit); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->V2G_Message_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}V2G_Message) */ + errn = encodeNBitUnsignedInteger(stream, 8, 216); + if(errn == 0) { + errn = encode_v2gAnonType_V2G_Message(stream, &exiFrag->V2G_Message ); + } + } else if ( exiFrag->Value_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value) */ + errn = encodeNBitUnsignedInteger(stream, 8, 217); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->WeldingDetectionReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 218); + if(errn == 0) { + errn = encode_v2gWeldingDetectionReqType(stream, &exiFrag->WeldingDetectionReq ); + } + } else if ( exiFrag->WeldingDetectionRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 219); + if(errn == 0) { + errn = encode_v2gWeldingDetectionResType(stream, &exiFrag->WeldingDetectionRes ); + } + } else if ( exiFrag->X509CRL_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) */ + errn = encodeNBitUnsignedInteger(stream, 8, 220); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509CRL.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509CRL.bytes, exiFrag->X509CRL.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509Certificate_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) */ + errn = encodeNBitUnsignedInteger(stream, 8, 221); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509Certificate.bytes, exiFrag->X509Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509Data_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = encodeNBitUnsignedInteger(stream, 8, 222); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &exiFrag->X509Data ); + } + } else if ( exiFrag->X509IssuerName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 223); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->X509IssuerName.characters, exiFrag->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509IssuerSerial_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial) */ + errn = encodeNBitUnsignedInteger(stream, 8, 224); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &exiFrag->X509IssuerSerial ); + } + } else if ( exiFrag->X509SKI_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) */ + errn = encodeNBitUnsignedInteger(stream, 8, 225); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509SKI.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509SKI.bytes, exiFrag->X509SKI.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509SerialNumber_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) */ + errn = encodeNBitUnsignedInteger(stream, 8, 226); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509SubjectName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 227); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509SubjectName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->X509SubjectName.characters, exiFrag->X509SubjectName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->XPath_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) */ + errn = encodeNBitUnsignedInteger(stream, 8, 228); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->XPath.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->XPath.characters, exiFrag->XPath.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Y_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) */ + errn = encodeNBitUnsignedInteger(stream, 8, 229); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Y.bytes, exiFrag->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->amount_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount) */ + errn = encodeNBitUnsignedInteger(stream, 8, 230); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->amount); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->amountMultiplier_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier) */ + errn = encodeNBitUnsignedInteger(stream, 8, 231); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(exiFrag->amountMultiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->boolValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 232); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->boolValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->byteValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 233); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(exiFrag->byteValue + 128)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->costKind_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind) */ + errn = encodeNBitUnsignedInteger(stream, 8, 234); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, exiFrag->costKind); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->duration_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration) */ + errn = encodeNBitUnsignedInteger(stream, 8, 235); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->duration); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->eMAID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name eMAID */ + } else if ( exiFrag->intValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 237); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger32(stream, exiFrag->intValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->physicalValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 238); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->physicalValue ); + } + } else if ( exiFrag->shortValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 239); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->shortValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->start_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start) */ + errn = encodeNBitUnsignedInteger(stream, 8, 240); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->start); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->startValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 241); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &exiFrag->startValue ); + } + } else if ( exiFrag->stringValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 242); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->stringValue.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->stringValue.characters, exiFrag->stringValue.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + + } + + if(errn == 0) { + /* EndDocument */ + errn = encodeNBitUnsignedInteger(stream, 8, 244); + } + + if(errn == 0) { + /* flush any pending bits */ + errn = encodeFinish(stream); + } + + return errn; +} +#endif /* DEPLOY_ISO_CODEC_FRAGMENT */ + #endif /* DEPLOY_ISO_CODEC */ diff --git a/src/codec/v2gEXIDatatypesEncoder.h b/src/codec/v2gEXIDatatypesEncoder.h index 3012407..d7edb07 100644 --- a/src/codec/v2gEXIDatatypesEncoder.h +++ b/src/codec/v2gEXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -51,6 +51,11 @@ 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 */ + #endif /* DEPLOY_ISO_CODEC */ diff --git a/src/din/dinEXIDatatypes.c b/src/din/dinEXIDatatypes.c index 2fad904..ab15939 100644 --- a/src/din/dinEXIDatatypes.c +++ b/src/din/dinEXIDatatypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -125,79 +125,342 @@ void init_dinEXIDocument(struct dinEXIDocument* exiDoc) { exiDoc->ServiceDetailRes_isUsed = 0u; } -void init_dinPreChargeResType(struct dinPreChargeResType* dinPreChargeResType) { +#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES +void init_dinEXIFragment(struct dinEXIFragment* exiFrag) { + exiFrag->RSAKeyValue_isUsed = 0u; + exiFrag->ParameterSet_isUsed = 0u; + exiFrag->EVEnergyRequest_isUsed = 0u; + exiFrag->amount_isUsed = 0u; + exiFrag->start_isUsed = 0u; + exiFrag->Notification_isUsed = 0u; + exiFrag->ServiceScope_isUsed = 0u; + exiFrag->EVMaximumVoltageLimit_isUsed = 0u; + exiFrag->Certificate_isUsed = 0u; + exiFrag->Certificate_isUsed = 0u; + exiFrag->EVCabinConditioning_isUsed = 0u; + exiFrag->EVSECurrentLimitAchieved_isUsed = 0u; + exiFrag->EVMaxCurrent_isUsed = 0u; + exiFrag->CertificateInstallationRes_isUsed = 0u; + exiFrag->EVMaxVoltage_isUsed = 0u; + exiFrag->Exponent_isUsed = 0u; + exiFrag->SubCertificates_isUsed = 0u; + exiFrag->FaultCode_isUsed = 0u; + exiFrag->EVRequestedEnergyTransferType_isUsed = 0u; + exiFrag->EVMinCurrent_isUsed = 0u; + exiFrag->boolValue_isUsed = 0u; + exiFrag->J_isUsed = 0u; + exiFrag->EVSEStatus_isUsed = 0u; + exiFrag->ServicePaymentSelectionReq_isUsed = 0u; + exiFrag->Transforms_isUsed = 0u; + exiFrag->X509CRL_isUsed = 0u; + exiFrag->Manifest_isUsed = 0u; + exiFrag->EVSEMinimumVoltageLimit_isUsed = 0u; + exiFrag->EVSECurrentRegulationTolerance_isUsed = 0u; + exiFrag->EVMaximumPowerLimit_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->V2G_Message_isUsed = 0u; + exiFrag->Parameter_isUsed = 0u; + exiFrag->EVTargetCurrent_isUsed = 0u; + exiFrag->EVTargetCurrent_isUsed = 0u; + exiFrag->DigestMethod_isUsed = 0u; + exiFrag->byteValue_isUsed = 0u; + exiFrag->PaymentOptions_isUsed = 0u; + exiFrag->EVMaximumVoltageLimit_isUsed = 0u; + exiFrag->ChargingComplete_isUsed = 0u; + exiFrag->Multiplier_isUsed = 0u; + exiFrag->EVSEIsolationStatus_isUsed = 0u; + exiFrag->EVSEPeakCurrentRipple_isUsed = 0u; + exiFrag->ReadyToChargeState_isUsed = 0u; + exiFrag->X509IssuerSerial_isUsed = 0u; + exiFrag->duration_isUsed = 0u; + exiFrag->NotificationMaxDelay_isUsed = 0u; + exiFrag->NotificationMaxDelay_isUsed = 0u; + exiFrag->ServiceDetailRes_isUsed = 0u; + exiFrag->EVSEProcessing_isUsed = 0u; + exiFrag->EVSEProcessing_isUsed = 0u; + exiFrag->EVSEProcessing_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->ServiceDetailReq_isUsed = 0u; + exiFrag->DC_EVPowerDeliveryParameter_isUsed = 0u; + exiFrag->PgenCounter_isUsed = 0u; + exiFrag->EVChargeParameter_isUsed = 0u; + exiFrag->RelativeTimeInterval_isUsed = 0u; + exiFrag->SelectedServiceList_isUsed = 0u; + exiFrag->X509SerialNumber_isUsed = 0u; + exiFrag->SalesTariffEntry_isUsed = 0u; + exiFrag->SAScheduleTuple_isUsed = 0u; + exiFrag->Reference_isUsed = 0u; + exiFrag->SignedInfo_isUsed = 0u; + exiFrag->CableCheckReq_isUsed = 0u; + exiFrag->PowerDeliveryReq_isUsed = 0u; + exiFrag->EVPowerDeliveryParameter_isUsed = 0u; + exiFrag->MeteringReceiptReq_isUsed = 0u; + exiFrag->DC_EVChargeParameter_isUsed = 0u; + exiFrag->KeyValue_isUsed = 0u; + exiFrag->Y_isUsed = 0u; + exiFrag->ChargingProfileEntryMaxPower_isUsed = 0u; + exiFrag->EVRESSConditioning_isUsed = 0u; + exiFrag->EVSEMaximumVoltageLimit_isUsed = 0u; + exiFrag->EPriceLevel_isUsed = 0u; + exiFrag->ServiceList_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->PMaxSchedule_isUsed = 0u; + exiFrag->EVSEPowerLimitAchieved_isUsed = 0u; + exiFrag->CertificateUpdateRes_isUsed = 0u; + exiFrag->EVSEEnergyToBeDelivered_isUsed = 0u; + exiFrag->AC_EVSEStatus_isUsed = 0u; + exiFrag->AC_EVSEStatus_isUsed = 0u; + exiFrag->ServiceTag_isUsed = 0u; + exiFrag->SignatureMethod_isUsed = 0u; + exiFrag->TimeInterval_isUsed = 0u; + exiFrag->amountMultiplier_isUsed = 0u; + exiFrag->X509Data_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->ContractSignatureCertChain_isUsed = 0u; + exiFrag->Seed_isUsed = 0u; + exiFrag->Modulus_isUsed = 0u; + exiFrag->ServiceCategory_isUsed = 0u; + exiFrag->MeterStatus_isUsed = 0u; + exiFrag->EVMaximumCurrentLimit_isUsed = 0u; + exiFrag->KeyInfo_isUsed = 0u; + exiFrag->CertificateInstallationReq_isUsed = 0u; + exiFrag->ChargingProfile_isUsed = 0u; + exiFrag->BulkSOC_isUsed = 0u; + exiFrag->X509IssuerName_isUsed = 0u; + exiFrag->EVRESSSOC_isUsed = 0u; + exiFrag->X509SubjectName_isUsed = 0u; + exiFrag->AC_EVSEChargeParameter_isUsed = 0u; + exiFrag->MgmtData_isUsed = 0u; + exiFrag->Value_isUsed = 0u; + exiFrag->ChargingStatusRes_isUsed = 0u; + exiFrag->ServiceName_isUsed = 0u; + exiFrag->FreeService_isUsed = 0u; + exiFrag->physicalValue_isUsed = 0u; + exiFrag->EVSEMaxVoltage_isUsed = 0u; + exiFrag->intValue_isUsed = 0u; + exiFrag->PGPKeyID_isUsed = 0u; + exiFrag->ChargeParameterDiscoveryRes_isUsed = 0u; + exiFrag->ServiceCategory_isUsed = 0u; + exiFrag->MeteringReceiptRes_isUsed = 0u; + exiFrag->EVSEID_isUsed = 0u; + exiFrag->EVSEID_isUsed = 0u; + exiFrag->EVMaximumCurrentLimit_isUsed = 0u; + exiFrag->costKind_isUsed = 0u; + exiFrag->X509SKI_isUsed = 0u; + exiFrag->MeterID_isUsed = 0u; + exiFrag->OEMProvisioningCert_isUsed = 0u; + exiFrag->Entry_isUsed = 0u; + exiFrag->SignatureProperties_isUsed = 0u; + exiFrag->P_isUsed = 0u; + exiFrag->PreChargeReq_isUsed = 0u; + exiFrag->SignatureValue_isUsed = 0u; + exiFrag->EVSENotification_isUsed = 0u; + exiFrag->EVSENotification_isUsed = 0u; + exiFrag->BulkChargingComplete_isUsed = 0u; + exiFrag->EVMaximumPowerLimit_isUsed = 0u; + exiFrag->RCD_isUsed = 0u; + exiFrag->ServiceParameterList_isUsed = 0u; + exiFrag->SelectedService_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->ResponseCode_isUsed = 0u; + exiFrag->SessionStopRes_isUsed = 0u; + exiFrag->PGPData_isUsed = 0u; + exiFrag->EVEnergyCapacity_isUsed = 0u; + exiFrag->startValue_isUsed = 0u; + exiFrag->ServicePaymentSelectionRes_isUsed = 0u; + exiFrag->EnergyTransferType_isUsed = 0u; + exiFrag->ChargingComplete_isUsed = 0u; + exiFrag->ListOfRootCertificateIDs_isUsed = 0u; + exiFrag->ListOfRootCertificateIDs_isUsed = 0u; + exiFrag->NumEPriceLevels_isUsed = 0u; + exiFrag->EVSEStatusCode_isUsed = 0u; + exiFrag->SASchedules_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVSEChargeParameter_isUsed = 0u; + exiFrag->MeterInfo_isUsed = 0u; + exiFrag->MeterInfo_isUsed = 0u; + exiFrag->X509Certificate_isUsed = 0u; + exiFrag->shortValue_isUsed = 0u; + exiFrag->SPKISexp_isUsed = 0u; + exiFrag->SalesTariffID_isUsed = 0u; + exiFrag->CanonicalizationMethod_isUsed = 0u; + exiFrag->TMeter_isUsed = 0u; + exiFrag->PaymentDetailsRes_isUsed = 0u; + exiFrag->EVCCID_isUsed = 0u; + exiFrag->EVSEMaximumPowerLimit_isUsed = 0u; + exiFrag->EVSEChargeParameter_isUsed = 0u; + exiFrag->Body_isUsed = 0u; + exiFrag->DateTimeNow_isUsed = 0u; + exiFrag->DateTimeNow_isUsed = 0u; + exiFrag->EVSEMaximumPowerLimit_isUsed = 0u; + exiFrag->SPKIData_isUsed = 0u; + exiFrag->Object_isUsed = 0u; + exiFrag->ServiceCharge_isUsed = 0u; + exiFrag->SessionID_isUsed = 0u; + exiFrag->FullSOC_isUsed = 0u; + exiFrag->SAScheduleList_isUsed = 0u; + exiFrag->EVSEMaximumCurrentLimit_isUsed = 0u; + exiFrag->DSAKeyValue_isUsed = 0u; + exiFrag->ChargeParameterDiscoveryReq_isUsed = 0u; + exiFrag->EVStatus_isUsed = 0u; + exiFrag->stringValue_isUsed = 0u; + exiFrag->PowerDeliveryRes_isUsed = 0u; + exiFrag->ContractSignatureEncryptedPrivateKey_isUsed = 0u; + exiFrag->CertificateUpdateReq_isUsed = 0u; + exiFrag->ContractSignatureEncryptedPrivateKey_isUsed = 0u; + exiFrag->Signature_isUsed = 0u; + exiFrag->ContractAuthenticationRes_isUsed = 0u; + exiFrag->Transform_isUsed = 0u; + exiFrag->PaymentOption_isUsed = 0u; + exiFrag->G_isUsed = 0u; + exiFrag->ReceiptRequired_isUsed = 0u; + exiFrag->EVSEMaximumCurrentLimit_isUsed = 0u; + exiFrag->Unit_isUsed = 0u; + exiFrag->ConsumptionCost_isUsed = 0u; + exiFrag->EVSEMaxCurrent_isUsed = 0u; + exiFrag->SalesTariffDescription_isUsed = 0u; + exiFrag->ContractID_isUsed = 0u; + exiFrag->AC_EVChargeParameter_isUsed = 0u; + exiFrag->ContractID_isUsed = 0u; + exiFrag->ContractID_isUsed = 0u; + exiFrag->ContractID_isUsed = 0u; + exiFrag->RemainingTimeToBulkSoC_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->CableCheckRes_isUsed = 0u; + exiFrag->SessionID_isUsed = 0u; + exiFrag->RemainingTimeToFullSoC_isUsed = 0u; + exiFrag->EVSEPresentVoltage_isUsed = 0u; + exiFrag->EVSEPresentVoltage_isUsed = 0u; + exiFrag->EVSEPresentVoltage_isUsed = 0u; + exiFrag->SessionSetupReq_isUsed = 0u; + exiFrag->PreChargeRes_isUsed = 0u; + exiFrag->KeyName_isUsed = 0u; + exiFrag->EVReady_isUsed = 0u; + exiFrag->CurrentDemandRes_isUsed = 0u; + exiFrag->PMaxScheduleEntry_isUsed = 0u; + exiFrag->ServiceDiscoveryRes_isUsed = 0u; + exiFrag->PaymentDetailsReq_isUsed = 0u; + exiFrag->SelectedPaymentOption_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->DigestValue_isUsed = 0u; + exiFrag->SAScheduleTupleID_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->ServiceID_isUsed = 0u; + exiFrag->RetryCounter_isUsed = 0u; + exiFrag->SalesTariff_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->DC_EVStatus_isUsed = 0u; + exiFrag->WeldingDetectionReq_isUsed = 0u; + exiFrag->SigMeterReading_isUsed = 0u; + exiFrag->FaultMsg_isUsed = 0u; + exiFrag->PMax_isUsed = 0u; + exiFrag->PowerSwitchClosed_isUsed = 0u; + exiFrag->AC_EVSEStatus_isUsed = 0u; + exiFrag->AC_EVSEStatus_isUsed = 0u; + exiFrag->ParameterSetID_isUsed = 0u; + exiFrag->ParameterSetID_isUsed = 0u; + exiFrag->EAmount_isUsed = 0u; + exiFrag->RetrievalMethod_isUsed = 0u; + exiFrag->ChargingProfileEntryStart_isUsed = 0u; + exiFrag->ServiceDiscoveryReq_isUsed = 0u; + exiFrag->DepartureTime_isUsed = 0u; + exiFrag->EVSEMinimumCurrentLimit_isUsed = 0u; + exiFrag->CurrentDemandReq_isUsed = 0u; + exiFrag->ChargeService_isUsed = 0u; + exiFrag->BodyElement_isUsed = 0u; + exiFrag->Cost_isUsed = 0u; + exiFrag->ServiceScope_isUsed = 0u; + exiFrag->HMACOutputLength_isUsed = 0u; + exiFrag->MeterReading_isUsed = 0u; + exiFrag->DHParams_isUsed = 0u; + exiFrag->DHParams_isUsed = 0u; + exiFrag->DHParams_isUsed = 0u; + exiFrag->DHParams_isUsed = 0u; + exiFrag->BulkChargingComplete_isUsed = 0u; + exiFrag->SignatureProperty_isUsed = 0u; + exiFrag->EVSEMaxCurrent_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->DC_EVSEStatus_isUsed = 0u; + exiFrag->Service_isUsed = 0u; + exiFrag->PMaxScheduleID_isUsed = 0u; + exiFrag->EVSEPresentCurrent_isUsed = 0u; + exiFrag->EVSEVoltageLimitAchieved_isUsed = 0u; + exiFrag->SessionSetupRes_isUsed = 0u; + exiFrag->EVSEMaximumVoltageLimit_isUsed = 0u; + exiFrag->SessionStopReq_isUsed = 0u; + exiFrag->ContractAuthenticationReq_isUsed = 0u; + exiFrag->ProfileEntry_isUsed = 0u; + exiFrag->EVErrorCode_isUsed = 0u; + exiFrag->RootCertificateID_isUsed = 0u; + exiFrag->EVSEMinCurrent_isUsed = 0u; + exiFrag->EVTargetVoltage_isUsed = 0u; + exiFrag->ChargingStatusReq_isUsed = 0u; + exiFrag->EVTargetVoltage_isUsed = 0u; + exiFrag->Header_isUsed = 0u; + exiFrag->GenChallenge_isUsed = 0u; + exiFrag->XPath_isUsed = 0u; + exiFrag->Q_isUsed = 0u; + exiFrag->GenChallenge_isUsed = 0u; + exiFrag->WeldingDetectionRes_isUsed = 0u; +} +#endif /* DEPLOY_DIN_CODEC_FRAGMENT */ + +void init_dinCurrentDemandResType(struct dinCurrentDemandResType* dinCurrentDemandResType) { + dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 0u; + dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 0u; + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 0u; } -void init_dinMessageHeaderType(struct dinMessageHeaderType* dinMessageHeaderType) { - dinMessageHeaderType->Notification_isUsed = 0u; - dinMessageHeaderType->Signature_isUsed = 0u; +void init_dinCanonicalizationMethodType(struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { } void init_dinServiceDetailReqType(struct dinServiceDetailReqType* dinServiceDetailReqType) { } -void init_dinEVSEChargeParameterType(struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { -} - -void init_dinRetrievalMethodType(struct dinRetrievalMethodType* dinRetrievalMethodType) { - dinRetrievalMethodType->URI_isUsed = 0u; - dinRetrievalMethodType->Type_isUsed = 0u; - dinRetrievalMethodType->Transforms_isUsed = 0u; -} - -void init_dinSessionSetupResType(struct dinSessionSetupResType* dinSessionSetupResType) { - dinSessionSetupResType->DateTimeNow_isUsed = 0u; -} - -void init_dinRSAKeyValueType(struct dinRSAKeyValueType* dinRSAKeyValueType) { -} - -void init_dinCertificateInstallationResType(struct dinCertificateInstallationResType* dinCertificateInstallationResType) { -} - -void init_dinDC_EVChargeParameterType(struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { - dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 0u; - dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 0u; - dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 0u; - dinDC_EVChargeParameterType->FullSOC_isUsed = 0u; - dinDC_EVChargeParameterType->BulkSOC_isUsed = 0u; +void init_dinAC_EVSEStatusType(struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { } void init_dinSPKIDataType(struct dinSPKIDataType* dinSPKIDataType) { dinSPKIDataType->SPKISexp.arrayLen = 0u; } -void init_dinChargeParameterDiscoveryReqType(struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { - dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u; - dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u; - dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u; +void init_dinSessionSetupResType(struct dinSessionSetupResType* dinSessionSetupResType) { + dinSessionSetupResType->DateTimeNow_isUsed = 0u; } -void init_dinBodyBaseType(struct dinBodyBaseType* dinBodyBaseType) { +void init_dinPGPDataType(struct dinPGPDataType* dinPGPDataType) { + dinPGPDataType->PGPKeyID_isUsed = 0u; + dinPGPDataType->PGPKeyPacket_isUsed = 0u; } -void init_dinProfileEntryType(struct dinProfileEntryType* dinProfileEntryType) { -} - -void init_dinCertificateInstallationReqType(struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { - dinCertificateInstallationReqType->Id_isUsed = 0u; -} - -void init_dinSignatureMethodType(struct dinSignatureMethodType* dinSignatureMethodType) { - dinSignatureMethodType->HMACOutputLength_isUsed = 0u; -} - -void init_dinIntervalType(struct dinIntervalType* dinIntervalType) { -} - -void init_dinSelectedServiceListType(struct dinSelectedServiceListType* dinSelectedServiceListType) { - dinSelectedServiceListType->SelectedService.arrayLen = 0u; -} - -void init_dinCableCheckReqType(struct dinCableCheckReqType* dinCableCheckReqType) { -} - -void init_dinServicePaymentSelectionResType(struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { +void init_dinCableCheckResType(struct dinCableCheckResType* dinCableCheckResType) { } void init_dinChargeParameterDiscoveryResType(struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { @@ -208,86 +471,125 @@ void init_dinChargeParameterDiscoveryResType(struct dinChargeParameterDiscoveryR dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u; } -void init_dinX509IssuerSerialType(struct dinX509IssuerSerialType* dinX509IssuerSerialType) { +void init_dinManifestType(struct dinManifestType* dinManifestType) { + dinManifestType->Id_isUsed = 0u; + dinManifestType->Reference.arrayLen = 0u; } -void init_dinCableCheckResType(struct dinCableCheckResType* dinCableCheckResType) { +void init_dinAC_EVChargeParameterType(struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { } -void init_dinMeterInfoType(struct dinMeterInfoType* dinMeterInfoType) { - dinMeterInfoType->MeterReading_isUsed = 0u; - dinMeterInfoType->SigMeterReading_isUsed = 0u; - dinMeterInfoType->MeterStatus_isUsed = 0u; - dinMeterInfoType->TMeter_isUsed = 0u; +void init_dinBodyBaseType(struct dinBodyBaseType* dinBodyBaseType) { } -void init_dinCurrentDemandResType(struct dinCurrentDemandResType* dinCurrentDemandResType) { - dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 0u; - dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 0u; - dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 0u; +void init_dinDC_EVPowerDeliveryParameterType(struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { + dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; } -void init_dinParameterSetType(struct dinParameterSetType* dinParameterSetType) { - dinParameterSetType->Parameter.arrayLen = 0u; +void init_dinCableCheckReqType(struct dinCableCheckReqType* dinCableCheckReqType) { } -void init_dinSubCertificatesType(struct dinSubCertificatesType* dinSubCertificatesType) { - dinSubCertificatesType->Certificate.arrayLen = 0u; +void init_dinDigestMethodType(struct dinDigestMethodType* dinDigestMethodType) { } -void init_dinEVSEStatusType(struct dinEVSEStatusType* dinEVSEStatusType) { +void init_dinSalesTariffType(struct dinSalesTariffType* dinSalesTariffType) { + dinSalesTariffType->SalesTariffDescription_isUsed = 0u; + dinSalesTariffType->SalesTariffEntry.arrayLen = 0u; } -void init_dinAC_EVSEStatusType(struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { +void init_dinServicePaymentSelectionResType(struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { } -void init_dinEntryType(struct dinEntryType* dinEntryType) { - dinEntryType->TimeInterval_isUsed = 0u; - dinEntryType->RelativeTimeInterval_isUsed = 0u; +void init_dinPreChargeReqType(struct dinPreChargeReqType* dinPreChargeReqType) { } -void init_dinPowerDeliveryReqType(struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { - dinPowerDeliveryReqType->ChargingProfile_isUsed = 0u; - dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; - dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; +void init_dinSAScheduleListType(struct dinSAScheduleListType* dinSAScheduleListType) { + dinSAScheduleListType->SAScheduleTuple.arrayLen = 0u; } -void init_dinCostType(struct dinCostType* dinCostType) { - dinCostType->amountMultiplier_isUsed = 0u; +void init_dinCertificateChainType(struct dinCertificateChainType* dinCertificateChainType) { + dinCertificateChainType->SubCertificates_isUsed = 0u; } -void init_dinWeldingDetectionReqType(struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { +void init_dinSignaturePropertiesType(struct dinSignaturePropertiesType* dinSignaturePropertiesType) { + dinSignaturePropertiesType->Id_isUsed = 0u; + dinSignaturePropertiesType->SignatureProperty.arrayLen = 0u; +} + +void init_dinMessageHeaderType(struct dinMessageHeaderType* dinMessageHeaderType) { + dinMessageHeaderType->Notification_isUsed = 0u; + dinMessageHeaderType->Signature_isUsed = 0u; +} + +void init_dinPreChargeResType(struct dinPreChargeResType* dinPreChargeResType) { +} + +void init_dinMeteringReceiptResType(struct dinMeteringReceiptResType* dinMeteringReceiptResType) { +} + +void init_dinNotificationType(struct dinNotificationType* dinNotificationType) { + dinNotificationType->FaultMsg_isUsed = 0u; +} + +void init_dinContractAuthenticationReqType(struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { + dinContractAuthenticationReqType->Id_isUsed = 0u; + dinContractAuthenticationReqType->GenChallenge_isUsed = 0u; +} + +void init_dinPhysicalValueType(struct dinPhysicalValueType* dinPhysicalValueType) { + dinPhysicalValueType->Unit_isUsed = 0u; +} + +void init_dinChargingStatusResType(struct dinChargingStatusResType* dinChargingStatusResType) { + dinChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; + dinChargingStatusResType->MeterInfo_isUsed = 0u; +} + +void init_dinDC_EVSEStatusType(struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { + dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; +} + +void init_dinProfileEntryType(struct dinProfileEntryType* dinProfileEntryType) { +} + +void init_dinAC_EVSEChargeParameterType(struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { } void init_dinServiceDiscoveryResType(struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { dinServiceDiscoveryResType->ServiceList_isUsed = 0u; } +void init_dinSignatureType(struct dinSignatureType* dinSignatureType) { + dinSignatureType->Id_isUsed = 0u; + dinSignatureType->KeyInfo_isUsed = 0u; + dinSignatureType->Object.arrayLen = 0u; +} + void init_dinPaymentOptionsType(struct dinPaymentOptionsType* dinPaymentOptionsType) { dinPaymentOptionsType->PaymentOption.arrayLen = 0u; } -void init_dinPGPDataType(struct dinPGPDataType* dinPGPDataType) { - dinPGPDataType->PGPKeyID_isUsed = 0u; - dinPGPDataType->PGPKeyPacket_isUsed = 0u; +void init_dinParameterType(struct dinParameterType* dinParameterType) { + dinParameterType->boolValue_isUsed = 0u; + dinParameterType->byteValue_isUsed = 0u; + dinParameterType->shortValue_isUsed = 0u; + dinParameterType->intValue_isUsed = 0u; + dinParameterType->physicalValue_isUsed = 0u; + dinParameterType->stringValue_isUsed = 0u; } -void init_dinChargingProfileType(struct dinChargingProfileType* dinChargingProfileType) { - dinChargingProfileType->ProfileEntry.arrayLen = 0u; +void init_dinSignaturePropertyType(struct dinSignaturePropertyType* dinSignaturePropertyType) { + dinSignaturePropertyType->Id_isUsed = 0u; } -void init_dinCurrentDemandReqType(struct dinCurrentDemandReqType* dinCurrentDemandReqType) { - dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u; - dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u; - dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u; - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 0u; - dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u; - dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; +void init_dinEVPowerDeliveryParameterType(struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { } -void init_dinSignedInfoType(struct dinSignedInfoType* dinSignedInfoType) { - dinSignedInfoType->Id_isUsed = 0u; - dinSignedInfoType->Reference.arrayLen = 0u; +void init_dinWeldingDetectionReqType(struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { +} + +void init_dinTransformsType(struct dinTransformsType* dinTransformsType) { + dinTransformsType->Transform.arrayLen = 0u; } void init_dinServiceType(struct dinServiceType* dinServiceType) { @@ -331,35 +633,119 @@ void init_dinBodyType(struct dinBodyType* dinBodyType) { dinBodyType->WeldingDetectionRes_isUsed = 0u; } -void init_dinAC_EVChargeParameterType(struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { +void init_dinDC_EVStatusType(struct dinDC_EVStatusType* dinDC_EVStatusType) { + dinDC_EVStatusType->EVCabinConditioning_isUsed = 0u; + dinDC_EVStatusType->EVRESSConditioning_isUsed = 0u; } -void init_dinSAScheduleTupleType(struct dinSAScheduleTupleType* dinSAScheduleTupleType) { - dinSAScheduleTupleType->SalesTariff_isUsed = 0u; -} - -void init_dinSAScheduleListType(struct dinSAScheduleListType* dinSAScheduleListType) { - dinSAScheduleListType->SAScheduleTuple.arrayLen = 0u; -} - -void init_dinServicePaymentSelectionReqType(struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { +void init_dinPMaxScheduleEntryType(struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { + dinPMaxScheduleEntryType->TimeInterval_isUsed = 0u; + dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u; } void init_dinPMaxScheduleType(struct dinPMaxScheduleType* dinPMaxScheduleType) { dinPMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u; } -void init_dinListOfRootCertificateIDsType(struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { - dinListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u; +void init_dinSelectedServiceType(struct dinSelectedServiceType* dinSelectedServiceType) { + dinSelectedServiceType->ParameterSetID_isUsed = 0u; } -void init_dinCanonicalizationMethodType(struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { +void init_dinIntervalType(struct dinIntervalType* dinIntervalType) { +} + +void init_dinCertificateInstallationReqType(struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { + dinCertificateInstallationReqType->Id_isUsed = 0u; } void init_dinTransformType(struct dinTransformType* dinTransformType) { dinTransformType->XPath.arrayLen = 0u; } +void init_dinKeyValueType(struct dinKeyValueType* dinKeyValueType) { + dinKeyValueType->DSAKeyValue_isUsed = 0u; + dinKeyValueType->RSAKeyValue_isUsed = 0u; +} + +void init_dinRetrievalMethodType(struct dinRetrievalMethodType* dinRetrievalMethodType) { + dinRetrievalMethodType->URI_isUsed = 0u; + dinRetrievalMethodType->Type_isUsed = 0u; + dinRetrievalMethodType->Transforms_isUsed = 0u; +} + +void init_dinEVChargeParameterType(struct dinEVChargeParameterType* dinEVChargeParameterType) { +} + +void init_dinServiceChargeType(struct dinServiceChargeType* dinServiceChargeType) { +} + +void init_dinParameterSetType(struct dinParameterSetType* dinParameterSetType) { + dinParameterSetType->Parameter.arrayLen = 0u; +} + +void init_dinReferenceType(struct dinReferenceType* dinReferenceType) { + dinReferenceType->Id_isUsed = 0u; + dinReferenceType->URI_isUsed = 0u; + dinReferenceType->Type_isUsed = 0u; + dinReferenceType->Transforms_isUsed = 0u; +} + +void init_dinSessionStopResType(struct dinSessionStopResType* dinSessionStopResType) { +} + +void init_dinObjectType(struct dinObjectType* dinObjectType) { + dinObjectType->Id_isUsed = 0u; + dinObjectType->MimeType_isUsed = 0u; + dinObjectType->Encoding_isUsed = 0u; +} + +void init_dinSignatureValueType(struct dinSignatureValueType* dinSignatureValueType) { + dinSignatureValueType->Id_isUsed = 0u; +} + +void init_dinSelectedServiceListType(struct dinSelectedServiceListType* dinSelectedServiceListType) { + dinSelectedServiceListType->SelectedService.arrayLen = 0u; +} + +void init_dinSalesTariffEntryType(struct dinSalesTariffEntryType* dinSalesTariffEntryType) { + dinSalesTariffEntryType->TimeInterval_isUsed = 0u; + dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; + dinSalesTariffEntryType->ConsumptionCost.arrayLen = 0u; +} + +void init_dinConsumptionCostType(struct dinConsumptionCostType* dinConsumptionCostType) { + dinConsumptionCostType->Cost.arrayLen = 0u; +} + +void init_dinRSAKeyValueType(struct dinRSAKeyValueType* dinRSAKeyValueType) { +} + +void init_dinMeteringReceiptReqType(struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { + dinMeteringReceiptReqType->Id_isUsed = 0u; + dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; +} + +void init_dinSAScheduleTupleType(struct dinSAScheduleTupleType* dinSAScheduleTupleType) { + dinSAScheduleTupleType->SalesTariff_isUsed = 0u; +} + +void init_dinRelativeTimeIntervalType(struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { + dinRelativeTimeIntervalType->duration_isUsed = 0u; +} + +void init_dinChargingProfileType(struct dinChargingProfileType* dinChargingProfileType) { + dinChargingProfileType->ProfileEntry.arrayLen = 0u; +} + +void init_dinCurrentDemandReqType(struct dinCurrentDemandReqType* dinCurrentDemandReqType) { + dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u; + dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u; + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u; + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 0u; + dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u; + dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; +} + void init_dinKeyInfoType(struct dinKeyInfoType* dinKeyInfoType) { dinKeyInfoType->Id_isUsed = 0u; dinKeyInfoType->KeyName.arrayLen = 0u; @@ -371,23 +757,115 @@ void init_dinKeyInfoType(struct dinKeyInfoType* dinKeyInfoType) { dinKeyInfoType->MgmtData.arrayLen = 0u; } +void init_dinServicePaymentSelectionReqType(struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { +} + void init_dinContractAuthenticationResType(struct dinContractAuthenticationResType* dinContractAuthenticationResType) { } -void init_dinServiceChargeType(struct dinServiceChargeType* dinServiceChargeType) { +void init_dinChargingStatusReqType(struct dinChargingStatusReqType* dinChargingStatusReqType) { +} + +void init_dinPaymentDetailsResType(struct dinPaymentDetailsResType* dinPaymentDetailsResType) { +} + +void init_dinSASchedulesType(struct dinSASchedulesType* dinSASchedulesType) { +} + +void init_dinPaymentDetailsReqType(struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { +} + +void init_dinServiceTagType(struct dinServiceTagType* dinServiceTagType) { + dinServiceTagType->ServiceName_isUsed = 0u; + dinServiceTagType->ServiceScope_isUsed = 0u; +} + +void init_dinChargeParameterDiscoveryReqType(struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { + dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u; + dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u; + dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u; } void init_dinServiceParameterListType(struct dinServiceParameterListType* dinServiceParameterListType) { dinServiceParameterListType->ParameterSet.arrayLen = 0u; } -void init_dinSignatureType(struct dinSignatureType* dinSignatureType) { - dinSignatureType->Id_isUsed = 0u; - dinSignatureType->KeyInfo_isUsed = 0u; - dinSignatureType->Object.arrayLen = 0u; +void init_dinEVSEStatusType(struct dinEVSEStatusType* dinEVSEStatusType) { } -void init_dinMeteringReceiptResType(struct dinMeteringReceiptResType* dinMeteringReceiptResType) { +void init_dinServiceDiscoveryReqType(struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { + dinServiceDiscoveryReqType->ServiceScope_isUsed = 0u; + dinServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; +} + +void init_dinWeldingDetectionResType(struct dinWeldingDetectionResType* dinWeldingDetectionResType) { +} + +void init_dinCertificateUpdateReqType(struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { + dinCertificateUpdateReqType->Id_isUsed = 0u; +} + +void init_dinServiceTagListType(struct dinServiceTagListType* dinServiceTagListType) { + dinServiceTagListType->Service.arrayLen = 0u; +} + +void init_dinSignedInfoType(struct dinSignedInfoType* dinSignedInfoType) { + dinSignedInfoType->Id_isUsed = 0u; + dinSignedInfoType->Reference.arrayLen = 0u; +} + +void init_dinPowerDeliveryReqType(struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { + dinPowerDeliveryReqType->ChargingProfile_isUsed = 0u; + dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; + dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; +} + +void init_dinCostType(struct dinCostType* dinCostType) { + dinCostType->amountMultiplier_isUsed = 0u; +} + +void init_dinDC_EVChargeParameterType(struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { + dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 0u; + dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 0u; + dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 0u; + dinDC_EVChargeParameterType->FullSOC_isUsed = 0u; + dinDC_EVChargeParameterType->BulkSOC_isUsed = 0u; +} + +void init_dinSubCertificatesType(struct dinSubCertificatesType* dinSubCertificatesType) { + dinSubCertificatesType->Certificate.arrayLen = 0u; +} + +void init_dinSessionSetupReqType(struct dinSessionSetupReqType* dinSessionSetupReqType) { +} + +void init_dinAnonType_V2G_Message(struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { +} + +void init_dinMeterInfoType(struct dinMeterInfoType* dinMeterInfoType) { + dinMeterInfoType->MeterReading_isUsed = 0u; + dinMeterInfoType->SigMeterReading_isUsed = 0u; + dinMeterInfoType->MeterStatus_isUsed = 0u; + dinMeterInfoType->TMeter_isUsed = 0u; +} + +void init_dinCertificateInstallationResType(struct dinCertificateInstallationResType* dinCertificateInstallationResType) { +} + +void init_dinServiceDetailResType(struct dinServiceDetailResType* dinServiceDetailResType) { + dinServiceDetailResType->ServiceParameterList_isUsed = 0u; +} + +void init_dinX509IssuerSerialType(struct dinX509IssuerSerialType* dinX509IssuerSerialType) { +} + +void init_dinDC_EVSEChargeParameterType(struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { + dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 0u; + dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; + dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u; +} + +void init_dinEVStatusType(struct dinEVStatusType* dinEVStatusType) { } void init_dinX509DataType(struct dinX509DataType* dinX509DataType) { @@ -398,160 +876,12 @@ void init_dinX509DataType(struct dinX509DataType* dinX509DataType) { dinX509DataType->X509CRL.arrayLen = 0u; } -void init_dinReferenceType(struct dinReferenceType* dinReferenceType) { - dinReferenceType->Id_isUsed = 0u; - dinReferenceType->URI_isUsed = 0u; - dinReferenceType->Type_isUsed = 0u; - dinReferenceType->Transforms_isUsed = 0u; -} - -void init_dinPhysicalValueType(struct dinPhysicalValueType* dinPhysicalValueType) { - dinPhysicalValueType->Unit_isUsed = 0u; -} - -void init_dinRelativeTimeIntervalType(struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { - dinRelativeTimeIntervalType->duration_isUsed = 0u; -} - -void init_dinSalesTariffType(struct dinSalesTariffType* dinSalesTariffType) { - dinSalesTariffType->SalesTariffDescription_isUsed = 0u; - dinSalesTariffType->SalesTariffEntry.arrayLen = 0u; -} - -void init_dinSignatureValueType(struct dinSignatureValueType* dinSignatureValueType) { - dinSignatureValueType->Id_isUsed = 0u; -} - -void init_dinEVStatusType(struct dinEVStatusType* dinEVStatusType) { -} - -void init_dinChargingStatusResType(struct dinChargingStatusResType* dinChargingStatusResType) { - dinChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; - dinChargingStatusResType->MeterInfo_isUsed = 0u; -} - -void init_dinManifestType(struct dinManifestType* dinManifestType) { - dinManifestType->Id_isUsed = 0u; - dinManifestType->Reference.arrayLen = 0u; -} - -void init_dinSASchedulesType(struct dinSASchedulesType* dinSASchedulesType) { -} - -void init_dinPMaxScheduleEntryType(struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { - dinPMaxScheduleEntryType->TimeInterval_isUsed = 0u; - dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u; -} - -void init_dinDC_EVSEStatusType(struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { - dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; -} - -void init_dinPreChargeReqType(struct dinPreChargeReqType* dinPreChargeReqType) { -} - -void init_dinTransformsType(struct dinTransformsType* dinTransformsType) { - dinTransformsType->Transform.arrayLen = 0u; -} - -void init_dinParameterType(struct dinParameterType* dinParameterType) { - dinParameterType->boolValue_isUsed = 0u; - dinParameterType->byteValue_isUsed = 0u; - dinParameterType->shortValue_isUsed = 0u; - dinParameterType->intValue_isUsed = 0u; - dinParameterType->physicalValue_isUsed = 0u; - dinParameterType->stringValue_isUsed = 0u; -} - -void init_dinPaymentDetailsResType(struct dinPaymentDetailsResType* dinPaymentDetailsResType) { -} - void init_dinPowerDeliveryResType(struct dinPowerDeliveryResType* dinPowerDeliveryResType) { dinPowerDeliveryResType->EVSEStatus_isUsed = 0u; dinPowerDeliveryResType->AC_EVSEStatus_isUsed = 0u; dinPowerDeliveryResType->DC_EVSEStatus_isUsed = 0u; } -void init_dinCertificateChainType(struct dinCertificateChainType* dinCertificateChainType) { - dinCertificateChainType->SubCertificates_isUsed = 0u; -} - -void init_dinDC_EVStatusType(struct dinDC_EVStatusType* dinDC_EVStatusType) { - dinDC_EVStatusType->EVCabinConditioning_isUsed = 0u; - dinDC_EVStatusType->EVRESSConditioning_isUsed = 0u; -} - -void init_dinSelectedServiceType(struct dinSelectedServiceType* dinSelectedServiceType) { - dinSelectedServiceType->ParameterSetID_isUsed = 0u; -} - -void init_dinServiceTagType(struct dinServiceTagType* dinServiceTagType) { - dinServiceTagType->ServiceName_isUsed = 0u; - dinServiceTagType->ServiceScope_isUsed = 0u; -} - -void init_dinContractAuthenticationReqType(struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { - dinContractAuthenticationReqType->Id_isUsed = 0u; - dinContractAuthenticationReqType->GenChallenge_isUsed = 0u; -} - -void init_dinDC_EVPowerDeliveryParameterType(struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { - dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; -} - -void init_dinServiceDiscoveryReqType(struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { - dinServiceDiscoveryReqType->ServiceScope_isUsed = 0u; - dinServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; -} - -void init_dinSessionStopType(struct dinSessionStopType* dinSessionStopType) { -} - -void init_dinServiceTagListType(struct dinServiceTagListType* dinServiceTagListType) { - dinServiceTagListType->Service.arrayLen = 0u; -} - -void init_dinWeldingDetectionResType(struct dinWeldingDetectionResType* dinWeldingDetectionResType) { -} - -void init_dinAnonType_V2G_Message(struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { -} - -void init_dinDC_EVSEChargeParameterType(struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { - dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 0u; - dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; - dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u; -} - -void init_dinSalesTariffEntryType(struct dinSalesTariffEntryType* dinSalesTariffEntryType) { - dinSalesTariffEntryType->TimeInterval_isUsed = 0u; - dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; - dinSalesTariffEntryType->ConsumptionCost.arrayLen = 0u; -} - -void init_dinEVChargeParameterType(struct dinEVChargeParameterType* dinEVChargeParameterType) { -} - -void init_dinPaymentDetailsReqType(struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { -} - -void init_dinSessionSetupReqType(struct dinSessionSetupReqType* dinSessionSetupReqType) { -} - -void init_dinChargingStatusReqType(struct dinChargingStatusReqType* dinChargingStatusReqType) { -} - -void init_dinSignaturePropertyType(struct dinSignaturePropertyType* dinSignaturePropertyType) { - dinSignaturePropertyType->Id_isUsed = 0u; -} - -void init_dinCertificateUpdateResType(struct dinCertificateUpdateResType* dinCertificateUpdateResType) { -} - -void init_dinServiceDetailResType(struct dinServiceDetailResType* dinServiceDetailResType) { - dinServiceDetailResType->ServiceParameterList_isUsed = 0u; -} - void init_dinDSAKeyValueType(struct dinDSAKeyValueType* dinDSAKeyValueType) { dinDSAKeyValueType->P_isUsed = 0u; dinDSAKeyValueType->Q_isUsed = 0u; @@ -561,49 +891,26 @@ void init_dinDSAKeyValueType(struct dinDSAKeyValueType* dinDSAKeyValueType) { dinDSAKeyValueType->PgenCounter_isUsed = 0u; } -void init_dinAC_EVSEChargeParameterType(struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { +void init_dinCertificateUpdateResType(struct dinCertificateUpdateResType* dinCertificateUpdateResType) { } -void init_dinObjectType(struct dinObjectType* dinObjectType) { - dinObjectType->Id_isUsed = 0u; - dinObjectType->MimeType_isUsed = 0u; - dinObjectType->Encoding_isUsed = 0u; +void init_dinSessionStopType(struct dinSessionStopType* dinSessionStopType) { } -void init_dinKeyValueType(struct dinKeyValueType* dinKeyValueType) { - dinKeyValueType->DSAKeyValue_isUsed = 0u; - dinKeyValueType->RSAKeyValue_isUsed = 0u; +void init_dinEVSEChargeParameterType(struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { } -void init_dinEVPowerDeliveryParameterType(struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { +void init_dinEntryType(struct dinEntryType* dinEntryType) { + dinEntryType->TimeInterval_isUsed = 0u; + dinEntryType->RelativeTimeInterval_isUsed = 0u; } -void init_dinDigestMethodType(struct dinDigestMethodType* dinDigestMethodType) { +void init_dinListOfRootCertificateIDsType(struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { + dinListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u; } -void init_dinCertificateUpdateReqType(struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { - dinCertificateUpdateReqType->Id_isUsed = 0u; -} - -void init_dinMeteringReceiptReqType(struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { - dinMeteringReceiptReqType->Id_isUsed = 0u; - dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; -} - -void init_dinConsumptionCostType(struct dinConsumptionCostType* dinConsumptionCostType) { - dinConsumptionCostType->Cost.arrayLen = 0u; -} - -void init_dinSessionStopResType(struct dinSessionStopResType* dinSessionStopResType) { -} - -void init_dinSignaturePropertiesType(struct dinSignaturePropertiesType* dinSignaturePropertiesType) { - dinSignaturePropertiesType->Id_isUsed = 0u; - dinSignaturePropertiesType->SignatureProperty.arrayLen = 0u; -} - -void init_dinNotificationType(struct dinNotificationType* dinNotificationType) { - dinNotificationType->FaultMsg_isUsed = 0u; +void init_dinSignatureMethodType(struct dinSignatureMethodType* dinSignatureMethodType) { + dinSignatureMethodType->HMACOutputLength_isUsed = 0u; } diff --git a/src/din/dinEXIDatatypes.h b/src/din/dinEXIDatatypes.h index faeecfc..b24f7ea 100644 --- a/src/din/dinEXIDatatypes.h +++ b/src/din/dinEXIDatatypes.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -45,6 +45,7 @@ extern "C" { #define SUPPORT_YES 1 #define SUPPORT_NO 2 #define DEPLOY_DIN_CODEC SUPPORT_NO +#define DEPLOY_DIN_CODEC_FRAGMENT SUPPORT_NO #if DEPLOY_DIN_CODEC == SUPPORT_YES @@ -59,20 +60,15 @@ extern "C" { #define UNION_NO 2 #define SAVE_MEMORY_WITH_UNNAMED_UNION UNION_YES -typedef enum { - dinDC_EVErrorCodeType_NO_ERROR = 0, - dinDC_EVErrorCodeType_FAILED_RESSTemperatureInhibit = 1, - dinDC_EVErrorCodeType_FAILED_EVShiftPosition = 2, - dinDC_EVErrorCodeType_FAILED_ChargerConnectorLockFault = 3, - dinDC_EVErrorCodeType_FAILED_EVRESSMalfunction = 4, - dinDC_EVErrorCodeType_FAILED_ChargingCurrentdifferential = 5, - dinDC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange = 6, - dinDC_EVErrorCodeType_Reserved_A = 7, - dinDC_EVErrorCodeType_Reserved_B = 8, - dinDC_EVErrorCodeType_Reserved_C = 9, - dinDC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility = 10, - dinDC_EVErrorCodeType_NoData = 11 -} dinDC_EVErrorCodeType; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 65 +struct dinCanonicalizationMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; /* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ struct dinServiceDetailReqType { @@ -80,42 +76,6 @@ struct dinServiceDetailReqType { uint16_t ServiceID ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinEVSEChargeParameterType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -#define dinRSAKeyValueType_Modulus_BYTES_SIZE 350 -#define dinRSAKeyValueType_Exponent_BYTES_SIZE 350 -struct dinRSAKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[dinRSAKeyValueType_Modulus_BYTES_SIZE]; - uint16_t bytesLen; - } Modulus ; - /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ - struct { - uint8_t bytes[dinRSAKeyValueType_Exponent_BYTES_SIZE]; - uint16_t bytesLen; - } Exponent ; -}; - -typedef enum { - dinDC_EVSEStatusCodeType_EVSE_NotReady = 0, - dinDC_EVSEStatusCodeType_EVSE_Ready = 1, - dinDC_EVSEStatusCodeType_EVSE_Shutdown = 2, - dinDC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent = 3, - dinDC_EVSEStatusCodeType_EVSE_IsolationMonitoringActive = 4, - dinDC_EVSEStatusCodeType_EVSE_EmergencyShutdown = 5, - dinDC_EVSEStatusCodeType_EVSE_Malfunction = 6, - dinDC_EVSEStatusCodeType_Reserved_8 = 7, - dinDC_EVSEStatusCodeType_Reserved_9 = 8, - dinDC_EVSEStatusCodeType_Reserved_A = 9, - dinDC_EVSEStatusCodeType_Reserved_B = 10, - dinDC_EVSEStatusCodeType_Reserved_C = 11 -} dinDC_EVSEStatusCodeType; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ #define dinSPKIDataType_SPKISexp_BYTES_SIZE 350 #define dinSPKIDataType_SPKISexp_ARRAY_SIZE 1 @@ -130,35 +90,22 @@ struct dinSPKIDataType { } SPKISexp; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinBodyBaseType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ -struct dinProfileEntryType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t ChargingProfileEntryStart ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower, urn:iso:15118:2:2010:MsgDataTypes,PMaxType */ - int16_t ChargingProfileEntryMaxPower ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinSignatureMethodType_Algorithm_CHARACTERS_SIZE 50 -struct dinSignatureMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +#define dinPGPDataType_PGPKeyID_BYTES_SIZE 350 +#define dinPGPDataType_PGPKeyPacket_BYTES_SIZE 350 +struct dinPGPDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ struct { - exi_string_character_t characters[dinSignatureMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; - /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ - int64_t HMACOutputLength ; - unsigned int HMACOutputLength_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinIntervalType { - int noContent; /* avoid warning */ + uint8_t bytes[dinPGPDataType_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + unsigned int PGPKeyID_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[dinPGPDataType_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + unsigned int PGPKeyPacket_isUsed:1; }; typedef enum { @@ -187,60 +134,92 @@ typedef enum { dinresponseCodeType_FAILED_WrongEnergyTransferType = 22 } dinresponseCodeType; +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinBodyBaseType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinDigestMethodType_Algorithm_CHARACTERS_SIZE 65 +struct dinDigestMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinDigestMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; + +typedef enum { + dinDC_EVErrorCodeType_NO_ERROR = 0, + dinDC_EVErrorCodeType_FAILED_RESSTemperatureInhibit = 1, + dinDC_EVErrorCodeType_FAILED_EVShiftPosition = 2, + dinDC_EVErrorCodeType_FAILED_ChargerConnectorLockFault = 3, + dinDC_EVErrorCodeType_FAILED_EVRESSMalfunction = 4, + dinDC_EVErrorCodeType_FAILED_ChargingCurrentdifferential = 5, + dinDC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange = 6, + dinDC_EVErrorCodeType_Reserved_A = 7, + dinDC_EVErrorCodeType_Reserved_B = 8, + dinDC_EVErrorCodeType_Reserved_C = 9, + dinDC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility = 10, + dinDC_EVErrorCodeType_NoData = 11 +} dinDC_EVErrorCodeType; + /* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ struct dinServicePaymentSelectionResType { /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ dinresponseCodeType ResponseCode ; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -#define dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 -struct dinX509IssuerSerialType { - /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ - struct { - exi_string_character_t characters[dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } X509IssuerName ; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ - int64_t X509SerialNumber ; -}; - typedef enum { dinEVSENotificationType_None = 0, dinEVSENotificationType_StopCharging = 1, dinEVSENotificationType_ReNegotiation = 2 } dinEVSENotificationType; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinSubCertificatesType_Certificate_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ -#define dinSubCertificatesType_Certificate_ARRAY_SIZE 5 -struct dinSubCertificatesType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Certificate, urn:iso:15118:2:2010:MsgDataTypes,certificateType */ +typedef enum { + dincostKindType_relativePricePercentage = 0, + dincostKindType_RenewableGenerationPercentage = 1, + dincostKindType_CarbonDioxideEmission = 2 +} dincostKindType; + +typedef enum { + dinisolationLevelType_Invalid = 0, + dinisolationLevelType_Valid = 1, + dinisolationLevelType_Warning = 2, + dinisolationLevelType_Fault = 3 +} dinisolationLevelType; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +#define dinContractAuthenticationReqType_Id_CHARACTERS_SIZE 50 +#define dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE 50 +struct dinContractAuthenticationReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ struct { - struct { - uint8_t bytes[dinSubCertificatesType_Certificate_BYTES_SIZE]; - uint16_t bytesLen; - } array[dinSubCertificatesType_Certificate_ARRAY_SIZE]; - uint16_t arrayLen; - } Certificate; + exi_string_character_t characters[dinContractAuthenticationReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":GenChallenge, urn:iso:15118:2:2010:MsgDataTypes,genChallengeType */ + struct { + exi_string_character_t characters[dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE]; + uint16_t charactersLen; + } GenChallenge ; + unsigned int GenChallenge_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinEVSEStatusType { - int noContent; /* avoid warning */ -}; +typedef enum { + dinvalueType_bool = 0, + dinvalueType_byte = 1, + dinvalueType_short = 2, + dinvalueType_int = 3, + dinvalueType_physicalValue = 4, + dinvalueType_string = 5 +} dinvalueType; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -struct dinAC_EVSEStatusType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed, http://www.w3.org/2001/XMLSchema,boolean */ - int PowerSwitchClosed ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":RCD, http://www.w3.org/2001/XMLSchema,boolean */ - int RCD ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t NotificationMaxDelay ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSENotification, urn:iso:15118:2:2010:MsgDataTypes,EVSENotificationType */ - dinEVSENotificationType EVSENotification ; -}; +typedef enum { + dinpaymentOptionType_Contract = 0, + dinpaymentOptionType_ExternalPayment = 1 +} dinpaymentOptionType; typedef enum { dinunitSymbolType_h = 0, @@ -255,68 +234,78 @@ typedef enum { dinunitSymbolType_Wh = 9 } dinunitSymbolType; -typedef enum { - dinfaultCodeType_ParsingError = 0, - dinfaultCodeType_NoTLSRootCertificatAvailable = 1, - dinfaultCodeType_UnknownError = 2 -} dinfaultCodeType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -#define dinPGPDataType_PGPKeyID_BYTES_SIZE 350 -#define dinPGPDataType_PGPKeyPacket_BYTES_SIZE 350 -struct dinPGPDataType { - /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[dinPGPDataType_PGPKeyID_BYTES_SIZE]; - uint16_t bytesLen; - } PGPKeyID ; - unsigned int PGPKeyID_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[dinPGPDataType_PGPKeyPacket_BYTES_SIZE]; - uint16_t bytesLen; - } PGPKeyPacket ; - unsigned int PGPKeyPacket_isUsed:1; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ +struct dinProfileEntryType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t ChargingProfileEntryStart ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower, urn:iso:15118:2:2010:MsgDataTypes,PMaxType */ + int16_t ChargingProfileEntryMaxPower ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinChargingProfileType_ProfileEntry_ARRAY_SIZE 5 -struct dinChargingProfileType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ - int16_t SAScheduleTupleID ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinPaymentOptionsType_PaymentOption_ARRAY_SIZE 5 +struct dinPaymentOptionsType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PaymentOption, urn:iso:15118:2:2010:MsgDataTypes,paymentOptionType */ struct { - struct dinProfileEntryType array[dinChargingProfileType_ProfileEntry_ARRAY_SIZE]; + dinpaymentOptionType array[dinPaymentOptionsType_PaymentOption_ARRAY_SIZE]; uint16_t arrayLen; - } ProfileEntry; + } PaymentOption; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE 40 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,rootCertificateIDType is 40 */ -#define dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE 5 -struct dinListOfRootCertificateIDsType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID, urn:iso:15118:2:2010:MsgDataTypes,rootCertificateIDType */ +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinSignaturePropertyType_Target_CHARACTERS_SIZE 50 +#define dinSignaturePropertyType_Id_CHARACTERS_SIZE 50 +struct dinSignaturePropertyType { + /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { - struct { - exi_string_character_t characters[dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } array[dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE]; - uint16_t arrayLen; - } RootCertificateID; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 50 -struct dinCanonicalizationMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; + exi_string_character_t characters[dinSignaturePropertyType_Target_CHARACTERS_SIZE]; uint16_t charactersLen; - } Algorithm ; + } Target ; + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignaturePropertyType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVPowerDeliveryParameterType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +struct dinDC_EVStatusType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVReady, http://www.w3.org/2001/XMLSchema,boolean */ + int EVReady ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning, http://www.w3.org/2001/XMLSchema,boolean */ + int EVCabinConditioning ; + unsigned int EVCabinConditioning_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning, http://www.w3.org/2001/XMLSchema,boolean */ + int EVRESSConditioning ; + unsigned int EVRESSConditioning_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode, urn:iso:15118:2:2010:MsgDataTypes,DC_EVErrorCodeType */ + dinDC_EVErrorCodeType EVErrorCode ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ + int8_t EVRESSSOC ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +struct dinSelectedServiceType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ + int16_t ParameterSetID ; + unsigned int ParameterSetID_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinIntervalType { + int noContent; /* avoid warning */ }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define dinTransformType_Algorithm_CHARACTERS_SIZE 50 +#define dinTransformType_Algorithm_CHARACTERS_SIZE 65 #define dinTransformType_XPath_CHARACTERS_SIZE 50 #define dinTransformType_XPath_ARRAY_SIZE 1 struct dinTransformType { @@ -335,18 +324,264 @@ struct dinTransformType { } XPath; }; -typedef enum { - dincostKindType_relativePricePercentage = 0, - dincostKindType_RenewableGenerationPercentage = 1, - dincostKindType_CarbonDioxideEmission = 2 -} dincostKindType; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVChargeParameterType { + int noContent; /* avoid warning */ +}; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -struct dinMeteringReceiptResType { +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +struct dinSessionStopResType { /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinAC_EVSEStatusType AC_EVSEStatus ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinObjectType_Id_CHARACTERS_SIZE 50 +#define dinObjectType_MimeType_CHARACTERS_SIZE 50 +#define dinObjectType_Encoding_CHARACTERS_SIZE 50 +struct dinObjectType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinObjectType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ + struct { + exi_string_character_t characters[dinObjectType_MimeType_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MimeType ; + unsigned int MimeType_isUsed:1; + /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinObjectType_Encoding_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Encoding ; + unsigned int Encoding_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define dinSignatureValueType_Id_CHARACTERS_SIZE 50 +#define dinSignatureValueType_CONTENT_BYTES_SIZE 350 +struct dinSignatureValueType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignatureValueType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[dinSignatureValueType_CONTENT_BYTES_SIZE]; + uint16_t bytesLen; + } CONTENT ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSelectedServiceListType_SelectedService_ARRAY_SIZE 5 +struct dinSelectedServiceListType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SelectedService, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct dinSelectedServiceType array[dinSelectedServiceListType_SelectedService_ARRAY_SIZE]; + uint16_t arrayLen; + } SelectedService; +}; + +typedef enum { + dinDC_EVSEStatusCodeType_EVSE_NotReady = 0, + dinDC_EVSEStatusCodeType_EVSE_Ready = 1, + dinDC_EVSEStatusCodeType_EVSE_Shutdown = 2, + dinDC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent = 3, + dinDC_EVSEStatusCodeType_EVSE_IsolationMonitoringActive = 4, + dinDC_EVSEStatusCodeType_EVSE_EmergencyShutdown = 5, + dinDC_EVSEStatusCodeType_EVSE_Malfunction = 6, + dinDC_EVSEStatusCodeType_Reserved_8 = 7, + dinDC_EVSEStatusCodeType_Reserved_9 = 8, + dinDC_EVSEStatusCodeType_Reserved_A = 9, + dinDC_EVSEStatusCodeType_Reserved_B = 10, + dinDC_EVSEStatusCodeType_Reserved_C = 11 +} dinDC_EVSEStatusCodeType; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +#define dinRSAKeyValueType_Modulus_BYTES_SIZE 350 +#define dinRSAKeyValueType_Exponent_BYTES_SIZE 350 +struct dinRSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinRSAKeyValueType_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinRSAKeyValueType_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +struct dinRelativeTimeIntervalType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":start, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t start ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":duration, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t duration ; + unsigned int duration_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinChargingProfileType_ProfileEntry_ARRAY_SIZE 5 +struct dinChargingProfileType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ + struct { + struct dinProfileEntryType array[dinChargingProfileType_ProfileEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } ProfileEntry; +}; + +typedef enum { + dinserviceCategoryType_EVCharging = 0, + dinserviceCategoryType_Internet = 1, + dinserviceCategoryType_ContractCertificate = 2, + dinserviceCategoryType_OtherCustom = 3 +} dinserviceCategoryType; + +typedef enum { + dinEVSEProcessingType_Finished = 0, + dinEVSEProcessingType_Ongoing = 1 +} dinEVSEProcessingType; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +struct dinServicePaymentSelectionReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption, urn:iso:15118:2:2010:MsgDataTypes,paymentOptionType */ + dinpaymentOptionType SelectedPaymentOption ; + /* element: "urn:iso:15118:2:2010:MsgBody":SelectedServiceList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSelectedServiceListType SelectedServiceList ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct dinContractAuthenticationResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEProcessing, urn:iso:15118:2:2010:MsgDataTypes,EVSEProcessingType */ + dinEVSEProcessingType EVSEProcessing ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +struct dinChargingStatusReqType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ +#define dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE 50 +struct dinPaymentDetailsResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":GenChallenge, urn:iso:15118:2:2010:MsgDataTypes,genChallengeType */ + struct { + exi_string_character_t characters[dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE]; + uint16_t charactersLen; + } GenChallenge ; + /* element: "urn:iso:15118:2:2010:MsgBody":DateTimeNow, http://www.w3.org/2001/XMLSchema,long */ + int64_t DateTimeNow ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinSASchedulesType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ +#define dinServiceTagType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceNameType is 32 */ +#define dinServiceTagType_ServiceScope_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType is 32 */ +struct dinServiceTagType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceName, urn:iso:15118:2:2010:MsgDataTypes,serviceNameType */ + struct { + exi_string_character_t characters[dinServiceTagType_ServiceName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceName ; + unsigned int ServiceName_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2010:MsgDataTypes,serviceCategoryType */ + dinserviceCategoryType ServiceCategory ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceScope, urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[dinServiceTagType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVSEStatusType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +#define dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType is 32 */ +struct dinServiceDiscoveryReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceScope, urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceCategory, urn:iso:15118:2:2010:MsgDataTypes,serviceCategoryType */ + dinserviceCategoryType ServiceCategory ; + unsigned int ServiceCategory_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +struct dinCostType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":costKind, urn:iso:15118:2:2010:MsgDataTypes,costKindType */ + dincostKindType costKind ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":amount, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t amount ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier, urn:iso:15118:2:2010:MsgDataTypes,unitMultiplierType */ + int8_t amountMultiplier ; + unsigned int amountMultiplier_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSubCertificatesType_Certificate_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ +#define dinSubCertificatesType_Certificate_ARRAY_SIZE 5 +struct dinSubCertificatesType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Certificate, urn:iso:15118:2:2010:MsgDataTypes,certificateType */ + struct { + struct { + uint8_t bytes[dinSubCertificatesType_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } array[dinSubCertificatesType_Certificate_ARRAY_SIZE]; + uint16_t arrayLen; + } Certificate; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +#define dinSessionSetupReqType_EVCCID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evccIDType is 8 */ +struct dinSessionSetupReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":EVCCID, urn:iso:15118:2:2010:MsgDataTypes,evccIDType */ + struct { + uint8_t bytes[dinSessionSetupReqType_EVCCID_BYTES_SIZE]; + uint16_t bytesLen; + } EVCCID ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +#define dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 +struct dinX509IssuerSerialType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ + int64_t X509SerialNumber ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVStatusType { + int noContent; /* avoid warning */ }; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ @@ -399,371 +634,6 @@ struct dinX509DataType { } X509CRL; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -struct dinPhysicalValueType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Multiplier, urn:iso:15118:2:2010:MsgDataTypes,unitMultiplierType */ - int8_t Multiplier ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Unit, urn:iso:15118:2:2010:MsgDataTypes,unitSymbolType */ - dinunitSymbolType Unit ; - unsigned int Unit_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Value, http://www.w3.org/2001/XMLSchema,short */ - int16_t Value ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -struct dinRelativeTimeIntervalType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":start, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t start ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":duration, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t duration ; - unsigned int duration_isUsed:1; -}; - -typedef enum { - dinisolationLevelType_Invalid = 0, - dinisolationLevelType_Valid = 1, - dinisolationLevelType_Warning = 2, - dinisolationLevelType_Fault = 3 -} dinisolationLevelType; - -typedef enum { - dinEVSEProcessingType_Finished = 0, - dinEVSEProcessingType_Ongoing = 1 -} dinEVSEProcessingType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define dinSignatureValueType_Id_CHARACTERS_SIZE 50 -#define dinSignatureValueType_CONTENT_BYTES_SIZE 350 -struct dinSignatureValueType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[dinSignatureValueType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[dinSignatureValueType_CONTENT_BYTES_SIZE]; - uint16_t bytesLen; - } CONTENT ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinEVStatusType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinSASchedulesType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -struct dinPMaxScheduleEntryType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct dinIntervalType TimeInterval ; - unsigned int TimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ - struct dinRelativeTimeIntervalType RelativeTimeInterval ; - unsigned int RelativeTimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMax, urn:iso:15118:2:2010:MsgDataTypes,PMaxType */ - int16_t PMax ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -struct dinDC_EVSEStatusType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus, urn:iso:15118:2:2010:MsgDataTypes,isolationLevelType */ - dinisolationLevelType EVSEIsolationStatus ; - unsigned int EVSEIsolationStatus_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode, urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusCodeType */ - dinDC_EVSEStatusCodeType EVSEStatusCode ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t NotificationMaxDelay ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSENotification, urn:iso:15118:2:2010:MsgDataTypes,EVSENotificationType */ - dinEVSENotificationType EVSENotification ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinTransformsType_Transform_ARRAY_SIZE 1 -struct dinTransformsType { - /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct dinTransformType array[dinTransformsType_Transform_ARRAY_SIZE]; - uint16_t arrayLen; - } Transform; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ -#define dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE 50 -struct dinPaymentDetailsResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":GenChallenge, urn:iso:15118:2:2010:MsgDataTypes,genChallengeType */ - struct { - exi_string_character_t characters[dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE]; - uint16_t charactersLen; - } GenChallenge ; - /* element: "urn:iso:15118:2:2010:MsgBody":DateTimeNow, http://www.w3.org/2001/XMLSchema,long */ - int64_t DateTimeNow ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -struct dinPowerDeliveryResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct dinEVSEStatusType EVSEStatus ; - unsigned int EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinAC_EVSEStatusType AC_EVSEStatus ; - unsigned int AC_EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinDC_EVSEStatusType DC_EVSEStatus ; - unsigned int DC_EVSEStatus_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -#define dinCertificateChainType_Certificate_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ -struct dinCertificateChainType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Certificate, urn:iso:15118:2:2010:MsgDataTypes,certificateType */ - struct { - uint8_t bytes[dinCertificateChainType_Certificate_BYTES_SIZE]; - uint16_t bytesLen; - } Certificate ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":SubCertificates, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinSubCertificatesType SubCertificates ; - unsigned int SubCertificates_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -struct dinDC_EVStatusType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVReady, http://www.w3.org/2001/XMLSchema,boolean */ - int EVReady ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning, http://www.w3.org/2001/XMLSchema,boolean */ - int EVCabinConditioning ; - unsigned int EVCabinConditioning_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning, http://www.w3.org/2001/XMLSchema,boolean */ - int EVRESSConditioning ; - unsigned int EVRESSConditioning_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode, urn:iso:15118:2:2010:MsgDataTypes,DC_EVErrorCodeType */ - dinDC_EVErrorCodeType EVErrorCode ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ - int8_t EVRESSSOC ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -struct dinSelectedServiceType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ - int16_t ParameterSetID ; - unsigned int ParameterSetID_isUsed:1; -}; - -typedef enum { - dinserviceCategoryType_EVCharging = 0, - dinserviceCategoryType_Internet = 1, - dinserviceCategoryType_ContractCertificate = 2, - dinserviceCategoryType_OtherCustom = 3 -} dinserviceCategoryType; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ -#define dinServiceTagType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceNameType is 32 */ -#define dinServiceTagType_ServiceScope_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType is 32 */ -struct dinServiceTagType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceName, urn:iso:15118:2:2010:MsgDataTypes,serviceNameType */ - struct { - exi_string_character_t characters[dinServiceTagType_ServiceName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceName ; - unsigned int ServiceName_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2010:MsgDataTypes,serviceCategoryType */ - dinserviceCategoryType ServiceCategory ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceScope, urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType */ - struct { - exi_string_character_t characters[dinServiceTagType_ServiceScope_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceScope ; - unsigned int ServiceScope_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -#define dinContractAuthenticationReqType_Id_CHARACTERS_SIZE 50 -#define dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE 50 -struct dinContractAuthenticationReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ - struct { - exi_string_character_t characters[dinContractAuthenticationReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgBody":GenChallenge, urn:iso:15118:2:2010:MsgDataTypes,genChallengeType */ - struct { - exi_string_character_t characters[dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE]; - uint16_t charactersLen; - } GenChallenge ; - unsigned int GenChallenge_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -struct dinDC_EVPowerDeliveryParameterType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct dinDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ - int BulkChargingComplete ; - unsigned int BulkChargingComplete_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ - int ChargingComplete ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -#define dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType is 32 */ -struct dinServiceDiscoveryReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":ServiceScope, urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType */ - struct { - exi_string_character_t characters[dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceScope ; - unsigned int ServiceScope_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgBody":ServiceCategory, urn:iso:15118:2:2010:MsgDataTypes,serviceCategoryType */ - dinserviceCategoryType ServiceCategory ; - unsigned int ServiceCategory_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -struct dinSessionStopType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -struct dinWeldingDetectionResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEPresentVoltage ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -struct dinDC_EVSEChargeParameterType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaximumCurrentLimit ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaximumPowerLimit ; - unsigned int EVSEMaximumPowerLimit_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaximumVoltageLimit ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMinimumCurrentLimit ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMinimumVoltageLimit ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSECurrentRegulationTolerance ; - unsigned int EVSECurrentRegulationTolerance_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEPeakCurrentRipple ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEEnergyToBeDelivered ; - unsigned int EVSEEnergyToBeDelivered_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinEVChargeParameterType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -#define dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ -struct dinPaymentDetailsReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ - struct { - exi_string_character_t characters[dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ContractID ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct dinCertificateChainType ContractSignatureCertChain ; -}; - -typedef enum { - dinvalueType_bool = 0, - dinvalueType_byte = 1, - dinvalueType_short = 2, - dinvalueType_int = 3, - dinvalueType_physicalValue = 4, - dinvalueType_string = 5 -} dinvalueType; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -#define dinSessionSetupReqType_EVCCID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evccIDType is 8 */ -struct dinSessionSetupReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":EVCCID, urn:iso:15118:2:2010:MsgDataTypes,evccIDType */ - struct { - uint8_t bytes[dinSessionSetupReqType_EVCCID_BYTES_SIZE]; - uint16_t bytesLen; - } EVCCID ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -struct dinChargingStatusReqType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define dinSignaturePropertyType_Target_CHARACTERS_SIZE 50 -#define dinSignaturePropertyType_Id_CHARACTERS_SIZE 50 -struct dinSignaturePropertyType { - /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[dinSignaturePropertyType_Target_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Target ; - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[dinSignaturePropertyType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ -#define dinCertificateUpdateResType_Id_CHARACTERS_SIZE 50 -#define dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE 128 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,privateKeyType is 128 */ -#define dinCertificateUpdateResType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ -#define dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ -struct dinCertificateUpdateResType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ - struct { - exi_string_character_t characters[dinCertificateUpdateResType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct dinCertificateChainType ContractSignatureCertChain ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey, urn:iso:15118:2:2010:MsgDataTypes,privateKeyType */ - struct { - uint8_t bytes[dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE]; - uint16_t bytesLen; - } ContractSignatureEncryptedPrivateKey ; - /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ - struct { - uint8_t bytes[dinCertificateUpdateResType_DHParams_BYTES_SIZE]; - uint16_t bytesLen; - } DHParams ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ - struct { - exi_string_character_t characters[dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ContractID ; - /* element: "urn:iso:15118:2:2010:MsgBody":RetryCounter, http://www.w3.org/2001/XMLSchema,short */ - int16_t RetryCounter ; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ #define dinDSAKeyValueType_P_BYTES_SIZE 350 #define dinDSAKeyValueType_Q_BYTES_SIZE 350 @@ -816,95 +686,6 @@ struct dinDSAKeyValueType { unsigned int PgenCounter_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ -struct dinAC_EVSEChargeParameterType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinAC_EVSEStatusType AC_EVSEStatus ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaxVoltage ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaxCurrent ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMinCurrent ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define dinObjectType_Id_CHARACTERS_SIZE 50 -#define dinObjectType_MimeType_CHARACTERS_SIZE 50 -#define dinObjectType_Encoding_CHARACTERS_SIZE 50 -struct dinObjectType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[dinObjectType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ - struct { - exi_string_character_t characters[dinObjectType_MimeType_CHARACTERS_SIZE]; - uint16_t charactersLen; - } MimeType ; - unsigned int MimeType_isUsed:1; - /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[dinObjectType_Encoding_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Encoding ; - unsigned int Encoding_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -struct dinKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ - struct dinDSAKeyValueType DSAKeyValue ; - unsigned int DSAKeyValue_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ - struct dinRSAKeyValueType RSAKeyValue ; - unsigned int RSAKeyValue_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinDigestMethodType_Algorithm_CHARACTERS_SIZE 50 -struct dinDigestMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[dinDigestMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct dinEVPowerDeliveryParameterType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -#define dinCertificateUpdateReqType_Id_CHARACTERS_SIZE 50 -#define dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ -#define dinCertificateUpdateReqType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ -struct dinCertificateUpdateReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ - struct { - exi_string_character_t characters[dinCertificateUpdateReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct dinCertificateChainType ContractSignatureCertChain ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ - struct { - exi_string_character_t characters[dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ContractID ; - /* element: "urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinListOfRootCertificateIDsType ListOfRootCertificateIDs ; - /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ - struct { - uint8_t bytes[dinCertificateUpdateReqType_DHParams_BYTES_SIZE]; - uint16_t bytesLen; - } DHParams ; -}; - typedef enum { dinEVRequestedEnergyTransferType_AC_single_phase_core = 0, dinEVRequestedEnergyTransferType_AC_three_phase_core = 1, @@ -914,6 +695,22 @@ typedef enum { dinEVRequestedEnergyTransferType_DC_unique = 5 } dinEVRequestedEnergyTransferType; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +struct dinSessionStopType { + int noContent; /* avoid warning */ +}; + +typedef enum { + dinfaultCodeType_ParsingError = 0, + dinfaultCodeType_NoTLSRootCertificatAvailable = 1, + dinfaultCodeType_UnknownError = 2 +} dinfaultCodeType; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVSEChargeParameterType { + int noContent; /* avoid warning */ +}; + typedef enum { dinEVSESupportedEnergyTransferType_AC_single_phase_core = 0, dinEVSESupportedEnergyTransferType_AC_three_phase_core = 1, @@ -927,10 +724,106 @@ typedef enum { dinEVSESupportedEnergyTransferType_AC_core3p_DC_extended = 9 } dinEVSESupportedEnergyTransferType; -typedef enum { - dinpaymentOptionType_Contract = 0, - dinpaymentOptionType_ExternalPayment = 1 -} dinpaymentOptionType; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +struct dinEntryType { + /* substitutionGroup */ +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + union { +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + /* element: "urn:iso:15118:2:2010:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinIntervalType TimeInterval ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct dinRelativeTimeIntervalType RelativeTimeInterval ; +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + }; +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + unsigned int TimeInterval_isUsed:1; + unsigned int RelativeTimeInterval_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE 40 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,rootCertificateIDType is 40 */ +#define dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE 5 +struct dinListOfRootCertificateIDsType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID, urn:iso:15118:2:2010:MsgDataTypes,rootCertificateIDType */ + struct { + struct { + exi_string_character_t characters[dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE]; + uint16_t arrayLen; + } RootCertificateID; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSignatureMethodType_Algorithm_CHARACTERS_SIZE 65 +struct dinSignatureMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinSignatureMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ + int64_t HMACOutputLength ; + unsigned int HMACOutputLength_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +struct dinAC_EVSEStatusType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed, http://www.w3.org/2001/XMLSchema,boolean */ + int PowerSwitchClosed ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RCD, http://www.w3.org/2001/XMLSchema,boolean */ + int RCD ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSENotification, urn:iso:15118:2:2010:MsgDataTypes,EVSENotificationType */ + dinEVSENotificationType EVSENotification ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ +#define dinSessionSetupResType_EVSEID_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evseIDType is 32 */ +struct dinSessionSetupResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEID, urn:iso:15118:2:2010:MsgDataTypes,evseIDType */ + struct { + uint8_t bytes[dinSessionSetupResType_EVSEID_BYTES_SIZE]; + uint16_t bytesLen; + } EVSEID ; + /* element: "urn:iso:15118:2:2010:MsgBody":DateTimeNow, http://www.w3.org/2001/XMLSchema,long */ + int64_t DateTimeNow ; + unsigned int DateTimeNow_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +struct dinDC_EVPowerDeliveryParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int BulkChargingComplete ; + unsigned int BulkChargingComplete_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int ChargingComplete ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct dinCableCheckReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +#define dinCertificateChainType_Certificate_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ +struct dinCertificateChainType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Certificate, urn:iso:15118:2:2010:MsgDataTypes,certificateType */ + struct { + uint8_t bytes[dinCertificateChainType_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } Certificate ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SubCertificates, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSubCertificatesType SubCertificates ; + unsigned int SubCertificates_isUsed:1; +}; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ #define dinSignaturePropertiesType_Id_CHARACTERS_SIZE 50 @@ -949,10 +842,12 @@ struct dinSignaturePropertiesType { } SignatureProperty; }; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -struct dinSessionStopResType { +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +struct dinMeteringReceiptResType { /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEStatusType AC_EVSEStatus ; }; /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ @@ -968,107 +863,122 @@ struct dinNotificationType { unsigned int FaultMsg_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -struct dinPreChargeResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEPresentVoltage ; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +struct dinPhysicalValueType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Multiplier, urn:iso:15118:2:2010:MsgDataTypes,unitMultiplierType */ + int8_t Multiplier ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Unit, urn:iso:15118:2:2010:MsgDataTypes,unitSymbolType */ + dinunitSymbolType Unit ; + unsigned int Unit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Value, http://www.w3.org/2001/XMLSchema,short */ + int16_t Value ; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -#define dinRetrievalMethodType_URI_CHARACTERS_SIZE 50 -#define dinRetrievalMethodType_Type_CHARACTERS_SIZE 50 -struct dinRetrievalMethodType { - /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[dinRetrievalMethodType_URI_CHARACTERS_SIZE]; - uint16_t charactersLen; - } URI ; - unsigned int URI_isUsed:1; - /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[dinRetrievalMethodType_Type_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Type ; - unsigned int Type_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinTransformsType Transforms ; - unsigned int Transforms_isUsed:1; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +struct dinDC_EVSEStatusType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus, urn:iso:15118:2:2010:MsgDataTypes,isolationLevelType */ + dinisolationLevelType EVSEIsolationStatus ; + unsigned int EVSEIsolationStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode, urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusCodeType */ + dinDC_EVSEStatusCodeType EVSEStatusCode ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSENotification, urn:iso:15118:2:2010:MsgDataTypes,EVSENotificationType */ + dinEVSENotificationType EVSENotification ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ -#define dinSessionSetupResType_EVSEID_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evseIDType is 32 */ -struct dinSessionSetupResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEID, urn:iso:15118:2:2010:MsgDataTypes,evseIDType */ - struct { - uint8_t bytes[dinSessionSetupResType_EVSEID_BYTES_SIZE]; - uint16_t bytesLen; - } EVSEID ; - /* element: "urn:iso:15118:2:2010:MsgBody":DateTimeNow, http://www.w3.org/2001/XMLSchema,long */ - int64_t DateTimeNow ; - unsigned int DateTimeNow_isUsed:1; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ +struct dinAC_EVSEChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEStatusType AC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaxVoltage ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaxCurrent ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMinCurrent ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ -#define dinCertificateInstallationResType_Id_CHARACTERS_SIZE 50 -#define dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE 128 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,privateKeyType is 128 */ -#define dinCertificateInstallationResType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ -#define dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ -struct dinCertificateInstallationResType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +#define dinParameterType_Name_CHARACTERS_SIZE 50 +#define dinParameterType_stringValue_CHARACTERS_SIZE 50 +struct dinParameterType { + /* attribute: Name {http://www.w3.org/2001/XMLSchema,string} */ struct { - exi_string_character_t characters[dinCertificateInstallationResType_Id_CHARACTERS_SIZE]; + exi_string_character_t characters[dinParameterType_Name_CHARACTERS_SIZE]; uint16_t charactersLen; - } Id ; - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct dinCertificateChainType ContractSignatureCertChain ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey, urn:iso:15118:2:2010:MsgDataTypes,privateKeyType */ + } Name ; + /* attribute: ValueType {urn:iso:15118:2:2010:MsgDataTypes,valueType} */ + dinvalueType ValueType ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":boolValue, http://www.w3.org/2001/XMLSchema,boolean */ + int boolValue ; + unsigned int boolValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":byteValue, http://www.w3.org/2001/XMLSchema,byte */ + int8_t byteValue ; + unsigned int byteValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":shortValue, http://www.w3.org/2001/XMLSchema,short */ + int16_t shortValue ; + unsigned int shortValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":intValue, http://www.w3.org/2001/XMLSchema,int */ + int32_t intValue ; + unsigned int intValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":physicalValue, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType physicalValue ; + unsigned int physicalValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":stringValue, http://www.w3.org/2001/XMLSchema,string */ struct { - uint8_t bytes[dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE]; - uint16_t bytesLen; - } ContractSignatureEncryptedPrivateKey ; - /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ - struct { - uint8_t bytes[dinCertificateInstallationResType_DHParams_BYTES_SIZE]; - uint16_t bytesLen; - } DHParams ; - /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ - struct { - exi_string_character_t characters[dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE]; + exi_string_character_t characters[dinParameterType_stringValue_CHARACTERS_SIZE]; uint16_t charactersLen; - } ContractID ; + } stringValue ; + unsigned int stringValue_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ -struct dinDC_EVChargeParameterType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct dinWeldingDetectionReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ struct dinDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVMaximumCurrentLimit ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVMaximumPowerLimit ; - unsigned int EVMaximumPowerLimit_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVMaximumVoltageLimit ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVEnergyCapacity ; - unsigned int EVEnergyCapacity_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVEnergyRequest ; - unsigned int EVEnergyRequest_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":FullSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ - int8_t FullSOC ; - unsigned int FullSOC_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":BulkSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ - int8_t BulkSOC ; - unsigned int BulkSOC_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinTransformsType_Transform_ARRAY_SIZE 1 +struct dinTransformsType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct dinTransformType array[dinTransformsType_Transform_ARRAY_SIZE]; + uint16_t arrayLen; + } Transform; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +struct dinServiceType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceTag, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ + struct dinServiceTagType ServiceTag ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ + int FreeService ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +struct dinPMaxScheduleEntryType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinIntervalType TimeInterval ; + unsigned int TimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct dinRelativeTimeIntervalType RelativeTimeInterval ; + unsigned int RelativeTimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMax, urn:iso:15118:2:2010:MsgDataTypes,PMaxType */ + int16_t PMax ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE 5 +struct dinPMaxScheduleType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t PMaxScheduleID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ + struct { + struct dinPMaxScheduleEntryType array[dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } PMaxScheduleEntry; }; /* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ @@ -1096,142 +1006,105 @@ struct dinCertificateInstallationReqType { } DHParams ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinSelectedServiceListType_SelectedService_ARRAY_SIZE 5 -struct dinSelectedServiceListType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":SelectedService, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +struct dinKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ + struct dinDSAKeyValueType DSAKeyValue ; + unsigned int DSAKeyValue_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ + struct dinRSAKeyValueType RSAKeyValue ; + unsigned int RSAKeyValue_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +#define dinRetrievalMethodType_URI_CHARACTERS_SIZE 50 +#define dinRetrievalMethodType_Type_CHARACTERS_SIZE 50 +struct dinRetrievalMethodType { + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { - struct dinSelectedServiceType array[dinSelectedServiceListType_SelectedService_ARRAY_SIZE]; - uint16_t arrayLen; - } SelectedService; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -struct dinCableCheckReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct dinDC_EVStatusType DC_EVStatus ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -struct dinCableCheckResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEProcessing, urn:iso:15118:2:2010:MsgDataTypes,EVSEProcessingType */ - dinEVSEProcessingType EVSEProcessing ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ -#define dinMeterInfoType_MeterID_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,meterIDType is 32 */ -#define dinMeterInfoType_SigMeterReading_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,sigMeterReadingType is 32 */ -struct dinMeterInfoType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterID, urn:iso:15118:2:2010:MsgDataTypes,meterIDType */ - struct { - exi_string_character_t characters[dinMeterInfoType_MeterID_CHARACTERS_SIZE]; + exi_string_character_t characters[dinRetrievalMethodType_URI_CHARACTERS_SIZE]; uint16_t charactersLen; - } MeterID ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterReading, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType MeterReading ; - unsigned int MeterReading_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading, urn:iso:15118:2:2010:MsgDataTypes,sigMeterReadingType */ + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ struct { - uint8_t bytes[dinMeterInfoType_SigMeterReading_BYTES_SIZE]; + exi_string_character_t characters[dinRetrievalMethodType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinTransformsType Transforms ; + unsigned int Transforms_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ +struct dinServiceChargeType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceTag, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ + struct dinServiceTagType ServiceTag ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ + int FreeService ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType, urn:iso:15118:2:2010:MsgDataTypes,EVSESupportedEnergyTransferType */ + dinEVSESupportedEnergyTransferType EnergyTransferType ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +#define dinReferenceType_Id_CHARACTERS_SIZE 50 +#define dinReferenceType_URI_CHARACTERS_SIZE 50 +#define dinReferenceType_Type_CHARACTERS_SIZE 50 +#define dinReferenceType_DigestValue_BYTES_SIZE 350 +struct dinReferenceType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinReferenceType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinReferenceType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinReferenceType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinTransformsType Transforms ; + unsigned int Transforms_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinDigestMethodType DigestMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestValue, http://www.w3.org/2000/09/xmldsig#,DigestValueType */ + struct { + uint8_t bytes[dinReferenceType_DigestValue_BYTES_SIZE]; uint16_t bytesLen; - } SigMeterReading ; - unsigned int SigMeterReading_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterStatus, urn:iso:15118:2:2010:MsgDataTypes,meterStatusType */ - int16_t MeterStatus ; - unsigned int MeterStatus_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":TMeter, http://www.w3.org/2001/XMLSchema,long */ - int64_t TMeter ; - unsigned int TMeter_isUsed:1; + } DigestValue ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ -struct dinCurrentDemandResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ - struct dinDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEPresentVoltage ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEPresentCurrent ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ - int EVSECurrentLimitAchieved ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ - int EVSEVoltageLimitAchieved ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ - int EVSEPowerLimitAchieved ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaximumVoltageLimit ; - unsigned int EVSEMaximumVoltageLimit_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaximumCurrentLimit ; - unsigned int EVSEMaximumCurrentLimit_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVSEMaximumPowerLimit ; - unsigned int EVSEMaximumPowerLimit_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -struct dinEntryType { - /* substitutionGroup */ -#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES - union { -#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ - /* element: "urn:iso:15118:2:2010:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct dinIntervalType TimeInterval ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ - struct dinRelativeTimeIntervalType RelativeTimeInterval ; -#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES - }; -#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ - unsigned int TimeInterval_isUsed:1; - unsigned int RelativeTimeInterval_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -struct dinPowerDeliveryReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":ReadyToChargeState, http://www.w3.org/2001/XMLSchema,boolean */ - int ReadyToChargeState ; - /* element: "urn:iso:15118:2:2010:MsgBody":ChargingProfile, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinChargingProfileType ChargingProfile ; - unsigned int ChargingProfile_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct dinEVPowerDeliveryParameterType EVPowerDeliveryParameter ; - unsigned int EVPowerDeliveryParameter_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ - struct dinDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; - unsigned int DC_EVPowerDeliveryParameter_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -struct dinCostType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":costKind, urn:iso:15118:2:2010:MsgDataTypes,costKindType */ - dincostKindType costKind ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":amount, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t amount ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier, urn:iso:15118:2:2010:MsgDataTypes,unitMultiplierType */ - int8_t amountMultiplier ; - unsigned int amountMultiplier_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -struct dinWeldingDetectionReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct dinDC_EVStatusType DC_EVStatus ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinPaymentOptionsType_PaymentOption_ARRAY_SIZE 5 -struct dinPaymentOptionsType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":PaymentOption, urn:iso:15118:2:2010:MsgDataTypes,paymentOptionType */ +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinParameterSetType_Parameter_ARRAY_SIZE 5 +struct dinParameterSetType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ + int16_t ParameterSetID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Parameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ struct { - dinpaymentOptionType array[dinPaymentOptionsType_PaymentOption_ARRAY_SIZE]; + struct dinParameterType array[dinParameterSetType_Parameter_ARRAY_SIZE]; uint16_t arrayLen; - } PaymentOption; + } Parameter; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinConsumptionCostType_Cost_ARRAY_SIZE 5 +struct dinConsumptionCostType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":startValue, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t startValue ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Cost, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct dinCostType array[dinConsumptionCostType_Cost_ARRAY_SIZE]; + uint16_t arrayLen; + } Cost; }; /* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ @@ -1264,48 +1137,6 @@ struct dinCurrentDemandReqType { struct dinPhysicalValueType EVTargetVoltage ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -struct dinServiceType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceTag, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ - struct dinServiceTagType ServiceTag ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ - int FreeService ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ -struct dinAC_EVChargeParameterType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t DepartureTime ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EAmount, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EAmount ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVMaxVoltage ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVMaxCurrent ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVMinCurrent ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -struct dinServicePaymentSelectionReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption, urn:iso:15118:2:2010:MsgDataTypes,paymentOptionType */ - dinpaymentOptionType SelectedPaymentOption ; - /* element: "urn:iso:15118:2:2010:MsgBody":SelectedServiceList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinSelectedServiceListType SelectedServiceList ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE 5 -struct dinPMaxScheduleType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ - int16_t PMaxScheduleID ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ - struct { - struct dinPMaxScheduleEntryType array[dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE]; - uint16_t arrayLen; - } PMaxScheduleEntry; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ #define dinKeyInfoType_Id_CHARACTERS_SIZE 50 #define dinKeyInfoType_KeyName_CHARACTERS_SIZE 50 @@ -1367,58 +1198,365 @@ struct dinKeyInfoType { } MgmtData; }; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -struct dinContractAuthenticationResType { +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +#define dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +struct dinPaymentDetailsReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinServiceParameterListType_ParameterSet_ARRAY_SIZE 5 +struct dinServiceParameterListType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSet, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct { + struct dinParameterSetType array[dinServiceParameterListType_ParameterSet_ARRAY_SIZE]; + uint16_t arrayLen; + } ParameterSet; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +struct dinWeldingDetectionResType { /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentVoltage ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +#define dinCertificateUpdateReqType_Id_CHARACTERS_SIZE 50 +#define dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +#define dinCertificateUpdateReqType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +struct dinCertificateUpdateReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinCertificateUpdateReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; + /* element: "urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinListOfRootCertificateIDsType ListOfRootCertificateIDs ; + /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ + struct { + uint8_t bytes[dinCertificateUpdateReqType_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinServiceTagListType_Service_ARRAY_SIZE 5 +struct dinServiceTagListType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Service, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ + struct { + struct dinServiceType array[dinServiceTagListType_Service_ARRAY_SIZE]; + uint16_t arrayLen; + } Service; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSignedInfoType_Id_CHARACTERS_SIZE 50 +#define dinSignedInfoType_Reference_ARRAY_SIZE 1 +struct dinSignedInfoType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignedInfoType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinCanonicalizationMethodType CanonicalizationMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSignatureMethodType SignatureMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct dinReferenceType array[dinSignedInfoType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +struct dinPowerDeliveryReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":ReadyToChargeState, http://www.w3.org/2001/XMLSchema,boolean */ + int ReadyToChargeState ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargingProfile, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinChargingProfileType ChargingProfile ; + unsigned int ChargingProfile_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinEVPowerDeliveryParameterType EVPowerDeliveryParameter ; + unsigned int EVPowerDeliveryParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ + struct dinDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; + unsigned int DC_EVPowerDeliveryParameter_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ +struct dinDC_EVChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumCurrentLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumPowerLimit ; + unsigned int EVMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumVoltageLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVEnergyCapacity ; + unsigned int EVEnergyCapacity_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVEnergyRequest ; + unsigned int EVEnergyRequest_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FullSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ + int8_t FullSOC ; + unsigned int FullSOC_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":BulkSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ + int8_t BulkSOC ; + unsigned int BulkSOC_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +#define dinMeterInfoType_MeterID_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,meterIDType is 32 */ +#define dinMeterInfoType_SigMeterReading_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,sigMeterReadingType is 32 */ +struct dinMeterInfoType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterID, urn:iso:15118:2:2010:MsgDataTypes,meterIDType */ + struct { + exi_string_character_t characters[dinMeterInfoType_MeterID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MeterID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterReading, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType MeterReading ; + unsigned int MeterReading_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading, urn:iso:15118:2:2010:MsgDataTypes,sigMeterReadingType */ + struct { + uint8_t bytes[dinMeterInfoType_SigMeterReading_BYTES_SIZE]; + uint16_t bytesLen; + } SigMeterReading ; + unsigned int SigMeterReading_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterStatus, urn:iso:15118:2:2010:MsgDataTypes,meterStatusType */ + int16_t MeterStatus ; + unsigned int MeterStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":TMeter, http://www.w3.org/2001/XMLSchema,long */ + int64_t TMeter ; + unsigned int TMeter_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ +#define dinCertificateInstallationResType_Id_CHARACTERS_SIZE 50 +#define dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE 128 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,privateKeyType is 128 */ +#define dinCertificateInstallationResType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +#define dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +struct dinCertificateInstallationResType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinCertificateInstallationResType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey, urn:iso:15118:2:2010:MsgDataTypes,privateKeyType */ + struct { + uint8_t bytes[dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE]; + uint16_t bytesLen; + } ContractSignatureEncryptedPrivateKey ; + /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ + struct { + uint8_t bytes[dinCertificateInstallationResType_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +struct dinServiceDetailResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceParameterList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinServiceParameterListType ServiceParameterList ; + unsigned int ServiceParameterList_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +struct dinDC_EVSEChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumCurrentLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumPowerLimit ; + unsigned int EVSEMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumVoltageLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMinimumCurrentLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMinimumVoltageLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSECurrentRegulationTolerance ; + unsigned int EVSECurrentRegulationTolerance_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPeakCurrentRipple ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEEnergyToBeDelivered ; + unsigned int EVSEEnergyToBeDelivered_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +struct dinPowerDeliveryResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinEVSEStatusType EVSEStatus ; + unsigned int EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEStatusType AC_EVSEStatus ; + unsigned int AC_EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + unsigned int DC_EVSEStatus_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ +#define dinCertificateUpdateResType_Id_CHARACTERS_SIZE 50 +#define dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE 128 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,privateKeyType is 128 */ +#define dinCertificateUpdateResType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +#define dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +struct dinCertificateUpdateResType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinCertificateUpdateResType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey, urn:iso:15118:2:2010:MsgDataTypes,privateKeyType */ + struct { + uint8_t bytes[dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE]; + uint16_t bytesLen; + } ContractSignatureEncryptedPrivateKey ; + /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ + struct { + uint8_t bytes[dinCertificateUpdateResType_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; + /* element: "urn:iso:15118:2:2010:MsgBody":RetryCounter, http://www.w3.org/2001/XMLSchema,short */ + int16_t RetryCounter ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ +struct dinCurrentDemandResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentVoltage ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentCurrent ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSECurrentLimitAchieved ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSEVoltageLimitAchieved ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSEPowerLimitAchieved ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumVoltageLimit ; + unsigned int EVSEMaximumVoltageLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumCurrentLimit ; + unsigned int EVSEMaximumCurrentLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumPowerLimit ; + unsigned int EVSEMaximumPowerLimit_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct dinCableCheckResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; /* element: "urn:iso:15118:2:2010:MsgBody":EVSEProcessing, urn:iso:15118:2:2010:MsgDataTypes,EVSEProcessingType */ dinEVSEProcessingType EVSEProcessing ; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ -struct dinServiceChargeType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceTag, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ - struct dinServiceTagType ServiceTag ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ - int FreeService ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType, urn:iso:15118:2:2010:MsgDataTypes,EVSESupportedEnergyTransferType */ - dinEVSESupportedEnergyTransferType EnergyTransferType ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -#define dinReferenceType_Id_CHARACTERS_SIZE 50 -#define dinReferenceType_URI_CHARACTERS_SIZE 50 -#define dinReferenceType_Type_CHARACTERS_SIZE 50 -#define dinReferenceType_DigestValue_BYTES_SIZE 350 -struct dinReferenceType { +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinManifestType_Id_CHARACTERS_SIZE 50 +#define dinManifestType_Reference_ARRAY_SIZE 1 +struct dinManifestType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { - exi_string_character_t characters[dinReferenceType_Id_CHARACTERS_SIZE]; + exi_string_character_t characters[dinManifestType_Id_CHARACTERS_SIZE]; uint16_t charactersLen; } Id ; unsigned int Id_isUsed:1; - /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ struct { - exi_string_character_t characters[dinReferenceType_URI_CHARACTERS_SIZE]; - uint16_t charactersLen; - } URI ; - unsigned int URI_isUsed:1; - /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[dinReferenceType_Type_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Type ; - unsigned int Type_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinTransformsType Transforms ; - unsigned int Transforms_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":DigestMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinDigestMethodType DigestMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":DigestValue, http://www.w3.org/2000/09/xmldsig#,DigestValueType */ - struct { - uint8_t bytes[dinReferenceType_DigestValue_BYTES_SIZE]; - uint16_t bytesLen; - } DigestValue ; + struct dinReferenceType array[dinManifestType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ +struct dinAC_EVChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t DepartureTime ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EAmount, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EAmount ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaxVoltage ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaxCurrent ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMinCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +struct dinPreChargeReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVTargetVoltage ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVTargetCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +struct dinPreChargeResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentVoltage ; }; /* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ @@ -1445,172 +1583,6 @@ struct dinChargingStatusResType { struct dinAC_EVSEStatusType AC_EVSEStatus ; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinManifestType_Id_CHARACTERS_SIZE 50 -#define dinManifestType_Reference_ARRAY_SIZE 1 -struct dinManifestType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[dinManifestType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ - struct { - struct dinReferenceType array[dinManifestType_Reference_ARRAY_SIZE]; - uint16_t arrayLen; - } Reference; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -struct dinPreChargeReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct dinDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVTargetVoltage ; - /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType EVTargetCurrent ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ -#define dinParameterType_Name_CHARACTERS_SIZE 50 -#define dinParameterType_stringValue_CHARACTERS_SIZE 50 -struct dinParameterType { - /* attribute: Name {http://www.w3.org/2001/XMLSchema,string} */ - struct { - exi_string_character_t characters[dinParameterType_Name_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Name ; - /* attribute: ValueType {urn:iso:15118:2:2010:MsgDataTypes,valueType} */ - dinvalueType ValueType ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":boolValue, http://www.w3.org/2001/XMLSchema,boolean */ - int boolValue ; - unsigned int boolValue_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":byteValue, http://www.w3.org/2001/XMLSchema,byte */ - int8_t byteValue ; - unsigned int byteValue_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":shortValue, http://www.w3.org/2001/XMLSchema,short */ - int16_t shortValue ; - unsigned int shortValue_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":intValue, http://www.w3.org/2001/XMLSchema,int */ - int32_t intValue ; - unsigned int intValue_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":physicalValue, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct dinPhysicalValueType physicalValue ; - unsigned int physicalValue_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":stringValue, http://www.w3.org/2001/XMLSchema,string */ - struct { - exi_string_character_t characters[dinParameterType_stringValue_CHARACTERS_SIZE]; - uint16_t charactersLen; - } stringValue ; - unsigned int stringValue_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinServiceTagListType_Service_ARRAY_SIZE 5 -struct dinServiceTagListType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Service, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ - struct { - struct dinServiceType array[dinServiceTagListType_Service_ARRAY_SIZE]; - uint16_t arrayLen; - } Service; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -#define dinMeteringReceiptReqType_Id_CHARACTERS_SIZE 50 -#define dinMeteringReceiptReqType_SessionID_BYTES_SIZE 8 /* XML schema facet length for urn:iso:15118:2:2010:MsgDataTypes,sessionIDType is 8 */ -struct dinMeteringReceiptReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ - struct { - exi_string_character_t characters[dinMeteringReceiptReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgBody":SessionID, urn:iso:15118:2:2010:MsgDataTypes,sessionIDType */ - struct { - uint8_t bytes[dinMeteringReceiptReqType_SessionID_BYTES_SIZE]; - uint16_t bytesLen; - } SessionID ; - /* element: "urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ - int16_t SAScheduleTupleID ; - unsigned int SAScheduleTupleID_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ - struct dinMeterInfoType MeterInfo ; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinConsumptionCostType_Cost_ARRAY_SIZE 5 -struct dinConsumptionCostType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":startValue, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t startValue ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Cost, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ - struct { - struct dinCostType array[dinConsumptionCostType_Cost_ARRAY_SIZE]; - uint16_t arrayLen; - } Cost; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -struct dinChargeParameterDiscoveryReqType { - /* element: "urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType, urn:iso:15118:2:2010:MsgDataTypes,EVRequestedEnergyTransferType */ - dinEVRequestedEnergyTransferType EVRequestedEnergyTransferType ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct dinEVChargeParameterType EVChargeParameter ; - unsigned int EVChargeParameter_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ - struct dinAC_EVChargeParameterType AC_EVChargeParameter ; - unsigned int AC_EVChargeParameter_isUsed:1; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ - struct dinDC_EVChargeParameterType DC_EVChargeParameter ; - unsigned int DC_EVChargeParameter_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinParameterSetType_Parameter_ARRAY_SIZE 5 -struct dinParameterSetType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ - int16_t ParameterSetID ; - /* element: "urn:iso:15118:2:2010:MsgDataTypes":Parameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ - struct { - struct dinParameterType array[dinParameterSetType_Parameter_ARRAY_SIZE]; - uint16_t arrayLen; - } Parameter; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -struct dinServiceDiscoveryResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":PaymentOptions, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinPaymentOptionsType PaymentOptions ; - /* element: "urn:iso:15118:2:2010:MsgBody":ChargeService, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ - struct dinServiceChargeType ChargeService ; - /* element: "urn:iso:15118:2:2010:MsgBody":ServiceList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinServiceTagListType ServiceList ; - unsigned int ServiceList_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinSignedInfoType_Id_CHARACTERS_SIZE 50 -#define dinSignedInfoType_Reference_ARRAY_SIZE 1 -struct dinSignedInfoType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[dinSignedInfoType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinCanonicalizationMethodType CanonicalizationMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinSignatureMethodType SignatureMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ - struct { - struct dinReferenceType array[dinSignedInfoType_Reference_ARRAY_SIZE]; - uint16_t arrayLen; - } Reference; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ #define dinSignatureType_Id_CHARACTERS_SIZE 50 #define dinSignatureType_Object_ARRAY_SIZE 1 @@ -1635,14 +1607,17 @@ struct dinSignatureType { } Object; }; -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define dinServiceParameterListType_ParameterSet_ARRAY_SIZE 5 -struct dinServiceParameterListType { - /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSet, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct { - struct dinParameterSetType array[dinServiceParameterListType_ParameterSet_ARRAY_SIZE]; - uint16_t arrayLen; - } ParameterSet; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +struct dinServiceDiscoveryResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":PaymentOptions, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinPaymentOptionsType PaymentOptions ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargeService, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ + struct dinServiceChargeType ChargeService ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinServiceTagListType ServiceList ; + unsigned int ServiceList_isUsed:1; }; /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ @@ -1663,31 +1638,41 @@ struct dinSalesTariffEntryType { } ConsumptionCost; }; -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -struct dinServiceDetailResType { - /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ - dinresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2010:MsgBody":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2010:MsgBody":ServiceParameterList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinServiceParameterListType ServiceParameterList ; - unsigned int ServiceParameterList_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -#define dinMessageHeaderType_SessionID_BYTES_SIZE 8 /* XML schema facet length for urn:iso:15118:2:2010:MsgDataTypes,sessionIDType is 8 */ -struct dinMessageHeaderType { - /* element: "urn:iso:15118:2:2010:MsgHeader":SessionID, urn:iso:15118:2:2010:MsgDataTypes,sessionIDType */ +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +#define dinMeteringReceiptReqType_Id_CHARACTERS_SIZE 50 +#define dinMeteringReceiptReqType_SessionID_BYTES_SIZE 8 /* XML schema facet length for urn:iso:15118:2:2010:MsgDataTypes,sessionIDType is 8 */ +struct dinMeteringReceiptReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ struct { - uint8_t bytes[dinMessageHeaderType_SessionID_BYTES_SIZE]; + exi_string_character_t characters[dinMeteringReceiptReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":SessionID, urn:iso:15118:2:2010:MsgDataTypes,sessionIDType */ + struct { + uint8_t bytes[dinMeteringReceiptReqType_SessionID_BYTES_SIZE]; uint16_t bytesLen; } SessionID ; - /* element: "urn:iso:15118:2:2010:MsgHeader":Notification, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ - struct dinNotificationType Notification ; - unsigned int Notification_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Signature, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct dinSignatureType Signature ; - unsigned int Signature_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t SAScheduleTupleID ; + unsigned int SAScheduleTupleID_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct dinMeterInfoType MeterInfo ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +struct dinChargeParameterDiscoveryReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType, urn:iso:15118:2:2010:MsgDataTypes,EVRequestedEnergyTransferType */ + dinEVRequestedEnergyTransferType EVRequestedEnergyTransferType ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinEVChargeParameterType EVChargeParameter ; + unsigned int EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ + struct dinAC_EVChargeParameterType AC_EVChargeParameter ; + unsigned int AC_EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ + struct dinDC_EVChargeParameterType DC_EVChargeParameter ; + unsigned int DC_EVChargeParameter_isUsed:1; }; /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ @@ -1717,6 +1702,22 @@ struct dinSalesTariffType { } SalesTariffEntry; }; +/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +#define dinMessageHeaderType_SessionID_BYTES_SIZE 8 /* XML schema facet length for urn:iso:15118:2:2010:MsgDataTypes,sessionIDType is 8 */ +struct dinMessageHeaderType { + /* element: "urn:iso:15118:2:2010:MsgHeader":SessionID, urn:iso:15118:2:2010:MsgDataTypes,sessionIDType */ + struct { + uint8_t bytes[dinMessageHeaderType_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + /* element: "urn:iso:15118:2:2010:MsgHeader":Notification, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ + struct dinNotificationType Notification ; + unsigned int Notification_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Signature, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSignatureType Signature ; + unsigned int Signature_isUsed:1; +}; + /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ struct dinSAScheduleTupleType { /* element: "urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ @@ -1890,9 +1891,47 @@ struct dinAnonType_V2G_Message { #define EXIDocument_MgmtData_CHARACTERS_SIZE 50 #define EXIDocument_KeyName_CHARACTERS_SIZE 50 #define EXIDocument_DigestValue_BYTES_SIZE 350 +#define EXIFragment_ServiceScope_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType is 32 */ +#define EXIFragment_Certificate_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ +#define EXIFragment_Exponent_BYTES_SIZE 350 +#define EXIFragment_J_BYTES_SIZE 350 +#define EXIFragment_X509CRL_BYTES_SIZE 350 +#define EXIFragment_PGPKeyPacket_BYTES_SIZE 350 +#define EXIFragment_PgenCounter_BYTES_SIZE 350 +#define EXIFragment_Y_BYTES_SIZE 350 +#define EXIFragment_Seed_BYTES_SIZE 350 +#define EXIFragment_Modulus_BYTES_SIZE 350 +#define EXIFragment_X509IssuerName_CHARACTERS_SIZE 50 +#define EXIFragment_X509SubjectName_CHARACTERS_SIZE 50 +#define EXIFragment_MgmtData_CHARACTERS_SIZE 50 +#define EXIFragment_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceNameType is 32 */ +#define EXIFragment_PGPKeyID_BYTES_SIZE 350 +#define EXIFragment_EVSEID_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evseIDType is 32 */ +#define EXIFragment_X509SKI_BYTES_SIZE 350 +#define EXIFragment_MeterID_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,meterIDType is 32 */ +#define EXIFragment_OEMProvisioningCert_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ +#define EXIFragment_P_BYTES_SIZE 350 +#define EXIFragment_X509Certificate_BYTES_SIZE 350 +#define EXIFragment_SPKISexp_BYTES_SIZE 350 +#define EXIFragment_EVCCID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evccIDType is 8 */ +#define EXIFragment_SessionID_BYTES_SIZE 8 /* XML schema facet length for urn:iso:15118:2:2010:MsgDataTypes,sessionIDType is 8 */ +#define EXIFragment_stringValue_CHARACTERS_SIZE 50 +#define EXIFragment_ContractSignatureEncryptedPrivateKey_BYTES_SIZE 128 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,privateKeyType is 128 */ +#define EXIFragment_G_BYTES_SIZE 350 +#define EXIFragment_SalesTariffDescription_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,tariffDescriptionType is 32 */ +#define EXIFragment_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +#define EXIFragment_KeyName_CHARACTERS_SIZE 50 +#define EXIFragment_DigestValue_BYTES_SIZE 350 +#define EXIFragment_SigMeterReading_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,sigMeterReadingType is 32 */ +#define EXIFragment_FaultMsg_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,faultMsgType is 64 */ +#define EXIFragment_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +#define EXIFragment_RootCertificateID_CHARACTERS_SIZE 40 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,rootCertificateIDType is 40 */ +#define EXIFragment_GenChallenge_CHARACTERS_SIZE 50 +#define EXIFragment_XPath_CHARACTERS_SIZE 50 +#define EXIFragment_Q_BYTES_SIZE 350 -/* Possible root elements of EXI Document */ +/* Global elements of EXI Document */ struct dinEXIDocument { #if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES union { @@ -2075,113 +2114,702 @@ struct dinEXIDocument { int _warning_; }; + + +#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES +/* Possible elements of EXI Fragment */ +struct dinEXIFragment { +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + union { +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + struct dinRSAKeyValueType RSAKeyValue ; + struct dinParameterSetType ParameterSet ; + struct dinPhysicalValueType EVEnergyRequest ; + uint32_t amount ; + uint32_t start ; + struct dinNotificationType Notification ; + struct { + exi_string_character_t characters[EXIFragment_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + struct dinPhysicalValueType EVMaximumVoltageLimit ; + struct { + uint8_t bytes[EXIFragment_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } Certificate ; + int EVCabinConditioning ; + int EVSECurrentLimitAchieved ; + struct dinPhysicalValueType EVMaxCurrent ; + struct dinCertificateInstallationResType CertificateInstallationRes ; + struct dinPhysicalValueType EVMaxVoltage ; + struct { + uint8_t bytes[EXIFragment_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; + struct dinSubCertificatesType SubCertificates ; + dinfaultCodeType FaultCode ; + dinEVRequestedEnergyTransferType EVRequestedEnergyTransferType ; + struct dinPhysicalValueType EVMinCurrent ; + int boolValue ; + struct { + uint8_t bytes[EXIFragment_J_BYTES_SIZE]; + uint16_t bytesLen; + } J ; + struct dinEVSEStatusType EVSEStatus ; + struct dinServicePaymentSelectionReqType ServicePaymentSelectionReq ; + struct dinTransformsType Transforms ; + struct { + uint8_t bytes[EXIFragment_X509CRL_BYTES_SIZE]; + uint16_t bytesLen; + } X509CRL ; + struct dinManifestType Manifest ; + struct dinPhysicalValueType EVSEMinimumVoltageLimit ; + struct dinPhysicalValueType EVSECurrentRegulationTolerance ; + struct dinPhysicalValueType EVMaximumPowerLimit ; + uint16_t ServiceID ; + struct dinAnonType_V2G_Message V2G_Message ; + struct dinParameterType Parameter ; + struct dinPhysicalValueType EVTargetCurrent ; + struct dinDigestMethodType DigestMethod ; + int8_t byteValue ; + struct dinPaymentOptionsType PaymentOptions ; + int ChargingComplete ; + int8_t Multiplier ; + dinisolationLevelType EVSEIsolationStatus ; + struct dinPhysicalValueType EVSEPeakCurrentRipple ; + int ReadyToChargeState ; + struct dinX509IssuerSerialType X509IssuerSerial ; + uint32_t duration ; + uint32_t NotificationMaxDelay ; + struct dinServiceDetailResType ServiceDetailRes ; + dinEVSEProcessingType EVSEProcessing ; + struct { + uint8_t bytes[EXIFragment_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + struct dinServiceDetailReqType ServiceDetailReq ; + struct dinDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; + struct { + uint8_t bytes[EXIFragment_PgenCounter_BYTES_SIZE]; + uint16_t bytesLen; + } PgenCounter ; + struct dinEVChargeParameterType EVChargeParameter ; + struct dinRelativeTimeIntervalType RelativeTimeInterval ; + struct dinSelectedServiceListType SelectedServiceList ; + int64_t X509SerialNumber ; + struct dinSalesTariffEntryType SalesTariffEntry ; + struct dinSAScheduleTupleType SAScheduleTuple ; + struct dinReferenceType Reference ; + struct dinSignedInfoType SignedInfo ; + struct dinCableCheckReqType CableCheckReq ; + struct dinPowerDeliveryReqType PowerDeliveryReq ; + struct dinEVPowerDeliveryParameterType EVPowerDeliveryParameter ; + struct dinMeteringReceiptReqType MeteringReceiptReq ; + struct dinDC_EVChargeParameterType DC_EVChargeParameter ; + struct dinKeyValueType KeyValue ; + struct { + uint8_t bytes[EXIFragment_Y_BYTES_SIZE]; + uint16_t bytesLen; + } Y ; + int16_t ChargingProfileEntryMaxPower ; + int EVRESSConditioning ; + struct dinPhysicalValueType EVSEMaximumVoltageLimit ; + uint8_t EPriceLevel ; + struct dinServiceTagListType ServiceList ; + int16_t SAScheduleTupleID ; + struct dinPMaxScheduleType PMaxSchedule ; + int EVSEPowerLimitAchieved ; + struct dinCertificateUpdateResType CertificateUpdateRes ; + struct dinPhysicalValueType EVSEEnergyToBeDelivered ; + struct dinAC_EVSEStatusType AC_EVSEStatus ; + struct dinServiceTagType ServiceTag ; + struct dinSignatureMethodType SignatureMethod ; + struct dinIntervalType TimeInterval ; + int8_t amountMultiplier ; + struct dinX509DataType X509Data ; + struct dinCertificateChainType ContractSignatureCertChain ; + struct { + uint8_t bytes[EXIFragment_Seed_BYTES_SIZE]; + uint16_t bytesLen; + } Seed ; + struct { + uint8_t bytes[EXIFragment_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + dinserviceCategoryType ServiceCategory ; + int16_t MeterStatus ; + struct dinPhysicalValueType EVMaximumCurrentLimit ; + struct dinKeyInfoType KeyInfo ; + struct dinCertificateInstallationReqType CertificateInstallationReq ; + struct dinChargingProfileType ChargingProfile ; + int8_t BulkSOC ; + struct { + exi_string_character_t characters[EXIFragment_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + int8_t EVRESSSOC ; + struct { + exi_string_character_t characters[EXIFragment_X509SubjectName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509SubjectName ; + struct dinAC_EVSEChargeParameterType AC_EVSEChargeParameter ; + struct { + exi_string_character_t characters[EXIFragment_MgmtData_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MgmtData ; + int16_t Value ; + struct dinChargingStatusResType ChargingStatusRes ; + struct { + exi_string_character_t characters[EXIFragment_ServiceName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceName ; + int FreeService ; + struct dinPhysicalValueType physicalValue ; + struct dinPhysicalValueType EVSEMaxVoltage ; + int32_t intValue ; + struct { + uint8_t bytes[EXIFragment_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + struct dinChargeParameterDiscoveryResType ChargeParameterDiscoveryRes ; + struct dinMeteringReceiptResType MeteringReceiptRes ; + struct { + uint8_t bytes[EXIFragment_EVSEID_BYTES_SIZE]; + uint16_t bytesLen; + } EVSEID ; + dincostKindType costKind ; + struct { + uint8_t bytes[EXIFragment_X509SKI_BYTES_SIZE]; + uint16_t bytesLen; + } X509SKI ; + struct { + exi_string_character_t characters[EXIFragment_MeterID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MeterID ; + struct { + uint8_t bytes[EXIFragment_OEMProvisioningCert_BYTES_SIZE]; + uint16_t bytesLen; + } OEMProvisioningCert ; + struct dinEntryType Entry ; + struct dinSignaturePropertiesType SignatureProperties ; + struct { + uint8_t bytes[EXIFragment_P_BYTES_SIZE]; + uint16_t bytesLen; + } P ; + struct dinPreChargeReqType PreChargeReq ; + struct dinSignatureValueType SignatureValue ; + dinEVSENotificationType EVSENotification ; + int BulkChargingComplete ; + int RCD ; + struct dinServiceParameterListType ServiceParameterList ; + struct dinSelectedServiceType SelectedService ; + dinresponseCodeType ResponseCode ; + struct dinSessionStopResType SessionStopRes ; + struct dinPGPDataType PGPData ; + struct dinPhysicalValueType EVEnergyCapacity ; + uint32_t startValue ; + struct dinServicePaymentSelectionResType ServicePaymentSelectionRes ; + dinEVSESupportedEnergyTransferType EnergyTransferType ; + struct dinListOfRootCertificateIDsType ListOfRootCertificateIDs ; + uint8_t NumEPriceLevels ; + dinDC_EVSEStatusCodeType EVSEStatusCode ; + struct dinSASchedulesType SASchedules ; + struct dinDC_EVStatusType DC_EVStatus ; + struct dinDC_EVSEChargeParameterType DC_EVSEChargeParameter ; + struct dinMeterInfoType MeterInfo ; + struct { + uint8_t bytes[EXIFragment_X509Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } X509Certificate ; + int16_t shortValue ; + struct { + uint8_t bytes[EXIFragment_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } SPKISexp ; + int16_t SalesTariffID ; + struct dinCanonicalizationMethodType CanonicalizationMethod ; + int64_t TMeter ; + struct dinPaymentDetailsResType PaymentDetailsRes ; + struct { + uint8_t bytes[EXIFragment_EVCCID_BYTES_SIZE]; + uint16_t bytesLen; + } EVCCID ; + struct dinPhysicalValueType EVSEMaximumPowerLimit ; + struct dinEVSEChargeParameterType EVSEChargeParameter ; + struct dinBodyType Body ; + int64_t DateTimeNow ; + struct dinSPKIDataType SPKIData ; + struct dinObjectType Object ; + struct dinServiceChargeType ServiceCharge ; + struct { + uint8_t bytes[EXIFragment_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + int8_t FullSOC ; + struct dinSAScheduleListType SAScheduleList ; + struct dinPhysicalValueType EVSEMaximumCurrentLimit ; + struct dinDSAKeyValueType DSAKeyValue ; + struct dinChargeParameterDiscoveryReqType ChargeParameterDiscoveryReq ; + struct dinEVStatusType EVStatus ; + struct { + exi_string_character_t characters[EXIFragment_stringValue_CHARACTERS_SIZE]; + uint16_t charactersLen; + } stringValue ; + struct dinPowerDeliveryResType PowerDeliveryRes ; + struct { + uint8_t bytes[EXIFragment_ContractSignatureEncryptedPrivateKey_BYTES_SIZE]; + uint16_t bytesLen; + } ContractSignatureEncryptedPrivateKey ; + struct dinCertificateUpdateReqType CertificateUpdateReq ; + struct dinSignatureType Signature ; + struct dinContractAuthenticationResType ContractAuthenticationRes ; + struct dinTransformType Transform ; + dinpaymentOptionType PaymentOption ; + struct { + uint8_t bytes[EXIFragment_G_BYTES_SIZE]; + uint16_t bytesLen; + } G ; + int ReceiptRequired ; + dinunitSymbolType Unit ; + struct dinConsumptionCostType ConsumptionCost ; + struct dinPhysicalValueType EVSEMaxCurrent ; + struct { + exi_string_character_t characters[EXIFragment_SalesTariffDescription_CHARACTERS_SIZE]; + uint16_t charactersLen; + } SalesTariffDescription ; + struct { + exi_string_character_t characters[EXIFragment_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; + struct dinAC_EVChargeParameterType AC_EVChargeParameter ; + struct dinPhysicalValueType RemainingTimeToBulkSoC ; + struct dinDC_EVSEStatusType DC_EVSEStatus ; + struct dinCableCheckResType CableCheckRes ; + struct dinPhysicalValueType RemainingTimeToFullSoC ; + struct dinPhysicalValueType EVSEPresentVoltage ; + struct dinSessionSetupReqType SessionSetupReq ; + struct dinPreChargeResType PreChargeRes ; + struct { + exi_string_character_t characters[EXIFragment_KeyName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } KeyName ; + int EVReady ; + struct dinCurrentDemandResType CurrentDemandRes ; + struct dinPMaxScheduleEntryType PMaxScheduleEntry ; + struct dinServiceDiscoveryResType ServiceDiscoveryRes ; + struct dinPaymentDetailsReqType PaymentDetailsReq ; + dinpaymentOptionType SelectedPaymentOption ; + struct { + uint8_t bytes[EXIFragment_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; + int16_t RetryCounter ; + struct dinSalesTariffType SalesTariff ; + struct dinWeldingDetectionReqType WeldingDetectionReq ; + struct { + uint8_t bytes[EXIFragment_SigMeterReading_BYTES_SIZE]; + uint16_t bytesLen; + } SigMeterReading ; + struct { + exi_string_character_t characters[EXIFragment_FaultMsg_CHARACTERS_SIZE]; + uint16_t charactersLen; + } FaultMsg ; + int16_t PMax ; + int PowerSwitchClosed ; + int16_t ParameterSetID ; + struct dinPhysicalValueType EAmount ; + struct dinRetrievalMethodType RetrievalMethod ; + uint32_t ChargingProfileEntryStart ; + struct dinServiceDiscoveryReqType ServiceDiscoveryReq ; + uint32_t DepartureTime ; + struct dinPhysicalValueType EVSEMinimumCurrentLimit ; + struct dinCurrentDemandReqType CurrentDemandReq ; + struct dinServiceChargeType ChargeService ; + struct dinBodyBaseType BodyElement ; + struct dinCostType Cost ; + int64_t HMACOutputLength ; + struct dinPhysicalValueType MeterReading ; + struct { + uint8_t bytes[EXIFragment_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; + struct dinSignaturePropertyType SignatureProperty ; + struct dinServiceType Service ; + int16_t PMaxScheduleID ; + struct dinPhysicalValueType EVSEPresentCurrent ; + int EVSEVoltageLimitAchieved ; + struct dinSessionSetupResType SessionSetupRes ; + struct dinSessionStopType SessionStopReq ; + struct dinContractAuthenticationReqType ContractAuthenticationReq ; + struct dinProfileEntryType ProfileEntry ; + dinDC_EVErrorCodeType EVErrorCode ; + struct { + exi_string_character_t characters[EXIFragment_RootCertificateID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } RootCertificateID ; + struct dinPhysicalValueType EVSEMinCurrent ; + struct dinPhysicalValueType EVTargetVoltage ; + struct dinChargingStatusReqType ChargingStatusReq ; + struct dinMessageHeaderType Header ; + struct { + exi_string_character_t characters[EXIFragment_GenChallenge_CHARACTERS_SIZE]; + uint16_t charactersLen; + } GenChallenge ; + struct { + exi_string_character_t characters[EXIFragment_XPath_CHARACTERS_SIZE]; + uint16_t charactersLen; + } XPath ; + struct { + uint8_t bytes[EXIFragment_Q_BYTES_SIZE]; + uint16_t bytesLen; + } Q ; + struct dinWeldingDetectionResType WeldingDetectionRes ; +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + }; +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + unsigned int RSAKeyValue_isUsed:1; + unsigned int ParameterSet_isUsed:1; + unsigned int EVEnergyRequest_isUsed:1; + unsigned int amount_isUsed:1; + unsigned int start_isUsed:1; + unsigned int Notification_isUsed:1; + unsigned int ServiceScope_isUsed:1; + unsigned int EVMaximumVoltageLimit_isUsed:1; + unsigned int Certificate_isUsed:1; + unsigned int EVCabinConditioning_isUsed:1; + unsigned int EVSECurrentLimitAchieved_isUsed:1; + unsigned int EVMaxCurrent_isUsed:1; + unsigned int CertificateInstallationRes_isUsed:1; + unsigned int EVMaxVoltage_isUsed:1; + unsigned int Exponent_isUsed:1; + unsigned int SubCertificates_isUsed:1; + unsigned int FaultCode_isUsed:1; + unsigned int EVRequestedEnergyTransferType_isUsed:1; + unsigned int EVMinCurrent_isUsed:1; + unsigned int boolValue_isUsed:1; + unsigned int J_isUsed:1; + unsigned int EVSEStatus_isUsed:1; + unsigned int ServicePaymentSelectionReq_isUsed:1; + unsigned int Transforms_isUsed:1; + unsigned int X509CRL_isUsed:1; + unsigned int Manifest_isUsed:1; + unsigned int EVSEMinimumVoltageLimit_isUsed:1; + unsigned int EVSECurrentRegulationTolerance_isUsed:1; + unsigned int EVMaximumPowerLimit_isUsed:1; + unsigned int ServiceID_isUsed:1; + unsigned int V2G_Message_isUsed:1; + unsigned int Parameter_isUsed:1; + unsigned int EVTargetCurrent_isUsed:1; + unsigned int DigestMethod_isUsed:1; + unsigned int byteValue_isUsed:1; + unsigned int PaymentOptions_isUsed:1; + unsigned int ChargingComplete_isUsed:1; + unsigned int Multiplier_isUsed:1; + unsigned int EVSEIsolationStatus_isUsed:1; + unsigned int EVSEPeakCurrentRipple_isUsed:1; + unsigned int ReadyToChargeState_isUsed:1; + unsigned int X509IssuerSerial_isUsed:1; + unsigned int duration_isUsed:1; + unsigned int NotificationMaxDelay_isUsed:1; + unsigned int ServiceDetailRes_isUsed:1; + unsigned int EVSEProcessing_isUsed:1; + unsigned int PGPKeyPacket_isUsed:1; + unsigned int ServiceDetailReq_isUsed:1; + unsigned int DC_EVPowerDeliveryParameter_isUsed:1; + unsigned int PgenCounter_isUsed:1; + unsigned int EVChargeParameter_isUsed:1; + unsigned int RelativeTimeInterval_isUsed:1; + unsigned int SelectedServiceList_isUsed:1; + unsigned int X509SerialNumber_isUsed:1; + unsigned int SalesTariffEntry_isUsed:1; + unsigned int SAScheduleTuple_isUsed:1; + unsigned int Reference_isUsed:1; + unsigned int SignedInfo_isUsed:1; + unsigned int CableCheckReq_isUsed:1; + unsigned int PowerDeliveryReq_isUsed:1; + unsigned int EVPowerDeliveryParameter_isUsed:1; + unsigned int MeteringReceiptReq_isUsed:1; + unsigned int DC_EVChargeParameter_isUsed:1; + unsigned int KeyValue_isUsed:1; + unsigned int Y_isUsed:1; + unsigned int ChargingProfileEntryMaxPower_isUsed:1; + unsigned int EVRESSConditioning_isUsed:1; + unsigned int EVSEMaximumVoltageLimit_isUsed:1; + unsigned int EPriceLevel_isUsed:1; + unsigned int ServiceList_isUsed:1; + unsigned int SAScheduleTupleID_isUsed:1; + unsigned int PMaxSchedule_isUsed:1; + unsigned int EVSEPowerLimitAchieved_isUsed:1; + unsigned int CertificateUpdateRes_isUsed:1; + unsigned int EVSEEnergyToBeDelivered_isUsed:1; + unsigned int AC_EVSEStatus_isUsed:1; + unsigned int ServiceTag_isUsed:1; + unsigned int SignatureMethod_isUsed:1; + unsigned int TimeInterval_isUsed:1; + unsigned int amountMultiplier_isUsed:1; + unsigned int X509Data_isUsed:1; + unsigned int ContractSignatureCertChain_isUsed:1; + unsigned int Seed_isUsed:1; + unsigned int Modulus_isUsed:1; + unsigned int ServiceCategory_isUsed:1; + unsigned int MeterStatus_isUsed:1; + unsigned int EVMaximumCurrentLimit_isUsed:1; + unsigned int KeyInfo_isUsed:1; + unsigned int CertificateInstallationReq_isUsed:1; + unsigned int ChargingProfile_isUsed:1; + unsigned int BulkSOC_isUsed:1; + unsigned int X509IssuerName_isUsed:1; + unsigned int EVRESSSOC_isUsed:1; + unsigned int X509SubjectName_isUsed:1; + unsigned int AC_EVSEChargeParameter_isUsed:1; + unsigned int MgmtData_isUsed:1; + unsigned int Value_isUsed:1; + unsigned int ChargingStatusRes_isUsed:1; + unsigned int ServiceName_isUsed:1; + unsigned int FreeService_isUsed:1; + unsigned int physicalValue_isUsed:1; + unsigned int EVSEMaxVoltage_isUsed:1; + unsigned int intValue_isUsed:1; + unsigned int PGPKeyID_isUsed:1; + unsigned int ChargeParameterDiscoveryRes_isUsed:1; + unsigned int MeteringReceiptRes_isUsed:1; + unsigned int EVSEID_isUsed:1; + unsigned int costKind_isUsed:1; + unsigned int X509SKI_isUsed:1; + unsigned int MeterID_isUsed:1; + unsigned int OEMProvisioningCert_isUsed:1; + unsigned int Entry_isUsed:1; + unsigned int SignatureProperties_isUsed:1; + unsigned int P_isUsed:1; + unsigned int PreChargeReq_isUsed:1; + unsigned int SignatureValue_isUsed:1; + unsigned int EVSENotification_isUsed:1; + unsigned int BulkChargingComplete_isUsed:1; + unsigned int RCD_isUsed:1; + unsigned int ServiceParameterList_isUsed:1; + unsigned int SelectedService_isUsed:1; + unsigned int ResponseCode_isUsed:1; + unsigned int SessionStopRes_isUsed:1; + unsigned int PGPData_isUsed:1; + unsigned int EVEnergyCapacity_isUsed:1; + unsigned int startValue_isUsed:1; + unsigned int ServicePaymentSelectionRes_isUsed:1; + unsigned int EnergyTransferType_isUsed:1; + unsigned int ListOfRootCertificateIDs_isUsed:1; + unsigned int NumEPriceLevels_isUsed:1; + unsigned int EVSEStatusCode_isUsed:1; + unsigned int SASchedules_isUsed:1; + unsigned int DC_EVStatus_isUsed:1; + unsigned int DC_EVSEChargeParameter_isUsed:1; + unsigned int MeterInfo_isUsed:1; + unsigned int X509Certificate_isUsed:1; + unsigned int shortValue_isUsed:1; + unsigned int SPKISexp_isUsed:1; + unsigned int SalesTariffID_isUsed:1; + unsigned int CanonicalizationMethod_isUsed:1; + unsigned int TMeter_isUsed:1; + unsigned int PaymentDetailsRes_isUsed:1; + unsigned int EVCCID_isUsed:1; + unsigned int EVSEMaximumPowerLimit_isUsed:1; + unsigned int EVSEChargeParameter_isUsed:1; + unsigned int Body_isUsed:1; + unsigned int DateTimeNow_isUsed:1; + unsigned int SPKIData_isUsed:1; + unsigned int Object_isUsed:1; + unsigned int ServiceCharge_isUsed:1; + unsigned int SessionID_isUsed:1; + unsigned int FullSOC_isUsed:1; + unsigned int SAScheduleList_isUsed:1; + unsigned int EVSEMaximumCurrentLimit_isUsed:1; + unsigned int DSAKeyValue_isUsed:1; + unsigned int ChargeParameterDiscoveryReq_isUsed:1; + unsigned int EVStatus_isUsed:1; + unsigned int stringValue_isUsed:1; + unsigned int PowerDeliveryRes_isUsed:1; + unsigned int ContractSignatureEncryptedPrivateKey_isUsed:1; + unsigned int CertificateUpdateReq_isUsed:1; + unsigned int Signature_isUsed:1; + unsigned int ContractAuthenticationRes_isUsed:1; + unsigned int Transform_isUsed:1; + unsigned int PaymentOption_isUsed:1; + unsigned int G_isUsed:1; + unsigned int ReceiptRequired_isUsed:1; + unsigned int Unit_isUsed:1; + unsigned int ConsumptionCost_isUsed:1; + unsigned int EVSEMaxCurrent_isUsed:1; + unsigned int SalesTariffDescription_isUsed:1; + unsigned int ContractID_isUsed:1; + unsigned int AC_EVChargeParameter_isUsed:1; + unsigned int RemainingTimeToBulkSoC_isUsed:1; + unsigned int DC_EVSEStatus_isUsed:1; + unsigned int CableCheckRes_isUsed:1; + unsigned int RemainingTimeToFullSoC_isUsed:1; + unsigned int EVSEPresentVoltage_isUsed:1; + unsigned int SessionSetupReq_isUsed:1; + unsigned int PreChargeRes_isUsed:1; + unsigned int KeyName_isUsed:1; + unsigned int EVReady_isUsed:1; + unsigned int CurrentDemandRes_isUsed:1; + unsigned int PMaxScheduleEntry_isUsed:1; + unsigned int ServiceDiscoveryRes_isUsed:1; + unsigned int PaymentDetailsReq_isUsed:1; + unsigned int SelectedPaymentOption_isUsed:1; + unsigned int DigestValue_isUsed:1; + unsigned int RetryCounter_isUsed:1; + unsigned int SalesTariff_isUsed:1; + unsigned int WeldingDetectionReq_isUsed:1; + unsigned int SigMeterReading_isUsed:1; + unsigned int FaultMsg_isUsed:1; + unsigned int PMax_isUsed:1; + unsigned int PowerSwitchClosed_isUsed:1; + unsigned int ParameterSetID_isUsed:1; + unsigned int EAmount_isUsed:1; + unsigned int RetrievalMethod_isUsed:1; + unsigned int ChargingProfileEntryStart_isUsed:1; + unsigned int ServiceDiscoveryReq_isUsed:1; + unsigned int DepartureTime_isUsed:1; + unsigned int EVSEMinimumCurrentLimit_isUsed:1; + unsigned int CurrentDemandReq_isUsed:1; + unsigned int ChargeService_isUsed:1; + unsigned int BodyElement_isUsed:1; + unsigned int Cost_isUsed:1; + unsigned int HMACOutputLength_isUsed:1; + unsigned int MeterReading_isUsed:1; + unsigned int DHParams_isUsed:1; + unsigned int SignatureProperty_isUsed:1; + unsigned int Service_isUsed:1; + unsigned int PMaxScheduleID_isUsed:1; + unsigned int EVSEPresentCurrent_isUsed:1; + unsigned int EVSEVoltageLimitAchieved_isUsed:1; + unsigned int SessionSetupRes_isUsed:1; + unsigned int SessionStopReq_isUsed:1; + unsigned int ContractAuthenticationReq_isUsed:1; + unsigned int ProfileEntry_isUsed:1; + unsigned int EVErrorCode_isUsed:1; + unsigned int RootCertificateID_isUsed:1; + unsigned int EVSEMinCurrent_isUsed:1; + unsigned int EVTargetVoltage_isUsed:1; + unsigned int ChargingStatusReq_isUsed:1; + unsigned int Header_isUsed:1; + unsigned int GenChallenge_isUsed:1; + unsigned int XPath_isUsed:1; + unsigned int Q_isUsed:1; + unsigned int WeldingDetectionRes_isUsed:1; + + + int _warning_; +}; +#endif /* DEPLOY_DIN_CODEC_FRAGMENT */ /* Initialization methods for structs */ void init_dinEXIDocument(struct dinEXIDocument* exiDoc); -void init_dinPreChargeResType(struct dinPreChargeResType* dinPreChargeResType); -void init_dinMessageHeaderType(struct dinMessageHeaderType* dinMessageHeaderType); -void init_dinServiceDetailReqType(struct dinServiceDetailReqType* dinServiceDetailReqType); -void init_dinEVSEChargeParameterType(struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); -void init_dinRetrievalMethodType(struct dinRetrievalMethodType* dinRetrievalMethodType); -void init_dinSessionSetupResType(struct dinSessionSetupResType* dinSessionSetupResType); -void init_dinRSAKeyValueType(struct dinRSAKeyValueType* dinRSAKeyValueType); -void init_dinCertificateInstallationResType(struct dinCertificateInstallationResType* dinCertificateInstallationResType); -void init_dinDC_EVChargeParameterType(struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); -void init_dinSPKIDataType(struct dinSPKIDataType* dinSPKIDataType); -void init_dinChargeParameterDiscoveryReqType(struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); -void init_dinBodyBaseType(struct dinBodyBaseType* dinBodyBaseType); -void init_dinProfileEntryType(struct dinProfileEntryType* dinProfileEntryType); -void init_dinCertificateInstallationReqType(struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); -void init_dinSignatureMethodType(struct dinSignatureMethodType* dinSignatureMethodType); -void init_dinIntervalType(struct dinIntervalType* dinIntervalType); -void init_dinSelectedServiceListType(struct dinSelectedServiceListType* dinSelectedServiceListType); -void init_dinCableCheckReqType(struct dinCableCheckReqType* dinCableCheckReqType); -void init_dinServicePaymentSelectionResType(struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); -void init_dinChargeParameterDiscoveryResType(struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); -void init_dinX509IssuerSerialType(struct dinX509IssuerSerialType* dinX509IssuerSerialType); -void init_dinCableCheckResType(struct dinCableCheckResType* dinCableCheckResType); -void init_dinMeterInfoType(struct dinMeterInfoType* dinMeterInfoType); +#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES +void init_dinEXIFragment(struct dinEXIFragment* exiFrag); +#endif /* DEPLOY_DIN_CODEC_FRAGMENT */ void init_dinCurrentDemandResType(struct dinCurrentDemandResType* dinCurrentDemandResType); -void init_dinParameterSetType(struct dinParameterSetType* dinParameterSetType); -void init_dinSubCertificatesType(struct dinSubCertificatesType* dinSubCertificatesType); -void init_dinEVSEStatusType(struct dinEVSEStatusType* dinEVSEStatusType); +void init_dinCanonicalizationMethodType(struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); +void init_dinServiceDetailReqType(struct dinServiceDetailReqType* dinServiceDetailReqType); void init_dinAC_EVSEStatusType(struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); -void init_dinEntryType(struct dinEntryType* dinEntryType); -void init_dinPowerDeliveryReqType(struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); -void init_dinCostType(struct dinCostType* dinCostType); -void init_dinWeldingDetectionReqType(struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); -void init_dinServiceDiscoveryResType(struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); -void init_dinPaymentOptionsType(struct dinPaymentOptionsType* dinPaymentOptionsType); +void init_dinSPKIDataType(struct dinSPKIDataType* dinSPKIDataType); +void init_dinSessionSetupResType(struct dinSessionSetupResType* dinSessionSetupResType); void init_dinPGPDataType(struct dinPGPDataType* dinPGPDataType); -void init_dinChargingProfileType(struct dinChargingProfileType* dinChargingProfileType); -void init_dinCurrentDemandReqType(struct dinCurrentDemandReqType* dinCurrentDemandReqType); -void init_dinSignedInfoType(struct dinSignedInfoType* dinSignedInfoType); +void init_dinCableCheckResType(struct dinCableCheckResType* dinCableCheckResType); +void init_dinChargeParameterDiscoveryResType(struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); +void init_dinManifestType(struct dinManifestType* dinManifestType); +void init_dinAC_EVChargeParameterType(struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); +void init_dinBodyBaseType(struct dinBodyBaseType* dinBodyBaseType); +void init_dinDC_EVPowerDeliveryParameterType(struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); +void init_dinCableCheckReqType(struct dinCableCheckReqType* dinCableCheckReqType); +void init_dinDigestMethodType(struct dinDigestMethodType* dinDigestMethodType); +void init_dinSalesTariffType(struct dinSalesTariffType* dinSalesTariffType); +void init_dinServicePaymentSelectionResType(struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); +void init_dinPreChargeReqType(struct dinPreChargeReqType* dinPreChargeReqType); +void init_dinSAScheduleListType(struct dinSAScheduleListType* dinSAScheduleListType); +void init_dinCertificateChainType(struct dinCertificateChainType* dinCertificateChainType); +void init_dinSignaturePropertiesType(struct dinSignaturePropertiesType* dinSignaturePropertiesType); +void init_dinMessageHeaderType(struct dinMessageHeaderType* dinMessageHeaderType); +void init_dinPreChargeResType(struct dinPreChargeResType* dinPreChargeResType); +void init_dinMeteringReceiptResType(struct dinMeteringReceiptResType* dinMeteringReceiptResType); +void init_dinNotificationType(struct dinNotificationType* dinNotificationType); +void init_dinContractAuthenticationReqType(struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); +void init_dinPhysicalValueType(struct dinPhysicalValueType* dinPhysicalValueType); +void init_dinChargingStatusResType(struct dinChargingStatusResType* dinChargingStatusResType); +void init_dinDC_EVSEStatusType(struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); +void init_dinProfileEntryType(struct dinProfileEntryType* dinProfileEntryType); +void init_dinAC_EVSEChargeParameterType(struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); +void init_dinServiceDiscoveryResType(struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); +void init_dinSignatureType(struct dinSignatureType* dinSignatureType); +void init_dinPaymentOptionsType(struct dinPaymentOptionsType* dinPaymentOptionsType); +void init_dinParameterType(struct dinParameterType* dinParameterType); +void init_dinSignaturePropertyType(struct dinSignaturePropertyType* dinSignaturePropertyType); +void init_dinEVPowerDeliveryParameterType(struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); +void init_dinWeldingDetectionReqType(struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); +void init_dinTransformsType(struct dinTransformsType* dinTransformsType); void init_dinServiceType(struct dinServiceType* dinServiceType); void init_dinBodyType(struct dinBodyType* dinBodyType); -void init_dinAC_EVChargeParameterType(struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); -void init_dinSAScheduleTupleType(struct dinSAScheduleTupleType* dinSAScheduleTupleType); -void init_dinSAScheduleListType(struct dinSAScheduleListType* dinSAScheduleListType); -void init_dinServicePaymentSelectionReqType(struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); -void init_dinPMaxScheduleType(struct dinPMaxScheduleType* dinPMaxScheduleType); -void init_dinListOfRootCertificateIDsType(struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); -void init_dinCanonicalizationMethodType(struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); -void init_dinTransformType(struct dinTransformType* dinTransformType); -void init_dinKeyInfoType(struct dinKeyInfoType* dinKeyInfoType); -void init_dinContractAuthenticationResType(struct dinContractAuthenticationResType* dinContractAuthenticationResType); -void init_dinServiceChargeType(struct dinServiceChargeType* dinServiceChargeType); -void init_dinServiceParameterListType(struct dinServiceParameterListType* dinServiceParameterListType); -void init_dinSignatureType(struct dinSignatureType* dinSignatureType); -void init_dinMeteringReceiptResType(struct dinMeteringReceiptResType* dinMeteringReceiptResType); -void init_dinX509DataType(struct dinX509DataType* dinX509DataType); -void init_dinReferenceType(struct dinReferenceType* dinReferenceType); -void init_dinPhysicalValueType(struct dinPhysicalValueType* dinPhysicalValueType); -void init_dinRelativeTimeIntervalType(struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); -void init_dinSalesTariffType(struct dinSalesTariffType* dinSalesTariffType); -void init_dinSignatureValueType(struct dinSignatureValueType* dinSignatureValueType); -void init_dinEVStatusType(struct dinEVStatusType* dinEVStatusType); -void init_dinChargingStatusResType(struct dinChargingStatusResType* dinChargingStatusResType); -void init_dinManifestType(struct dinManifestType* dinManifestType); -void init_dinSASchedulesType(struct dinSASchedulesType* dinSASchedulesType); -void init_dinPMaxScheduleEntryType(struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); -void init_dinDC_EVSEStatusType(struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); -void init_dinPreChargeReqType(struct dinPreChargeReqType* dinPreChargeReqType); -void init_dinTransformsType(struct dinTransformsType* dinTransformsType); -void init_dinParameterType(struct dinParameterType* dinParameterType); -void init_dinPaymentDetailsResType(struct dinPaymentDetailsResType* dinPaymentDetailsResType); -void init_dinPowerDeliveryResType(struct dinPowerDeliveryResType* dinPowerDeliveryResType); -void init_dinCertificateChainType(struct dinCertificateChainType* dinCertificateChainType); void init_dinDC_EVStatusType(struct dinDC_EVStatusType* dinDC_EVStatusType); +void init_dinPMaxScheduleEntryType(struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); +void init_dinPMaxScheduleType(struct dinPMaxScheduleType* dinPMaxScheduleType); void init_dinSelectedServiceType(struct dinSelectedServiceType* dinSelectedServiceType); -void init_dinServiceTagType(struct dinServiceTagType* dinServiceTagType); -void init_dinContractAuthenticationReqType(struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); -void init_dinDC_EVPowerDeliveryParameterType(struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); -void init_dinServiceDiscoveryReqType(struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); -void init_dinSessionStopType(struct dinSessionStopType* dinSessionStopType); -void init_dinServiceTagListType(struct dinServiceTagListType* dinServiceTagListType); -void init_dinWeldingDetectionResType(struct dinWeldingDetectionResType* dinWeldingDetectionResType); -void init_dinAnonType_V2G_Message(struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); -void init_dinDC_EVSEChargeParameterType(struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); -void init_dinSalesTariffEntryType(struct dinSalesTariffEntryType* dinSalesTariffEntryType); -void init_dinEVChargeParameterType(struct dinEVChargeParameterType* dinEVChargeParameterType); -void init_dinPaymentDetailsReqType(struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); -void init_dinSessionSetupReqType(struct dinSessionSetupReqType* dinSessionSetupReqType); -void init_dinChargingStatusReqType(struct dinChargingStatusReqType* dinChargingStatusReqType); -void init_dinSignaturePropertyType(struct dinSignaturePropertyType* dinSignaturePropertyType); -void init_dinCertificateUpdateResType(struct dinCertificateUpdateResType* dinCertificateUpdateResType); -void init_dinServiceDetailResType(struct dinServiceDetailResType* dinServiceDetailResType); -void init_dinDSAKeyValueType(struct dinDSAKeyValueType* dinDSAKeyValueType); -void init_dinAC_EVSEChargeParameterType(struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); -void init_dinObjectType(struct dinObjectType* dinObjectType); +void init_dinIntervalType(struct dinIntervalType* dinIntervalType); +void init_dinCertificateInstallationReqType(struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); +void init_dinTransformType(struct dinTransformType* dinTransformType); void init_dinKeyValueType(struct dinKeyValueType* dinKeyValueType); -void init_dinEVPowerDeliveryParameterType(struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); -void init_dinDigestMethodType(struct dinDigestMethodType* dinDigestMethodType); -void init_dinCertificateUpdateReqType(struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); -void init_dinMeteringReceiptReqType(struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); -void init_dinConsumptionCostType(struct dinConsumptionCostType* dinConsumptionCostType); +void init_dinRetrievalMethodType(struct dinRetrievalMethodType* dinRetrievalMethodType); +void init_dinEVChargeParameterType(struct dinEVChargeParameterType* dinEVChargeParameterType); +void init_dinServiceChargeType(struct dinServiceChargeType* dinServiceChargeType); +void init_dinParameterSetType(struct dinParameterSetType* dinParameterSetType); +void init_dinReferenceType(struct dinReferenceType* dinReferenceType); void init_dinSessionStopResType(struct dinSessionStopResType* dinSessionStopResType); -void init_dinSignaturePropertiesType(struct dinSignaturePropertiesType* dinSignaturePropertiesType); -void init_dinNotificationType(struct dinNotificationType* dinNotificationType); +void init_dinObjectType(struct dinObjectType* dinObjectType); +void init_dinSignatureValueType(struct dinSignatureValueType* dinSignatureValueType); +void init_dinSelectedServiceListType(struct dinSelectedServiceListType* dinSelectedServiceListType); +void init_dinSalesTariffEntryType(struct dinSalesTariffEntryType* dinSalesTariffEntryType); +void init_dinConsumptionCostType(struct dinConsumptionCostType* dinConsumptionCostType); +void init_dinRSAKeyValueType(struct dinRSAKeyValueType* dinRSAKeyValueType); +void init_dinMeteringReceiptReqType(struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); +void init_dinSAScheduleTupleType(struct dinSAScheduleTupleType* dinSAScheduleTupleType); +void init_dinRelativeTimeIntervalType(struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); +void init_dinChargingProfileType(struct dinChargingProfileType* dinChargingProfileType); +void init_dinCurrentDemandReqType(struct dinCurrentDemandReqType* dinCurrentDemandReqType); +void init_dinKeyInfoType(struct dinKeyInfoType* dinKeyInfoType); +void init_dinServicePaymentSelectionReqType(struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); +void init_dinContractAuthenticationResType(struct dinContractAuthenticationResType* dinContractAuthenticationResType); +void init_dinChargingStatusReqType(struct dinChargingStatusReqType* dinChargingStatusReqType); +void init_dinPaymentDetailsResType(struct dinPaymentDetailsResType* dinPaymentDetailsResType); +void init_dinSASchedulesType(struct dinSASchedulesType* dinSASchedulesType); +void init_dinPaymentDetailsReqType(struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); +void init_dinServiceTagType(struct dinServiceTagType* dinServiceTagType); +void init_dinChargeParameterDiscoveryReqType(struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); +void init_dinServiceParameterListType(struct dinServiceParameterListType* dinServiceParameterListType); +void init_dinEVSEStatusType(struct dinEVSEStatusType* dinEVSEStatusType); +void init_dinServiceDiscoveryReqType(struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +void init_dinWeldingDetectionResType(struct dinWeldingDetectionResType* dinWeldingDetectionResType); +void init_dinCertificateUpdateReqType(struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); +void init_dinServiceTagListType(struct dinServiceTagListType* dinServiceTagListType); +void init_dinSignedInfoType(struct dinSignedInfoType* dinSignedInfoType); +void init_dinPowerDeliveryReqType(struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); +void init_dinCostType(struct dinCostType* dinCostType); +void init_dinDC_EVChargeParameterType(struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); +void init_dinSubCertificatesType(struct dinSubCertificatesType* dinSubCertificatesType); +void init_dinSessionSetupReqType(struct dinSessionSetupReqType* dinSessionSetupReqType); +void init_dinAnonType_V2G_Message(struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); +void init_dinMeterInfoType(struct dinMeterInfoType* dinMeterInfoType); +void init_dinCertificateInstallationResType(struct dinCertificateInstallationResType* dinCertificateInstallationResType); +void init_dinServiceDetailResType(struct dinServiceDetailResType* dinServiceDetailResType); +void init_dinX509IssuerSerialType(struct dinX509IssuerSerialType* dinX509IssuerSerialType); +void init_dinDC_EVSEChargeParameterType(struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +void init_dinEVStatusType(struct dinEVStatusType* dinEVStatusType); +void init_dinX509DataType(struct dinX509DataType* dinX509DataType); +void init_dinPowerDeliveryResType(struct dinPowerDeliveryResType* dinPowerDeliveryResType); +void init_dinDSAKeyValueType(struct dinDSAKeyValueType* dinDSAKeyValueType); +void init_dinCertificateUpdateResType(struct dinCertificateUpdateResType* dinCertificateUpdateResType); +void init_dinSessionStopType(struct dinSessionStopType* dinSessionStopType); +void init_dinEVSEChargeParameterType(struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); +void init_dinEntryType(struct dinEntryType* dinEntryType); +void init_dinListOfRootCertificateIDsType(struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); +void init_dinSignatureMethodType(struct dinSignatureMethodType* dinSignatureMethodType); #endif /* DEPLOY_DIN_CODEC */ diff --git a/src/din/dinEXIDatatypesDecoder.c b/src/din/dinEXIDatatypesDecoder.c index ca1e910..4cca175 100644 --- a/src/din/dinEXIDatatypesDecoder.c +++ b/src/din/dinEXIDatatypesDecoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -50,109 +50,109 @@ static uint32_t uint32; /* Forward Declarations */ -static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType); -static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); -static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType); -static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); -static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); -static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); -static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); -static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); -static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); -static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); -static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); -static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); -static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); -static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); -static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); -static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType); -static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); -static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); -static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); -static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); -static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); -static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); -static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType); -static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType); -static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType); -static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType); +static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); +static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType); static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); -static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); -static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); -static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); -static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); -static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); -static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); +static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); +static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType); -static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); -static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); -static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); +static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); +static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); +static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); +static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); +static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); +static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); +static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); +static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); +static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); +static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); +static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); +static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); +static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); +static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); +static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); +static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType); +static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); +static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); +static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); +static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); +static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); +static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); +static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); +static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); +static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); +static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); +static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); +static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); +static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); +static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); +static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); +static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType); static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType); -static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); -static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); -static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); -static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); -static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); -static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); -static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); -static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); -static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); -static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); -static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); -static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); -static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); -static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); -static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); -static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); -static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); -static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); -static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); -static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); -static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); -static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); -static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); -static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); -static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); -static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); -static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); -static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); -static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); -static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); -static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); -static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType); +static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); +static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType); -static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); -static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); -static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); -static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); -static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); -static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); -static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); -static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); -static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); -static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); -static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); -static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); -static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); -static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); -static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); -static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); -static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); -static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); -static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); -static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); +static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType); +static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); +static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType); -static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); -static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); -static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); -static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); -static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); +static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); +static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); +static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); +static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType); +static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType); -static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); -static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); +static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); +static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); +static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); +static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); +static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); +static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); +static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); +static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); +static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); +static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); +static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); +static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); +static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); +static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); +static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); +static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); +static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); +static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); +static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); +static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); +static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); +static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType); +static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); +static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); +static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); +static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); +static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); +static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); +static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); +static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType); +static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); +static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); +static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); +static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); +static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); +static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); +static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); +static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); +static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); +static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); +static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); +static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); +static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); +static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); +static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); +static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); /* Deviant data decoding (skip functions) */ static int decodeDeviationsCH(bitstream_t* stream) { @@ -170,12 +170,12 @@ static int decodeDeviationsCH(bitstream_t* stream) { } - /* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { + /* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { int grammarID = 0; int done = 0; - init_dinPreChargeResType(dinPreChargeResType); + init_dinCurrentDemandResType(dinCurrentDemandResType); while(!done) { switch(grammarID) { @@ -190,7 +190,7 @@ static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinPreChargeResType->ResponseCode = (dinresponseCodeType) uint32; + dinCurrentDemandResType->ResponseCode = (dinresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -218,7 +218,7 @@ static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus); + errn = decode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus); grammarID = 2; break; default: @@ -233,7 +233,7 @@ static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage); + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage); grammarID = 3; break; default: @@ -243,13 +243,199 @@ static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe } break; case 3: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent); + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 4: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSECurrentLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEVoltageLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 6; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 6: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEPowerLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 7; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 7: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit); + dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; + grammarID = 8; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); + dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 9; + break; + case 2: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 10; + break; + case 3: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 8: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); + dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 9; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 10; + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 9: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -268,46 +454,35 @@ static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { - int grammarID = 5; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { + int grammarID = 12; int done = 0; - init_dinMessageHeaderType(dinMessageHeaderType); + init_dinCanonicalizationMethodType(dinCanonicalizationMethodType); while(!done) { switch(grammarID) { - case 5: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ + case 12: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMessageHeaderType->SessionID.bytesLen); - if (errn == 0) { - errn = (dinMessageHeaderType->SessionID.bytesLen) <= dinMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMessageHeaderType->SessionID.bytesLen, dinMessageHeaderType->SessionID.bytes); - } + 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); } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 6; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } + grammarID = 13; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -315,24 +490,23 @@ static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHea } } break; - case 6: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + case 13: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinNotificationType(stream, &dinMessageHeaderType->Notification); - dinMessageHeaderType->Notification_isUsed = 1u; - grammarID = 7; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; break; case 1: - errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); - dinMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; + done = 1; + grammarID = 11; break; case 2: - done = 1; - grammarID = 4; + errn = decodeDeviationsCH(stream); + grammarID = 14; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -340,34 +514,22 @@ static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHea } } break; - case 7: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); - dinMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + case 2: + grammarID = 14; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -388,14 +550,14 @@ static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHea /* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) { - int grammarID = 8; + int grammarID = 15; int done = 0; init_dinServiceDetailReqType(dinServiceDetailReqType); while(!done) { switch(grammarID) { - case 8: + case 15: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -415,7 +577,7 @@ static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinService /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -427,196 +589,15 @@ static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinService } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { - int grammarID = 9; - int done = 0; - - init_dinEVSEChargeParameterType(dinEVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { - int grammarID = 10; - int done = 0; - - init_dinRetrievalMethodType(dinRetrievalMethodType); - - while(!done) { - switch(grammarID) { - case 10: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinRetrievalMethodType->Type_isUsed = 1u; grammarID = 11; 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinRetrievalMethodType->URI_isUsed = 1u; - grammarID = 12; - break; - case 2: - errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); - dinRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 11: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinRetrievalMethodType->URI_isUsed = 1u; - grammarID = 12; - break; - case 1: - errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); - dinRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 12: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); - dinRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -634,182 +615,33 @@ static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrieva return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { - int grammarID = 13; - int done = 0; - - init_dinSessionSetupResType(dinSessionSetupResType); - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinSessionSetupResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 14; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 14: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSessionSetupResType->EVSEID.bytesLen); - if (errn == 0) { - errn = (dinSessionSetupResType->EVSEID.bytesLen) <= dinSessionSetupResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSessionSetupResType->EVSEID.bytesLen, dinSessionSetupResType->EVSEID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 15: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinSessionSetupResType->DateTimeNow); - dinSessionSetupResType->DateTimeNow_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { int grammarID = 16; int done = 0; - init_dinRSAKeyValueType(dinRSAKeyValueType); + init_dinAC_EVSEStatusType(dinAC_EVSEStatusType); while(!done) { switch(grammarID) { case 16: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Modulus.bytesLen); - if (errn == 0) { - errn = (dinRSAKeyValueType->Modulus.bytesLen) <= dinRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinRSAKeyValueType->Modulus.bytesLen, dinRSAKeyValueType->Modulus.bytes); - } + errn = decodeBoolean(stream, &dinAC_EVSEStatusType->PowerSwitchClosed); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 17; @@ -825,32 +657,26 @@ static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueT } break; case 17: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Exponent.bytesLen); - if (errn == 0) { - errn = (dinRSAKeyValueType->Exponent.bytesLen) <= dinRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinRSAKeyValueType->Exponent.bytesLen, dinRSAKeyValueType->Exponent.bytes); - } + errn = decodeBoolean(stream, &dinAC_EVSEStatusType->RCD); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 18; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -862,61 +688,31 @@ static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueT } } break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ -static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { - int grammarID = 18; - int done = 0; - - init_dinCertificateInstallationResType(dinCertificateInstallationResType); - - while(!done) { - switch(grammarID) { case 18: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { 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); + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinAC_EVSEStatusType->NotificationMaxDelay); } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 19; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - grammarID = 19; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -925,7 +721,7 @@ static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct } break; case 19: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -934,18 +730,18 @@ static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCertificateInstallationResType->ResponseCode = (dinresponseCodeType) uint32; + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinAC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 20; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -957,485 +753,14 @@ static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct } } break; - case 20: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain); - grammarID = 21; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 21: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 22; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 22: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->DHParams.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationResType->DHParams.bytesLen) <= dinCertificateInstallationResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationResType->DHParams.bytesLen, dinCertificateInstallationResType->DHParams.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 23; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 23: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { - int grammarID = 24; - int done = 0; - - init_dinDC_EVChargeParameterType(dinDC_EVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 24: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus); - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 25: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit); - grammarID = 26; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 26: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit); - dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 27; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 28; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 27: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 28; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 28: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity); - dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; - grammarID = 29; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); - dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 30; - break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 31; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 29: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); - dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 30; - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 31; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 30: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 31; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 31: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1456,14 +781,14 @@ static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_ /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) { - int grammarID = 32; + int grammarID = 20; int done = 0; init_dinSPKIDataType(dinSPKIDataType); while(!done) { switch(grammarID) { - case 32: + case 20: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -1494,7 +819,7 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 33; + grammarID = 21; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -1506,7 +831,7 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d } } break; - case 33: + case 21: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1537,7 +862,7 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 33; + grammarID = 21; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -1546,11 +871,11 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 34; + grammarID = 22; break; case 2: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1558,7 +883,7 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d } } break; - case 34: + case 22: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1589,7 +914,7 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 33; + grammarID = 21; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -1597,7 +922,7 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1616,733 +941,16 @@ static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { - int grammarID = 35; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { + int grammarID = 23; int done = 0; - init_dinChargeParameterDiscoveryReqType(dinChargeParameterDiscoveryReqType); + init_dinSessionSetupResType(dinSessionSetupResType); while(!done) { switch(grammarID) { - case 35: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType = (dinEVRequestedEnergyTransferType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 36; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 36: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter); - dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter); - dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter); - dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { - int grammarID = 9; - int done = 0; - - init_dinBodyBaseType(dinBodyBaseType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ -static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { - int grammarID = 37; - int done = 0; - - init_dinProfileEntryType(dinProfileEntryType); - - while(!done) { - switch(grammarID) { - case 37: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinProfileEntryType->ChargingProfileEntryStart); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 38; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 38: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinProfileEntryType->ChargingProfileEntryMaxPower); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { - int grammarID = 39; - int done = 0; - - init_dinCertificateInstallationReqType(dinCertificateInstallationReqType); - - while(!done) { - switch(grammarID) { - case 39: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinCertificateInstallationReqType->Id_isUsed = 1u; - grammarID = 40; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 41; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 40: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 41; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs); - grammarID = 42; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->DHParams.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationReqType->DHParams.bytesLen) <= dinCertificateInstallationReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytesLen, dinCertificateInstallationReqType->DHParams.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { - int grammarID = 43; - int done = 0; - - init_dinSignatureMethodType(dinSignatureMethodType); - - while(!done) { - switch(grammarID) { - case 43: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 44; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 44: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); - dinSignatureMethodType->HMACOutputLength_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 45; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - errn = decodeDeviationsCH(stream); - grammarID = 46; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 46: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); - dinSignatureMethodType->HMACOutputLength_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 45; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 46; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { - int grammarID = 9; - int done = 0; - - init_dinIntervalType(dinIntervalType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { - int grammarID = 47; - int done = 0; - - init_dinSelectedServiceListType(dinSelectedServiceListType); - - while(!done) { - switch(grammarID) { - case 47: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 48; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 48: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 48; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { - int grammarID = 49; - int done = 0; - - init_dinCableCheckReqType(dinCableCheckReqType); - - while(!done) { - switch(grammarID) { - case 49: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { - int grammarID = 50; - int done = 0; - - init_dinServicePaymentSelectionResType(dinServicePaymentSelectionResType); - - while(!done) { - switch(grammarID) { - case 50: + case 23: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -2353,7 +961,7 @@ static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinServicePaymentSelectionResType->ResponseCode = (dinresponseCodeType) uint32; + dinSessionSetupResType->ResponseCode = (dinresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -2363,7 +971,7 @@ static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 24; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2375,211 +983,22 @@ static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct } } break; - case 3: - /* Element[END_ELEMENT] */ + case 24: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { - int grammarID = 51; - int done = 0; - - init_dinChargeParameterDiscoveryResType(dinChargeParameterDiscoveryResType); - - while(!done) { - switch(grammarID) { - case 51: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinChargeParameterDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 52; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 52: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinChargeParameterDiscoveryResType->EVSEProcessing = (dinEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 53; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 53: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList); - dinChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; - grammarID = 54; - break; - case 1: - errn = decode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules); - dinChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; - grammarID = 54; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 54: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter); - dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter); - dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter); - dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { - int grammarID = 55; - int done = 0; - - init_dinX509IssuerSerialType(dinX509IssuerSerialType); - - while(!done) { - switch(grammarID) { - case 55: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509IssuerSerialType->X509IssuerName.charactersLen); + errn = decodeUnsignedInteger16(stream, &dinSessionSetupResType->EVSEID.bytesLen); if (errn == 0) { - errn = (dinX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinSessionSetupResType->EVSEID.bytesLen) <= dinSessionSetupResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } + errn = decodeBytes(stream, dinSessionSetupResType->EVSEID.bytesLen, dinSessionSetupResType->EVSEID.bytes); } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -2587,10 +1006,10 @@ static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509Iss } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 56; + grammarID = 25; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2602,473 +1021,8 @@ static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509Iss } } break; - case 56: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinX509IssuerSerialType->X509SerialNumber); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { - int grammarID = 57; - int done = 0; - - init_dinCableCheckResType(dinCableCheckResType); - - while(!done) { - switch(grammarID) { - case 57: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCableCheckResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 58; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 58: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus); - grammarID = 59; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 59: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinCableCheckResType->EVSEProcessing = (dinEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { - int grammarID = 60; - int done = 0; - - init_dinMeterInfoType(dinMeterInfoType); - - while(!done) { - switch(grammarID) { - case 60: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 61; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 61: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading); - dinMeterInfoType->MeterReading_isUsed = 1u; - grammarID = 62; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); - if (errn == 0) { - errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); - } - dinMeterInfoType->SigMeterReading_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 63; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); - dinMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 64; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 62: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); - if (errn == 0) { - errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); - } - dinMeterInfoType->SigMeterReading_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 63; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); - dinMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 64; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 63: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); - dinMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 64; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 64: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { @@ -3077,18 +1031,18 @@ static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; + errn = decodeInteger64(stream, &dinSessionSetupResType->DateTimeNow); + dinSessionSetupResType->DateTimeNow_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -3096,7 +1050,7 @@ static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3104,1285 +1058,14 @@ static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { - int grammarID = 65; - int done = 0; - - init_dinCurrentDemandResType(dinCurrentDemandResType); - - while(!done) { - switch(grammarID) { - case 65: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCurrentDemandResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 66; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 66: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus); - grammarID = 67; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 67: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage); - grammarID = 68; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 68: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent); - grammarID = 69; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 69: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSECurrentLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 70; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 70: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEVoltageLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 71; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 71: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEPowerLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 72; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 72: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit); - dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; - grammarID = 73; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); - dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 74; - break; - case 2: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); - dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); - dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 74; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); - dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 74: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); - dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { - int grammarID = 75; - int done = 0; - - init_dinParameterSetType(dinParameterSetType); - - while(!done) { - switch(grammarID) { - case 75: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinParameterSetType->ParameterSetID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 76; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 76: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 77; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 77: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 77; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { - int grammarID = 78; - int done = 0; - - init_dinSubCertificatesType(dinSubCertificatesType); - - while(!done) { - switch(grammarID) { - case 78: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); - } - dinSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 79; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); - } - dinSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 79; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { - int grammarID = 9; - int done = 0; - - init_dinEVSEStatusType(dinEVSEStatusType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { - int grammarID = 80; - int done = 0; - - init_dinAC_EVSEStatusType(dinAC_EVSEStatusType); - - while(!done) { - switch(grammarID) { - case 80: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinAC_EVSEStatusType->PowerSwitchClosed); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 81; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinAC_EVSEStatusType->RCD); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 82; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinAC_EVSEStatusType->NotificationMaxDelay); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 83; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinAC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { - int grammarID = 84; - int done = 0; - - init_dinEntryType(dinEntryType); - - while(!done) { - switch(grammarID) { - case 84: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval); - dinEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinIntervalType(stream, &dinEntryType->TimeInterval); - dinEntryType->TimeInterval_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { - int grammarID = 85; - int done = 0; - - init_dinPowerDeliveryReqType(dinPowerDeliveryReqType); - - while(!done) { - switch(grammarID) { - case 85: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinPowerDeliveryReqType->ReadyToChargeState); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 86; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 86: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile); - dinPowerDeliveryReqType->ChargingProfile_isUsed = 1u; - grammarID = 87; - break; - case 1: - errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); - dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 87: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); - dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType) { - int grammarID = 88; - int done = 0; - - init_dinCostType(dinCostType); - - while(!done) { - switch(grammarID) { - case 88: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinCostType->costKind = (dincostKindType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 89; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 89: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinCostType->amount); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 90; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 90: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); - dinCostType->amountMultiplier = (int8_t)(uint32 -3); - dinCostType->amountMultiplier_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { - int grammarID = 49; - int done = 0; - - init_dinWeldingDetectionReqType(dinWeldingDetectionReqType); - - while(!done) { - switch(grammarID) { - case 49: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { - int grammarID = 91; - int done = 0; - - init_dinServiceDiscoveryResType(dinServiceDiscoveryResType); - - while(!done) { - switch(grammarID) { - case 91: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinServiceDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 92; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 92: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions); - grammarID = 93; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 93: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService); - grammarID = 94; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList); - dinServiceDiscoveryResType->ServiceList_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { - int grammarID = 95; - int done = 0; - - init_dinPaymentOptionsType(dinPaymentOptionsType); - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; - dinPaymentOptionsType->PaymentOption.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 96: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; - dinPaymentOptionsType->PaymentOption.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4403,14 +1086,14 @@ static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOp /* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) { - int grammarID = 97; + int grammarID = 26; int done = 0; init_dinPGPDataType(dinPGPDataType); while(!done) { switch(grammarID) { - case 97: + case 26: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -4437,7 +1120,7 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 98; + grammarID = 27; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4465,7 +1148,7 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 99; + grammarID = 28; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4477,7 +1160,7 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din } } break; - case 98: + case 27: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -4504,7 +1187,7 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 99; + grammarID = 28; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4513,11 +1196,11 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 99; + grammarID = 28; break; case 2: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4525,7 +1208,7 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din } } break; - case 99: + case 28: /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -4533,11 +1216,11 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 99; + grammarID = 28; break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4556,36 +1239,37 @@ static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* din return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { - int grammarID = 100; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { + int grammarID = 29; int done = 0; - init_dinChargingProfileType(dinChargingProfileType); + init_dinCableCheckResType(dinCableCheckResType); while(!done) { switch(grammarID) { - case 100: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + case 29: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger16(stream, &dinChargingProfileType->SAScheduleTupleID); + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinCableCheckResType->ResponseCode = (dinresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 101; + grammarID = 30; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4597,18 +1281,14 @@ static int decode_dinChargingProfileType(bitstream_t* stream, struct dinCharging } } break; - case 101: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ + case 30: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 102; + errn = decode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus); + grammarID = 31; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4616,137 +1296,28 @@ static int decode_dinChargingProfileType(bitstream_t* stream, struct dinCharging } } break; - case 102: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 102; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { - int grammarID = 103; - int done = 0; - - init_dinCurrentDemandReqType(dinCurrentDemandReqType); - - while(!done) { - switch(grammarID) { - case 103: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + case 31: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus); - grammarID = 104; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 104: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent); - grammarID = 105; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 105: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit); - dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; - grammarID = 106; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); - dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 107; - break; - case 2: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); - dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 108; - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinCableCheckResType->EVSEProcessing = (dinEVSEProcessingType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 109; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 110; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4758,283 +1329,14 @@ static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrent } } break; - case 106: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); - dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 107; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); - dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 108; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 109; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 110; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 107: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); - dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 108; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 109; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 110; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 108: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 109; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 110; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 110; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC); - dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; - grammarID = 111; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); - dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 112; - break; - case 2: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 111: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); - dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 112; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 112: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5053,89 +1355,192 @@ static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrent return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { - int grammarID = 113; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { + int grammarID = 32; int done = 0; - init_dinSignedInfoType(dinSignedInfoType); + init_dinChargeParameterDiscoveryResType(dinChargeParameterDiscoveryResType); while(!done) { switch(grammarID) { - case 113: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + case 32: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinChargeParameterDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 33; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 33: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinChargeParameterDiscoveryResType->EVSEProcessing = (dinEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 34; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 34: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinSignedInfoType->Id.charactersLen); + errn = decode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList); + dinChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; + grammarID = 35; + break; + case 1: + errn = decode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules); + dinChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; + grammarID = 35; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 35: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter); + dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; + grammarID = 10; + break; + case 1: + errn = decode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter); + dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; + grammarID = 10; + break; + case 2: + errn = decode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter); + dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) { + int grammarID = 36; + int done = 0; + + init_dinManifestType(dinManifestType); + + while(!done) { + switch(grammarID) { + case 36: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinManifestType->Id.charactersLen); if (errn == 0) { - errn = (dinSignedInfoType->Id.charactersLen - 2) <= dinSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinManifestType->Id.charactersLen - 2) <= dinManifestType_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); + 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); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - dinSignedInfoType->Id_isUsed = 1u; - grammarID = 114; + dinManifestType->Id_isUsed = 1u; + grammarID = 37; break; case 1: - errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); - grammarID = 115; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 114: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); - grammarID = 115; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 115: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod); - grammarID = 116; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 116: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); + if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 117; + grammarID = 38; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5143,329 +1548,41 @@ static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoTyp } } break; - case 117: + case 37: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 38; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 38: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); + if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 117; + grammarID = 38; break; case 1: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { - int grammarID = 118; - int done = 0; - - init_dinServiceType(dinServiceType); - - while(!done) { - switch(grammarID) { - case 118: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceTagType(stream, &dinServiceType->ServiceTag); - grammarID = 119; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 119: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinServiceType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":BodyElement{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType) { - int grammarID = 120; - int done = 0; - - init_dinBodyType(dinBodyType); - - while(!done) { - switch(grammarID) { - case 120: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinBodyBaseType(stream, &dinBodyType->BodyElement); - dinBodyType->BodyElement_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinCableCheckReqType(stream, &dinBodyType->CableCheckReq); - dinBodyType->CableCheckReq_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinCableCheckResType(stream, &dinBodyType->CableCheckRes); - dinBodyType->CableCheckRes_isUsed = 1u; - grammarID = 3; - break; - case 3: - errn = decode_dinCertificateInstallationReqType(stream, &dinBodyType->CertificateInstallationReq); - dinBodyType->CertificateInstallationReq_isUsed = 1u; - grammarID = 3; - break; - case 4: - errn = decode_dinCertificateInstallationResType(stream, &dinBodyType->CertificateInstallationRes); - dinBodyType->CertificateInstallationRes_isUsed = 1u; - grammarID = 3; - break; - case 5: - errn = decode_dinCertificateUpdateReqType(stream, &dinBodyType->CertificateUpdateReq); - dinBodyType->CertificateUpdateReq_isUsed = 1u; - grammarID = 3; - break; - case 6: - errn = decode_dinCertificateUpdateResType(stream, &dinBodyType->CertificateUpdateRes); - dinBodyType->CertificateUpdateRes_isUsed = 1u; - grammarID = 3; - break; - case 7: - errn = decode_dinChargeParameterDiscoveryReqType(stream, &dinBodyType->ChargeParameterDiscoveryReq); - dinBodyType->ChargeParameterDiscoveryReq_isUsed = 1u; - grammarID = 3; - break; - case 8: - errn = decode_dinChargeParameterDiscoveryResType(stream, &dinBodyType->ChargeParameterDiscoveryRes); - dinBodyType->ChargeParameterDiscoveryRes_isUsed = 1u; - grammarID = 3; - break; - case 9: - errn = decode_dinChargingStatusReqType(stream, &dinBodyType->ChargingStatusReq); - dinBodyType->ChargingStatusReq_isUsed = 1u; - grammarID = 3; - break; - case 10: - errn = decode_dinChargingStatusResType(stream, &dinBodyType->ChargingStatusRes); - dinBodyType->ChargingStatusRes_isUsed = 1u; - grammarID = 3; - break; - case 11: - errn = decode_dinContractAuthenticationReqType(stream, &dinBodyType->ContractAuthenticationReq); - dinBodyType->ContractAuthenticationReq_isUsed = 1u; - grammarID = 3; - break; - case 12: - errn = decode_dinContractAuthenticationResType(stream, &dinBodyType->ContractAuthenticationRes); - dinBodyType->ContractAuthenticationRes_isUsed = 1u; - grammarID = 3; - break; - case 13: - errn = decode_dinCurrentDemandReqType(stream, &dinBodyType->CurrentDemandReq); - dinBodyType->CurrentDemandReq_isUsed = 1u; - grammarID = 3; - break; - case 14: - errn = decode_dinCurrentDemandResType(stream, &dinBodyType->CurrentDemandRes); - dinBodyType->CurrentDemandRes_isUsed = 1u; - grammarID = 3; - break; - case 15: - errn = decode_dinMeteringReceiptReqType(stream, &dinBodyType->MeteringReceiptReq); - dinBodyType->MeteringReceiptReq_isUsed = 1u; - grammarID = 3; - break; - case 16: - errn = decode_dinMeteringReceiptResType(stream, &dinBodyType->MeteringReceiptRes); - dinBodyType->MeteringReceiptRes_isUsed = 1u; - grammarID = 3; - break; - case 17: - errn = decode_dinPaymentDetailsReqType(stream, &dinBodyType->PaymentDetailsReq); - dinBodyType->PaymentDetailsReq_isUsed = 1u; - grammarID = 3; - break; - case 18: - errn = decode_dinPaymentDetailsResType(stream, &dinBodyType->PaymentDetailsRes); - dinBodyType->PaymentDetailsRes_isUsed = 1u; - grammarID = 3; - break; - case 19: - errn = decode_dinPowerDeliveryReqType(stream, &dinBodyType->PowerDeliveryReq); - dinBodyType->PowerDeliveryReq_isUsed = 1u; - grammarID = 3; - break; - case 20: - errn = decode_dinPowerDeliveryResType(stream, &dinBodyType->PowerDeliveryRes); - dinBodyType->PowerDeliveryRes_isUsed = 1u; - grammarID = 3; - break; - case 21: - errn = decode_dinPreChargeReqType(stream, &dinBodyType->PreChargeReq); - dinBodyType->PreChargeReq_isUsed = 1u; - grammarID = 3; - break; - case 22: - errn = decode_dinPreChargeResType(stream, &dinBodyType->PreChargeRes); - dinBodyType->PreChargeRes_isUsed = 1u; - grammarID = 3; - break; - case 23: - errn = decode_dinServiceDetailReqType(stream, &dinBodyType->ServiceDetailReq); - dinBodyType->ServiceDetailReq_isUsed = 1u; - grammarID = 3; - break; - case 24: - errn = decode_dinServiceDetailResType(stream, &dinBodyType->ServiceDetailRes); - dinBodyType->ServiceDetailRes_isUsed = 1u; - grammarID = 3; - break; - case 25: - errn = decode_dinServiceDiscoveryReqType(stream, &dinBodyType->ServiceDiscoveryReq); - dinBodyType->ServiceDiscoveryReq_isUsed = 1u; - grammarID = 3; - break; - case 26: - errn = decode_dinServiceDiscoveryResType(stream, &dinBodyType->ServiceDiscoveryRes); - dinBodyType->ServiceDiscoveryRes_isUsed = 1u; - grammarID = 3; - break; - case 27: - errn = decode_dinServicePaymentSelectionReqType(stream, &dinBodyType->ServicePaymentSelectionReq); - dinBodyType->ServicePaymentSelectionReq_isUsed = 1u; - grammarID = 3; - break; - case 28: - errn = decode_dinServicePaymentSelectionResType(stream, &dinBodyType->ServicePaymentSelectionRes); - dinBodyType->ServicePaymentSelectionRes_isUsed = 1u; - grammarID = 3; - break; - case 29: - errn = decode_dinSessionSetupReqType(stream, &dinBodyType->SessionSetupReq); - dinBodyType->SessionSetupReq_isUsed = 1u; - grammarID = 3; - break; - case 30: - errn = decode_dinSessionSetupResType(stream, &dinBodyType->SessionSetupRes); - dinBodyType->SessionSetupRes_isUsed = 1u; - grammarID = 3; - break; - case 31: - errn = decode_dinSessionStopType(stream, &dinBodyType->SessionStopReq); - dinBodyType->SessionStopReq_isUsed = 1u; - grammarID = 3; - break; - case 32: - errn = decode_dinSessionStopResType(stream, &dinBodyType->SessionStopRes); - dinBodyType->SessionStopRes_isUsed = 1u; - grammarID = 3; - break; - case 33: - errn = decode_dinWeldingDetectionReqType(stream, &dinBodyType->WeldingDetectionReq); - dinBodyType->WeldingDetectionReq_isUsed = 1u; - grammarID = 3; - break; - case 34: - errn = decode_dinWeldingDetectionResType(stream, &dinBodyType->WeldingDetectionRes); - dinBodyType->WeldingDetectionRes_isUsed = 1u; - grammarID = 3; - break; - case 35: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5486,14 +1603,14 @@ static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyTy /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { - int grammarID = 121; + int grammarID = 39; int done = 0; init_dinAC_EVChargeParameterType(dinAC_EVChargeParameterType); while(!done) { switch(grammarID) { - case 121: + case 39: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -5513,7 +1630,7 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 122; + grammarID = 40; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5525,14 +1642,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 122: + case 40: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EAmount); - grammarID = 123; + grammarID = 41; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5540,14 +1657,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 123: + case 41: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxVoltage); - grammarID = 124; + grammarID = 42; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5555,14 +1672,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 124: + case 42: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxCurrent); - grammarID = 125; + grammarID = 43; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5570,14 +1687,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 125: + case 43: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMinCurrent); - grammarID = 3; + grammarID = 10; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5585,14 +1702,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5611,36 +1728,108 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { - int grammarID = 126; +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { + int grammarID = 44; int done = 0; - init_dinSAScheduleTupleType(dinSAScheduleTupleType); + init_dinBodyBaseType(dinBodyBaseType); while(!done) { switch(grammarID) { - case 126: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + case 44: + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { + int grammarID = 45; + int done = 0; + + init_dinDC_EVPowerDeliveryParameterType(dinDC_EVPowerDeliveryParameterType); + + while(!done) { + switch(grammarID) { + case 45: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus); + grammarID = 46; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 46: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger16(stream, &dinSAScheduleTupleType->SAScheduleTupleID); + errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->BulkChargingComplete); + dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 127; + grammarID = 47; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5652,14 +1841,31 @@ static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSASchedu } } break; - case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ + case 47: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule); - grammarID = 128; + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5667,34 +1873,526 @@ static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSASchedu } } break; - case 128: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff); - dinSAScheduleTupleType->SalesTariff_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { + int grammarID = 48; + int done = 0; + + init_dinCableCheckReqType(dinCableCheckReqType); + + while(!done) { + switch(grammarID) { + case 48: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) { + int grammarID = 12; + int done = 0; + + init_dinDigestMethodType(dinDigestMethodType); + + while(!done) { + switch(grammarID) { + case 12: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 13; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 13: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + done = 1; + grammarID = 11; + break; + case 2: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + done = 1; + grammarID = 11; + break; + case 2: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { + int grammarID = 49; + int done = 0; + + init_dinSalesTariffType(dinSalesTariffType); + + while(!done) { + switch(grammarID) { + case 49: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 50; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 50: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinSalesTariffType->SalesTariffID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 51; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 51: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSalesTariffType->SalesTariffDescription_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 52; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 53; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 52: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 53; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 54; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 54: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 54; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { + int grammarID = 55; + int done = 0; + + init_dinServicePaymentSelectionResType(dinServicePaymentSelectionResType); + + while(!done) { + switch(grammarID) { + case 55: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinServicePaymentSelectionResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { + int grammarID = 56; + int done = 0; + + init_dinPreChargeReqType(dinPreChargeReqType); + + while(!done) { + switch(grammarID) { + case 56: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus); + grammarID = 57; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 57: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage); + grammarID = 58; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 58: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5715,14 +2413,14 @@ static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSASchedu /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple{1-UNBOUNDED})', derivedBy='EXTENSION'. */ static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) { - int grammarID = 129; + int grammarID = 59; int done = 0; init_dinSAScheduleListType(dinSAScheduleListType); while(!done) { switch(grammarID) { - case 129: + case 59: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -5733,7 +2431,7 @@ static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSASchedul } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 130; + grammarID = 60; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5741,7 +2439,7 @@ static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSASchedul } } break; - case 130: + case 60: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -5752,11 +2450,11 @@ static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSASchedul } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 130; + grammarID = 60; break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5775,37 +2473,42 @@ static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSASchedul return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { - int grammarID = 131; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { + int grammarID = 61; int done = 0; - init_dinServicePaymentSelectionReqType(dinServicePaymentSelectionReqType); + init_dinCertificateChainType(dinCertificateChainType); while(!done) { switch(grammarID) { - case 131: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ + case 61: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinServicePaymentSelectionReqType->SelectedPaymentOption = (dinpaymentOptionType) uint32; + errn = decodeUnsignedInteger16(stream, &dinCertificateChainType->Certificate.bytesLen); + if (errn == 0) { + errn = (dinCertificateChainType->Certificate.bytesLen) <= dinCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateChainType->Certificate.bytesLen, dinCertificateChainType->Certificate.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 132; + grammarID = 62; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5817,14 +2520,19 @@ static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct } } break; - case 132: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 62: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList); - grammarID = 3; + errn = decode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates); + dinCertificateChainType->SubCertificates_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5832,14 +2540,3007 @@ static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) { + int grammarID = 63; + int done = 0; + + init_dinSignaturePropertiesType(dinSignaturePropertiesType); + + while(!done) { + switch(grammarID) { + case 63: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignaturePropertiesType->Id_isUsed = 1u; + grammarID = 64; + break; + case 1: + if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 65; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 64: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 65; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 65: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 65; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { + int grammarID = 66; + int done = 0; + + init_dinMessageHeaderType(dinMessageHeaderType); + + while(!done) { + switch(grammarID) { + case 66: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMessageHeaderType->SessionID.bytesLen); + if (errn == 0) { + errn = (dinMessageHeaderType->SessionID.bytesLen) <= dinMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMessageHeaderType->SessionID.bytesLen, dinMessageHeaderType->SessionID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 67; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 67: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinNotificationType(stream, &dinMessageHeaderType->Notification); + dinMessageHeaderType->Notification_isUsed = 1u; + grammarID = 68; + break; + case 1: + errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); + dinMessageHeaderType->Signature_isUsed = 1u; + grammarID = 10; + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 68: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); + dinMessageHeaderType->Signature_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { + int grammarID = 69; + int done = 0; + + init_dinPreChargeResType(dinPreChargeResType); + + while(!done) { + switch(grammarID) { + case 69: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinPreChargeResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 70; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus); + grammarID = 71; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 71: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { + int grammarID = 72; + int done = 0; + + init_dinMeteringReceiptResType(dinMeteringReceiptResType); + + while(!done) { + switch(grammarID) { + case 72: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinMeteringReceiptResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 73; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) { + int grammarID = 74; + int done = 0; + + init_dinNotificationType(dinNotificationType); + + while(!done) { + switch(grammarID) { + case 74: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinNotificationType->FaultCode = (dinfaultCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 75; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 75: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinNotificationType->FaultMsg_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { + int grammarID = 76; + int done = 0; + + init_dinContractAuthenticationReqType(dinContractAuthenticationReqType); + + while(!done) { + switch(grammarID) { + case 76: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinContractAuthenticationReqType->Id_isUsed = 1u; + grammarID = 77; + break; + case 1: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 77: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) { + int grammarID = 78; + int done = 0; + + init_dinPhysicalValueType(dinPhysicalValueType); + + while(!done) { + switch(grammarID) { + case 78: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + dinPhysicalValueType->Multiplier = (int8_t)(uint32 -3); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 79; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 79: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinPhysicalValueType->Unit = (dinunitSymbolType) uint32; + dinPhysicalValueType->Unit_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 80; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinPhysicalValueType->Value); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 80: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinPhysicalValueType->Value); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { + int grammarID = 81; + int done = 0; + + init_dinChargingStatusResType(dinChargingStatusResType); + + while(!done) { + switch(grammarID) { + case 81: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinChargingStatusResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 82; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 82: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinChargingStatusResType->EVSEID.bytesLen); + if (errn == 0) { + errn = (dinChargingStatusResType->EVSEID.bytesLen) <= dinChargingStatusResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinChargingStatusResType->EVSEID.bytesLen, dinChargingStatusResType->EVSEID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 83; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinChargingStatusResType->SAScheduleTupleID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 84; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 84: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent); + dinChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; + grammarID = 85; + break; + case 1: + errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); + dinChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 86; + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 73; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 85: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); + dinChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 86; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 73; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 86: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 73; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { + int grammarID = 87; + int done = 0; + + init_dinDC_EVSEStatusType(dinDC_EVSEStatusType); + + while(!done) { + switch(grammarID) { + case 87: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinDC_EVSEStatusType->EVSEIsolationStatus = (dinisolationLevelType) uint32; + dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 88; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 18; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 88: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 18; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 18: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinDC_EVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 19; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinDC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ +static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { + int grammarID = 89; + int done = 0; + + init_dinProfileEntryType(dinProfileEntryType); + + while(!done) { + switch(grammarID) { + case 89: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinProfileEntryType->ChargingProfileEntryStart); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 90; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 90: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinProfileEntryType->ChargingProfileEntryMaxPower); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ +static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { + int grammarID = 91; + int done = 0; + + init_dinAC_EVSEChargeParameterType(dinAC_EVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 91: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus); + grammarID = 92; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage); + grammarID = 93; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 93: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent); + grammarID = 94; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { + int grammarID = 95; + int done = 0; + + init_dinServiceDiscoveryResType(dinServiceDiscoveryResType); + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinServiceDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 96: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions); + grammarID = 97; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 97: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService); + grammarID = 98; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 98: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList); + dinServiceDiscoveryResType->ServiceList_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { + int grammarID = 99; + int done = 0; + + init_dinSignatureType(dinSignatureType); + + while(!done) { + switch(grammarID) { + case 99: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignatureType->Id_isUsed = 1u; + grammarID = 100; + break; + case 1: + errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); + grammarID = 101; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 100: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); + grammarID = 101; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 101: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue); + grammarID = 102; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 102: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo); + dinSignatureType->KeyInfo_isUsed = 1u; + grammarID = 103; + break; + case 1: + if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { + errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 103; + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 103: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { + errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 103; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { + int grammarID = 104; + int done = 0; + + init_dinPaymentOptionsType(dinPaymentOptionsType); + + while(!done) { + switch(grammarID) { + case 104: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; + dinPaymentOptionsType->PaymentOption.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 105; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 105: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; + dinPaymentOptionsType->PaymentOption.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 105; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { + int grammarID = 106; + int done = 0; + + init_dinParameterType(dinParameterType); + + while(!done) { + switch(grammarID) { + case 106: + /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 107; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 107: + /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + dinParameterType->ValueType = (dinvalueType) uint32; + grammarID = 108; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 108: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinParameterType->boolValue); + dinParameterType->boolValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinParameterType->byteValue = (int8_t)(uint32 -128); + dinParameterType->byteValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinParameterType->shortValue); + dinParameterType->shortValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger32(stream, &dinParameterType->intValue); + dinParameterType->intValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + errn = decode_dinPhysicalValueType(stream, &dinParameterType->physicalValue); + dinParameterType->physicalValue_isUsed = 1u; + grammarID = 10; + break; + case 5: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinParameterType->stringValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { + int grammarID = 109; + int done = 0; + + init_dinSignaturePropertyType(dinSignaturePropertyType); + + while(!done) { + switch(grammarID) { + case 109: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignaturePropertyType->Id_isUsed = 1u; + grammarID = 110; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 111; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 110: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 111; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 111: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + grammarID = 112; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + done = 1; + grammarID = 11; + break; + case 2: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 112: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + grammarID = 112; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { + int grammarID = 44; + int done = 0; + + init_dinEVPowerDeliveryParameterType(dinEVPowerDeliveryParameterType); + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { + int grammarID = 48; + int done = 0; + + init_dinWeldingDetectionReqType(dinWeldingDetectionReqType); + + while(!done) { + switch(grammarID) { + case 48: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType) { + int grammarID = 113; + int done = 0; + + init_dinTransformsType(dinTransformsType); + + while(!done) { + switch(grammarID) { + case 113: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { + errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 114; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 114: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { + errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 114; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { + int grammarID = 115; + int done = 0; + + init_dinServiceType(dinServiceType); + + while(!done) { + switch(grammarID) { + case 115: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceTagType(stream, &dinServiceType->ServiceTag); + grammarID = 116; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 116: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":BodyElement{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType) { + int grammarID = 117; + int done = 0; + + init_dinBodyType(dinBodyType); + + while(!done) { + switch(grammarID) { + case 117: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinBodyBaseType(stream, &dinBodyType->BodyElement); + dinBodyType->BodyElement_isUsed = 1u; + grammarID = 10; + break; + case 1: + errn = decode_dinCableCheckReqType(stream, &dinBodyType->CableCheckReq); + dinBodyType->CableCheckReq_isUsed = 1u; + grammarID = 10; + break; + case 2: + errn = decode_dinCableCheckResType(stream, &dinBodyType->CableCheckRes); + dinBodyType->CableCheckRes_isUsed = 1u; + grammarID = 10; + break; + case 3: + errn = decode_dinCertificateInstallationReqType(stream, &dinBodyType->CertificateInstallationReq); + dinBodyType->CertificateInstallationReq_isUsed = 1u; + grammarID = 10; + break; + case 4: + errn = decode_dinCertificateInstallationResType(stream, &dinBodyType->CertificateInstallationRes); + dinBodyType->CertificateInstallationRes_isUsed = 1u; + grammarID = 10; + break; + case 5: + errn = decode_dinCertificateUpdateReqType(stream, &dinBodyType->CertificateUpdateReq); + dinBodyType->CertificateUpdateReq_isUsed = 1u; + grammarID = 10; + break; + case 6: + errn = decode_dinCertificateUpdateResType(stream, &dinBodyType->CertificateUpdateRes); + dinBodyType->CertificateUpdateRes_isUsed = 1u; + grammarID = 10; + break; + case 7: + errn = decode_dinChargeParameterDiscoveryReqType(stream, &dinBodyType->ChargeParameterDiscoveryReq); + dinBodyType->ChargeParameterDiscoveryReq_isUsed = 1u; + grammarID = 10; + break; + case 8: + errn = decode_dinChargeParameterDiscoveryResType(stream, &dinBodyType->ChargeParameterDiscoveryRes); + dinBodyType->ChargeParameterDiscoveryRes_isUsed = 1u; + grammarID = 10; + break; + case 9: + errn = decode_dinChargingStatusReqType(stream, &dinBodyType->ChargingStatusReq); + dinBodyType->ChargingStatusReq_isUsed = 1u; + grammarID = 10; + break; + case 10: + errn = decode_dinChargingStatusResType(stream, &dinBodyType->ChargingStatusRes); + dinBodyType->ChargingStatusRes_isUsed = 1u; + grammarID = 10; + break; + case 11: + errn = decode_dinContractAuthenticationReqType(stream, &dinBodyType->ContractAuthenticationReq); + dinBodyType->ContractAuthenticationReq_isUsed = 1u; + grammarID = 10; + break; + case 12: + errn = decode_dinContractAuthenticationResType(stream, &dinBodyType->ContractAuthenticationRes); + dinBodyType->ContractAuthenticationRes_isUsed = 1u; + grammarID = 10; + break; + case 13: + errn = decode_dinCurrentDemandReqType(stream, &dinBodyType->CurrentDemandReq); + dinBodyType->CurrentDemandReq_isUsed = 1u; + grammarID = 10; + break; + case 14: + errn = decode_dinCurrentDemandResType(stream, &dinBodyType->CurrentDemandRes); + dinBodyType->CurrentDemandRes_isUsed = 1u; + grammarID = 10; + break; + case 15: + errn = decode_dinMeteringReceiptReqType(stream, &dinBodyType->MeteringReceiptReq); + dinBodyType->MeteringReceiptReq_isUsed = 1u; + grammarID = 10; + break; + case 16: + errn = decode_dinMeteringReceiptResType(stream, &dinBodyType->MeteringReceiptRes); + dinBodyType->MeteringReceiptRes_isUsed = 1u; + grammarID = 10; + break; + case 17: + errn = decode_dinPaymentDetailsReqType(stream, &dinBodyType->PaymentDetailsReq); + dinBodyType->PaymentDetailsReq_isUsed = 1u; + grammarID = 10; + break; + case 18: + errn = decode_dinPaymentDetailsResType(stream, &dinBodyType->PaymentDetailsRes); + dinBodyType->PaymentDetailsRes_isUsed = 1u; + grammarID = 10; + break; + case 19: + errn = decode_dinPowerDeliveryReqType(stream, &dinBodyType->PowerDeliveryReq); + dinBodyType->PowerDeliveryReq_isUsed = 1u; + grammarID = 10; + break; + case 20: + errn = decode_dinPowerDeliveryResType(stream, &dinBodyType->PowerDeliveryRes); + dinBodyType->PowerDeliveryRes_isUsed = 1u; + grammarID = 10; + break; + case 21: + errn = decode_dinPreChargeReqType(stream, &dinBodyType->PreChargeReq); + dinBodyType->PreChargeReq_isUsed = 1u; + grammarID = 10; + break; + case 22: + errn = decode_dinPreChargeResType(stream, &dinBodyType->PreChargeRes); + dinBodyType->PreChargeRes_isUsed = 1u; + grammarID = 10; + break; + case 23: + errn = decode_dinServiceDetailReqType(stream, &dinBodyType->ServiceDetailReq); + dinBodyType->ServiceDetailReq_isUsed = 1u; + grammarID = 10; + break; + case 24: + errn = decode_dinServiceDetailResType(stream, &dinBodyType->ServiceDetailRes); + dinBodyType->ServiceDetailRes_isUsed = 1u; + grammarID = 10; + break; + case 25: + errn = decode_dinServiceDiscoveryReqType(stream, &dinBodyType->ServiceDiscoveryReq); + dinBodyType->ServiceDiscoveryReq_isUsed = 1u; + grammarID = 10; + break; + case 26: + errn = decode_dinServiceDiscoveryResType(stream, &dinBodyType->ServiceDiscoveryRes); + dinBodyType->ServiceDiscoveryRes_isUsed = 1u; + grammarID = 10; + break; + case 27: + errn = decode_dinServicePaymentSelectionReqType(stream, &dinBodyType->ServicePaymentSelectionReq); + dinBodyType->ServicePaymentSelectionReq_isUsed = 1u; + grammarID = 10; + break; + case 28: + errn = decode_dinServicePaymentSelectionResType(stream, &dinBodyType->ServicePaymentSelectionRes); + dinBodyType->ServicePaymentSelectionRes_isUsed = 1u; + grammarID = 10; + break; + case 29: + errn = decode_dinSessionSetupReqType(stream, &dinBodyType->SessionSetupReq); + dinBodyType->SessionSetupReq_isUsed = 1u; + grammarID = 10; + break; + case 30: + errn = decode_dinSessionSetupResType(stream, &dinBodyType->SessionSetupRes); + dinBodyType->SessionSetupRes_isUsed = 1u; + grammarID = 10; + break; + case 31: + errn = decode_dinSessionStopType(stream, &dinBodyType->SessionStopReq); + dinBodyType->SessionStopReq_isUsed = 1u; + grammarID = 10; + break; + case 32: + errn = decode_dinSessionStopResType(stream, &dinBodyType->SessionStopRes); + dinBodyType->SessionStopRes_isUsed = 1u; + grammarID = 10; + break; + case 33: + errn = decode_dinWeldingDetectionReqType(stream, &dinBodyType->WeldingDetectionReq); + dinBodyType->WeldingDetectionReq_isUsed = 1u; + grammarID = 10; + break; + case 34: + errn = decode_dinWeldingDetectionResType(stream, &dinBodyType->WeldingDetectionRes); + dinBodyType->WeldingDetectionRes_isUsed = 1u; + grammarID = 10; + break; + case 35: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { + int grammarID = 118; + int done = 0; + + init_dinDC_EVStatusType(dinDC_EVStatusType); + + while(!done) { + switch(grammarID) { + case 118: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVReady); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 119; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVCabinConditioning); + dinDC_EVStatusType->EVCabinConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 120; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); + dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 121; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 122; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 120: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); + dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 121; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 122; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 121: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 122; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 122: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { + int grammarID = 123; + int done = 0; + + init_dinPMaxScheduleEntryType(dinPMaxScheduleEntryType); + + while(!done) { + switch(grammarID) { + case 123: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval); + dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 124; + break; + case 1: + errn = decode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval); + dinPMaxScheduleEntryType->TimeInterval_isUsed = 1u; + grammarID = 124; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 124: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinPMaxScheduleEntryType->PMax); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5860,14 +5561,14 @@ static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) { - int grammarID = 133; + int grammarID = 125; int done = 0; init_dinPMaxScheduleType(dinPMaxScheduleType); while(!done) { switch(grammarID) { - case 133: + case 125: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -5887,7 +5588,7 @@ static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxSchedul /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 134; + grammarID = 126; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5899,7 +5600,7 @@ static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxSchedul } } break; - case 134: + case 126: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -5910,7 +5611,7 @@ static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxSchedul } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 135; + grammarID = 127; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5918,7 +5619,7 @@ static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxSchedul } } break; - case 135: + case 127: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -5929,11 +5630,11 @@ static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxSchedul } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 135; + grammarID = 127; break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5952,53 +5653,36 @@ static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxSchedul return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { - int grammarID = 136; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { + int grammarID = 128; int done = 0; - init_dinListOfRootCertificateIDsType(dinListOfRootCertificateIDsType); + init_dinSelectedServiceType(dinSelectedServiceType); while(!done) { switch(grammarID) { - case 136: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ + case 128: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSelectedServiceType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 137; + grammarID = 129; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6010,44 +5694,28 @@ static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct di } } break; - case 137: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ + case 129: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinSelectedServiceType->ParameterSetID); + dinSelectedServiceType->ParameterSetID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 137; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6055,7 +5723,22 @@ static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct di break; case 1: done = 1; - grammarID = 4; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6074,35 +5757,98 @@ static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct di return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { - int grammarID = 138; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { + int grammarID = 44; int done = 0; - init_dinCanonicalizationMethodType(dinCanonicalizationMethodType); + init_dinIntervalType(dinIntervalType); while(!done) { switch(grammarID) { - case 138: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + case 44: + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinCanonicalizationMethodType->Algorithm.charactersLen); + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { + int grammarID = 130; + int done = 0; + + init_dinCertificateInstallationReqType(dinCertificateInstallationReqType); + + while(!done) { + switch(grammarID) { + case 130: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->Id.charactersLen); if (errn == 0) { - errn = (dinCanonicalizationMethodType->Algorithm.charactersLen - 2) <= dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinCertificateInstallationReqType->Id.charactersLen - 2) <= dinCertificateInstallationReqType_Id_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); + 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); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 139; + dinCertificateInstallationReqType->Id_isUsed = 1u; + grammarID = 131; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 132; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6110,22 +5856,37 @@ static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinC } } break; - case 139: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 131: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 132; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6133,22 +5894,67 @@ static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinC } } break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 132: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; + errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs); + grammarID = 133; break; - case 1: + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 133: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->DHParams.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationReqType->DHParams.bytesLen) <= dinCertificateInstallationReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytesLen, dinCertificateInstallationReqType->DHParams.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6169,14 +5975,14 @@ static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinC /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) { - int grammarID = 140; + int grammarID = 134; int done = 0; init_dinTransformType(dinTransformType); while(!done) { switch(grammarID) { - case 140: + case 134: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6195,7 +6001,7 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 141; + grammarID = 135; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6203,7 +6009,7 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* } } break; - case 141: + case 135: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -6240,7 +6046,7 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 142; + grammarID = 136; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6249,14 +6055,14 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 142; + grammarID = 136; break; case 2: done = 1; - grammarID = 4; + grammarID = 11; break; case 3: - grammarID = 142; + grammarID = 136; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6264,7 +6070,7 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* } } break; - case 142: + case 136: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -6301,7 +6107,7 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 142; + grammarID = 136; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6310,15 +6116,2398 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 142; + grammarID = 136; break; case 2: done = 1; - grammarID = 4; + grammarID = 11; break; case 3: + grammarID = 136; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { + int grammarID = 137; + int done = 0; + + init_dinKeyValueType(dinKeyValueType); + + while(!done) { + switch(grammarID) { + case 137: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); + dinKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 138; + break; + case 1: + errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); + dinKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 138; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 138; + break; + case 3: + grammarID = 139; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 138: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + case 1: + grammarID = 138; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 139: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); + dinKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 138; + break; + case 1: + errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); + dinKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 138; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 138; + break; + case 3: + grammarID = 139; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { + int grammarID = 140; + int done = 0; + + init_dinRetrievalMethodType(dinRetrievalMethodType); + + while(!done) { + switch(grammarID) { + case 140: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinRetrievalMethodType->Type_isUsed = 1u; + grammarID = 141; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinRetrievalMethodType->URI_isUsed = 1u; grammarID = 142; break; + case 2: + errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); + dinRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 10; + break; + case 3: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 141: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinRetrievalMethodType->URI_isUsed = 1u; + grammarID = 142; + break; + case 1: + errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); + dinRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 10; + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 142: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); + dinRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { + int grammarID = 44; + int done = 0; + + init_dinEVChargeParameterType(dinEVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ +static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { + int grammarID = 143; + int done = 0; + + init_dinServiceChargeType(dinServiceChargeType); + + while(!done) { + switch(grammarID) { + case 143: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag); + grammarID = 144; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 144: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinServiceChargeType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 145; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 145: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinServiceChargeType->EnergyTransferType = (dinEVSESupportedEnergyTransferType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { + int grammarID = 146; + int done = 0; + + init_dinParameterSetType(dinParameterSetType); + + while(!done) { + switch(grammarID) { + case 146: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinParameterSetType->ParameterSetID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 147; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 147: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 148; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 148: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 148; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) { + int grammarID = 149; + int done = 0; + + init_dinReferenceType(dinReferenceType); + + while(!done) { + switch(grammarID) { + case 149: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->Id_isUsed = 1u; + grammarID = 150; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->Type_isUsed = 1u; + grammarID = 151; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->URI_isUsed = 1u; + grammarID = 152; + break; + case 3: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 153; + break; + case 4: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 154; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 150: + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->Type_isUsed = 1u; + grammarID = 151; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->URI_isUsed = 1u; + grammarID = 152; + break; + case 2: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 153; + break; + case 3: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 154; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 151: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->URI_isUsed = 1u; + grammarID = 152; + break; + case 1: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 153; + break; + case 2: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 154; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 152: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 153; + break; + case 1: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 154; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 153: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 154; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 154: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinReferenceType->DigestValue.bytesLen); + if (errn == 0) { + errn = (dinReferenceType->DigestValue.bytesLen) <= dinReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinReferenceType->DigestValue.bytesLen, dinReferenceType->DigestValue.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType) { + int grammarID = 55; + int done = 0; + + init_dinSessionStopResType(dinSessionStopResType); + + while(!done) { + switch(grammarID) { + case 55: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinSessionStopResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { + int grammarID = 155; + int done = 0; + + init_dinObjectType(dinObjectType); + + while(!done) { + switch(grammarID) { + case 155: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->Encoding_isUsed = 1u; + grammarID = 156; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->Id_isUsed = 1u; + grammarID = 157; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->MimeType_isUsed = 1u; + grammarID = 13; + break; + case 3: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 4: + done = 1; + grammarID = 11; + break; + case 5: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 156: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->Id_isUsed = 1u; + grammarID = 157; + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->MimeType_isUsed = 1u; + grammarID = 13; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 3: + done = 1; + grammarID = 11; + break; + case 4: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 157: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->MimeType_isUsed = 1u; + grammarID = 13; + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 2: + done = 1; + grammarID = 11; + break; + case 3: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 13: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + done = 1; + grammarID = 11; + break; + case 2: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + done = 1; + grammarID = 11; + break; + case 2: + grammarID = 14; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { + int grammarID = 158; + int done = 0; + + init_dinSignatureValueType(dinSignatureValueType); + + while(!done) { + switch(grammarID) { + case 158: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignatureValueType->Id_isUsed = 1u; + grammarID = 159; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); + } + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 159: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); + } + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { + int grammarID = 160; + int done = 0; + + init_dinSelectedServiceListType(dinSelectedServiceListType); + + while(!done) { + switch(grammarID) { + case 160: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 161; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 161: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 161; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ +static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { + int grammarID = 162; + int done = 0; + + init_dinSalesTariffEntryType(dinSalesTariffEntryType); + + while(!done) { + switch(grammarID) { + case 162: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval); + dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 163; + break; + case 1: + errn = decode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval); + dinSalesTariffEntryType->TimeInterval_isUsed = 1u; + grammarID = 163; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 163: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 164; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 164: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSalesTariffEntryType->ConsumptionCost.arrayLen < dinSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array[dinSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 164; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { + int grammarID = 165; + int done = 0; + + init_dinConsumptionCostType(dinConsumptionCostType); + + while(!done) { + switch(grammarID) { + case 165: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinConsumptionCostType->startValue); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 166; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 166: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinConsumptionCostType->Cost.arrayLen < dinConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_dinCostType(stream, &dinConsumptionCostType->Cost.array[dinConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 166; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { + int grammarID = 167; + int done = 0; + + init_dinRSAKeyValueType(dinRSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 167: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Modulus.bytesLen); + if (errn == 0) { + errn = (dinRSAKeyValueType->Modulus.bytesLen) <= dinRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinRSAKeyValueType->Modulus.bytesLen, dinRSAKeyValueType->Modulus.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 168; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 168: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Exponent.bytesLen); + if (errn == 0) { + errn = (dinRSAKeyValueType->Exponent.bytesLen) <= dinRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinRSAKeyValueType->Exponent.bytesLen, dinRSAKeyValueType->Exponent.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { + int grammarID = 169; + int done = 0; + + init_dinMeteringReceiptReqType(dinMeteringReceiptReqType); + + while(!done) { + switch(grammarID) { + case 169: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinMeteringReceiptReqType->Id_isUsed = 1u; + grammarID = 170; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); + if (errn == 0) { + errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 171; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 170: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); + if (errn == 0) { + errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 171; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 171: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeteringReceiptReqType->SAScheduleTupleID); + dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 172; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 172: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { + int grammarID = 173; + int done = 0; + + init_dinSAScheduleTupleType(dinSAScheduleTupleType); + + while(!done) { + switch(grammarID) { + case 173: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinSAScheduleTupleType->SAScheduleTupleID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 174; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 174: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule); + grammarID = 175; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 175: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff); + dinSAScheduleTupleType->SalesTariff_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { + int grammarID = 176; + int done = 0; + + init_dinRelativeTimeIntervalType(dinRelativeTimeIntervalType); + + while(!done) { + switch(grammarID) { + case 176: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->start); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 177; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 177: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->duration); + dinRelativeTimeIntervalType->duration_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { + int grammarID = 178; + int done = 0; + + init_dinChargingProfileType(dinChargingProfileType); + + while(!done) { + switch(grammarID) { + case 178: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinChargingProfileType->SAScheduleTupleID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 179; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 179: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 180; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 180: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 180; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { + int grammarID = 181; + int done = 0; + + init_dinCurrentDemandReqType(dinCurrentDemandReqType); + + while(!done) { + switch(grammarID) { + case 181: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus); + grammarID = 182; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 182: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent); + grammarID = 183; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 183: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit); + dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; + grammarID = 184; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); + dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 185; + break; + case 2: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 186; + break; + case 3: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 188; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 184: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); + dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 185; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 186; + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 188; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 185: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 186; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 188; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 186: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 188; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 187: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 188; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 188: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC); + dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; + grammarID = 189; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); + dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 190; + break; + case 2: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 189: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); + dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 190; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 190: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -6338,14 +8527,14 @@ static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) { - int grammarID = 143; + int grammarID = 191; int done = 0; init_dinKeyInfoType(dinKeyInfoType); while(!done) { switch(grammarID) { - case 143: + case 191: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -6365,7 +8554,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } } dinKeyInfoType->Id_isUsed = 1u; - grammarID = 144; + grammarID = 192; break; case 1: if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { @@ -6399,7 +8588,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6411,7 +8600,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 3: if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -6419,7 +8608,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 4: if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { @@ -6427,7 +8616,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 5: if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { @@ -6435,7 +8624,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 6: if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -6443,7 +8632,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 7: if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -6477,7 +8666,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6486,10 +8675,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din case 8: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 145; + grammarID = 193; break; case 9: - grammarID = 146; + grammarID = 194; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6497,7 +8686,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } } break; - case 144: + case 192: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -6534,7 +8723,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6546,7 +8735,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 2: if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -6554,7 +8743,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 3: if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { @@ -6562,7 +8751,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 4: if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { @@ -6570,7 +8759,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 5: if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -6578,7 +8767,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 6: if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -6612,7 +8801,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6621,10 +8810,10 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din case 7: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 145; + grammarID = 193; break; case 8: - grammarID = 146; + grammarID = 194; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6632,7 +8821,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } } break; - case 145: + case 193: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -6669,7 +8858,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6681,7 +8870,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 2: if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -6689,7 +8878,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 3: if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { @@ -6697,7 +8886,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 4: if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { @@ -6705,7 +8894,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 5: if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -6713,7 +8902,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 6: if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -6747,7 +8936,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6756,14 +8945,14 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din case 7: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 145; + grammarID = 193; break; case 8: done = 1; - grammarID = 4; + grammarID = 11; break; case 9: - grammarID = 145; + grammarID = 193; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6771,7 +8960,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } } break; - case 146: + case 194: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -6808,7 +8997,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6820,7 +9009,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 2: if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -6828,7 +9017,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 3: if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { @@ -6836,7 +9025,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 4: if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { @@ -6844,7 +9033,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 5: if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -6852,7 +9041,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 145; + grammarID = 193; break; case 6: if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -6886,7 +9075,7 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 145; + grammarID = 193; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6895,10 +9084,93 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din case 7: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 145; + grammarID = 193; break; case 8: - grammarID = 146; + grammarID = 194; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { + int grammarID = 195; + int done = 0; + + init_dinServicePaymentSelectionReqType(dinServicePaymentSelectionReqType); + + while(!done) { + switch(grammarID) { + case 195: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinServicePaymentSelectionReqType->SelectedPaymentOption = (dinpaymentOptionType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 196; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 196: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6919,14 +9191,14 @@ static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* din /* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType) { - int grammarID = 147; + int grammarID = 197; int done = 0; init_dinContractAuthenticationResType(dinContractAuthenticationResType); while(!done) { switch(grammarID) { - case 147: + case 197: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6947,7 +9219,7 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 59; + grammarID = 31; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6959,7 +9231,7 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d } } break; - case 59: + case 31: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6980,7 +9252,7 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6992,14 +9264,14 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7018,2633 +9290,23 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ -static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { - int grammarID = 148; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { + int grammarID = 44; int done = 0; - init_dinServiceChargeType(dinServiceChargeType); + init_dinChargingStatusReqType(dinChargingStatusReqType); while(!done) { switch(grammarID) { - case 148: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag); - grammarID = 149; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 149: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinServiceChargeType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 150; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 150: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinServiceChargeType->EnergyTransferType = (dinEVSESupportedEnergyTransferType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { - int grammarID = 151; - int done = 0; - - init_dinServiceParameterListType(dinServiceParameterListType); - - while(!done) { - switch(grammarID) { - case 151: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 152; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 152: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 152; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { - int grammarID = 153; - int done = 0; - - init_dinSignatureType(dinSignatureType); - - while(!done) { - switch(grammarID) { - case 153: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinSignatureType->Id_isUsed = 1u; - grammarID = 154; - break; - case 1: - errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); - grammarID = 155; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 154: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); - grammarID = 155; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 155: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue); - grammarID = 156; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 156: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo); - dinSignatureType->KeyInfo_isUsed = 1u; - grammarID = 157; - break; - case 1: - if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { - errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 157; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 157: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { - errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 157; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { - int grammarID = 158; - int done = 0; - - init_dinMeteringReceiptResType(dinMeteringReceiptResType); - - while(!done) { - switch(grammarID) { - case 158: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinMeteringReceiptResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 159; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { - int grammarID = 160; - int done = 0; - - init_dinX509DataType(dinX509DataType); - - while(!done) { - switch(grammarID) { - case 160: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 161; - break; - case 1: - if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); - } - dinX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); - } - dinX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); - } - dinX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 5: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 161; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 161: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 161; - break; - case 1: - if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); - } - dinX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); - } - dinX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); - } - dinX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 161; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 5: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 161; - break; - case 6: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) { - int grammarID = 162; - int done = 0; - - init_dinReferenceType(dinReferenceType); - - while(!done) { - switch(grammarID) { - case 162: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinReferenceType->Id_isUsed = 1u; - grammarID = 163; - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinReferenceType->Type_isUsed = 1u; - grammarID = 164; - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinReferenceType->URI_isUsed = 1u; - grammarID = 165; - break; - case 3: - errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); - dinReferenceType->Transforms_isUsed = 1u; - grammarID = 166; - break; - case 4: - errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 167; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 163: - /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinReferenceType->Type_isUsed = 1u; - grammarID = 164; - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinReferenceType->URI_isUsed = 1u; - grammarID = 165; - break; - case 2: - errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); - dinReferenceType->Transforms_isUsed = 1u; - grammarID = 166; - break; - case 3: - errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 167; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 164: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinReferenceType->URI_isUsed = 1u; - grammarID = 165; - break; - case 1: - errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); - dinReferenceType->Transforms_isUsed = 1u; - grammarID = 166; - break; - case 2: - errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 167; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 165: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); - dinReferenceType->Transforms_isUsed = 1u; - grammarID = 166; - break; - case 1: - errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 167; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 166: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 167; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 167: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinReferenceType->DigestValue.bytesLen); - if (errn == 0) { - errn = (dinReferenceType->DigestValue.bytesLen) <= dinReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinReferenceType->DigestValue.bytesLen, dinReferenceType->DigestValue.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) { - int grammarID = 168; - int done = 0; - - init_dinPhysicalValueType(dinPhysicalValueType); - - while(!done) { - switch(grammarID) { - case 168: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); - dinPhysicalValueType->Multiplier = (int8_t)(uint32 -3); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 169; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 169: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinPhysicalValueType->Unit = (dinunitSymbolType) uint32; - dinPhysicalValueType->Unit_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 170; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinPhysicalValueType->Value); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 170: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinPhysicalValueType->Value); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { - int grammarID = 171; - int done = 0; - - init_dinRelativeTimeIntervalType(dinRelativeTimeIntervalType); - - while(!done) { - switch(grammarID) { - case 171: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->start); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 172; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 172: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->duration); - dinRelativeTimeIntervalType->duration_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { - int grammarID = 173; - int done = 0; - - init_dinSalesTariffType(dinSalesTariffType); - - while(!done) { - switch(grammarID) { - case 173: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 174; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 174: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinSalesTariffType->SalesTariffID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 175; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 175: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinSalesTariffType->SalesTariffDescription_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 176; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 177; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 176: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 177; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 178; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 178: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 178; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { - int grammarID = 179; - int done = 0; - - init_dinSignatureValueType(dinSignatureValueType); - - while(!done) { - switch(grammarID) { - case 179: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinSignatureValueType->Id_isUsed = 1u; - grammarID = 180; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); - } - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 180: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); - } - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { - int grammarID = 9; - int done = 0; - - init_dinEVStatusType(dinEVStatusType); - - while(!done) { - switch(grammarID) { - case 9: + case 44: /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { - int grammarID = 181; - int done = 0; - - init_dinChargingStatusResType(dinChargingStatusResType); - - while(!done) { - switch(grammarID) { - case 181: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinChargingStatusResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 182; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 182: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinChargingStatusResType->EVSEID.bytesLen); - if (errn == 0) { - errn = (dinChargingStatusResType->EVSEID.bytesLen) <= dinChargingStatusResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinChargingStatusResType->EVSEID.bytesLen, dinChargingStatusResType->EVSEID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 183; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 183: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinChargingStatusResType->SAScheduleTupleID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 184; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 184: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent); - dinChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; - grammarID = 185; - break; - case 1: - errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); - dinChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 186; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 159; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 185: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); - dinChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 186; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 159; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 186: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 159; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) { - int grammarID = 187; - int done = 0; - - init_dinManifestType(dinManifestType); - - while(!done) { - switch(grammarID) { - case 187: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinManifestType->Id_isUsed = 1u; - grammarID = 188; - break; - case 1: - if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 117; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 188: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 117; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 117: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 117; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { - int grammarID = 9; - int done = 0; - - init_dinSASchedulesType(dinSASchedulesType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { - int grammarID = 189; - int done = 0; - - init_dinPMaxScheduleEntryType(dinPMaxScheduleEntryType); - - while(!done) { - switch(grammarID) { - case 189: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval); - dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 190; - break; - case 1: - errn = decode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval); - dinPMaxScheduleEntryType->TimeInterval_isUsed = 1u; - grammarID = 190; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 190: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinPMaxScheduleEntryType->PMax); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { - int grammarID = 191; - int done = 0; - - init_dinDC_EVSEStatusType(dinDC_EVSEStatusType); - - while(!done) { - switch(grammarID) { - case 191: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinDC_EVSEStatusType->EVSEIsolationStatus = (dinisolationLevelType) uint32; - dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 192; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 82; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 192: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 82; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinDC_EVSEStatusType->NotificationMaxDelay); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 83; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinDC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { - int grammarID = 193; - int done = 0; - - init_dinPreChargeReqType(dinPreChargeReqType); - - while(!done) { - switch(grammarID) { - case 193: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus); - grammarID = 194; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 194: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage); - grammarID = 195; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 195: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType) { - int grammarID = 196; - int done = 0; - - init_dinTransformsType(dinTransformsType); - - while(!done) { - switch(grammarID) { - case 196: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { - errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 197; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 197: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { - errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 197; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ -static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { - int grammarID = 198; - int done = 0; - - init_dinParameterType(dinParameterType); - - while(!done) { - switch(grammarID) { - case 198: - /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 199; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 199: - /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - dinParameterType->ValueType = (dinvalueType) uint32; - grammarID = 200; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 200: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinParameterType->boolValue); - dinParameterType->boolValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - dinParameterType->byteValue = (int8_t)(uint32 -128); - dinParameterType->byteValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinParameterType->shortValue); - dinParameterType->shortValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger32(stream, &dinParameterType->intValue); - dinParameterType->intValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - errn = decode_dinPhysicalValueType(stream, &dinParameterType->physicalValue); - dinParameterType->physicalValue_isUsed = 1u; - grammarID = 3; - break; - case 5: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinParameterType->stringValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9665,14 +9327,14 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* /* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType) { - int grammarID = 201; + int grammarID = 198; int done = 0; init_dinPaymentDetailsResType(dinPaymentDetailsResType); while(!done) { switch(grammarID) { - case 201: + case 198: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9693,7 +9355,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 202; + grammarID = 199; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9705,7 +9367,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen } } break; - case 202: + case 199: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9737,7 +9399,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 203; + grammarID = 200; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9749,7 +9411,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen } } break; - case 203: + case 200: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9769,7 +9431,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9781,14 +9443,14 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9807,82 +9469,23 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { - int grammarID = 204; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { + int grammarID = 44; int done = 0; - init_dinPowerDeliveryResType(dinPowerDeliveryResType); + init_dinSASchedulesType(dinSASchedulesType); while(!done) { switch(grammarID) { - case 204: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinPowerDeliveryResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 205; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 205: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus); - dinPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus); - dinPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus); - dinPowerDeliveryResType->EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ + case 44: + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9901,31 +9504,37 @@ static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDe return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { - int grammarID = 206; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { + int grammarID = 201; int done = 0; - init_dinCertificateChainType(dinCertificateChainType); + init_dinPaymentDetailsReqType(dinPaymentDetailsReqType); while(!done) { switch(grammarID) { - case 206: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ + case 201: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + /* FirstStartTag[CHARACTERS[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateChainType->Certificate.bytesLen); + errn = decodeUnsignedInteger16(stream, &dinPaymentDetailsReqType->ContractID.charactersLen); if (errn == 0) { - errn = (dinCertificateChainType->Certificate.bytesLen) <= dinCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + errn = (dinPaymentDetailsReqType->ContractID.charactersLen - 2) <= dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - errn = decodeBytes(stream, dinCertificateChainType->Certificate.bytesLen, dinCertificateChainType->Certificate.bytes); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -9933,10 +9542,10 @@ static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertifi } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 207; + grammarID = 202; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9948,19 +9557,14 @@ static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertifi } } break; - case 207: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 202: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates); - dinCertificateChainType->SubCertificates_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; + errn = decode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain); + grammarID = 10; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9968,383 +9572,14 @@ static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertifi } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { - int grammarID = 208; - int done = 0; - - init_dinDC_EVStatusType(dinDC_EVStatusType); - - while(!done) { - switch(grammarID) { - case 208: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVReady); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 209; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 209: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVCabinConditioning); - dinDC_EVStatusType->EVCabinConditioning_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 210; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); - dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 211; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 212; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 210: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); - dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 211; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 212; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 211: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 212; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 212: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { - int grammarID = 213; - int done = 0; - - init_dinSelectedServiceType(dinSelectedServiceType); - - while(!done) { - switch(grammarID) { - case 213: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSelectedServiceType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 214; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinSelectedServiceType->ParameterSetID); - dinSelectedServiceType->ParameterSetID_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10365,14 +9600,14 @@ static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelected /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) { - int grammarID = 215; + int grammarID = 203; int done = 0; init_dinServiceTagType(dinServiceTagType); while(!done) { switch(grammarID) { - case 215: + case 203: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -10392,7 +9627,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 216; + grammarID = 204; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10404,7 +9639,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp } } break; - case 216: + case 204: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -10437,7 +9672,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 217; + grammarID = 205; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10459,7 +9694,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 218; + grammarID = 206; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10471,7 +9706,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp } } break; - case 217: + case 205: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -10492,7 +9727,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 218; + grammarID = 206; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10504,7 +9739,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp } } break; - case 218: + case 206: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -10537,7 +9772,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10545,7 +9780,7 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10553,14 +9788,14 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10579,74 +9814,67 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { - int grammarID = 219; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { + int grammarID = 207; int done = 0; - init_dinContractAuthenticationReqType(dinContractAuthenticationReqType); + init_dinChargeParameterDiscoveryReqType(dinChargeParameterDiscoveryReqType); while(!done) { switch(grammarID) { - case 219: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 207: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinContractAuthenticationReqType->Id_isUsed = 1u; - grammarID = 220; - break; - case 1: - /* FirstStartTag[CHARACTERS[STRING]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType = (dinEVRequestedEnergyTransferType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 208; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 208: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter); + dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; + grammarID = 10; + break; + case 1: + errn = decode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter); + dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; + grammarID = 10; + break; case 2: - done = 1; - grammarID = 4; + errn = decode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter); + dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; + grammarID = 10; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10654,63 +9882,14 @@ static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct d } } break; - case 220: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10729,23 +9908,27 @@ static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { - int grammarID = 221; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { + int grammarID = 209; int done = 0; - init_dinDC_EVPowerDeliveryParameterType(dinDC_EVPowerDeliveryParameterType); + init_dinServiceParameterListType(dinServiceParameterListType); while(!done) { switch(grammarID) { - case 221: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + case 209: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus); - grammarID = 222; + if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 210; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10753,53 +9936,22 @@ static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct } } break; - case 222: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ + case 210: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->BulkChargingComplete); - dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 223; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } + if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } + grammarID = 210; break; case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + done = 1; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10807,46 +9959,34 @@ static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct } } break; - case 223: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; - case 3: - /* Element[END_ELEMENT] */ + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { + int grammarID = 44; + int done = 0; + + init_dinEVSEStatusType(dinEVSEStatusType); + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10867,14 +10007,14 @@ static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct /* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { - int grammarID = 224; + int grammarID = 211; int done = 0; init_dinServiceDiscoveryReqType(dinServiceDiscoveryReqType); while(!done) { switch(grammarID) { - case 224: + case 211: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -10907,7 +10047,7 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 225; + grammarID = 212; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10930,7 +10070,7 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10938,7 +10078,7 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ break; case 2: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10946,7 +10086,7 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ } } break; - case 225: + case 212: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -10968,7 +10108,7 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10976,7 +10116,7 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10984,111 +10124,14 @@ static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServ } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { - int grammarID = 9; - int done = 0; - - init_dinSessionStopType(dinSessionStopType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType) { - int grammarID = 226; - int done = 0; - - init_dinServiceTagListType(dinServiceTagListType); - - while(!done) { - switch(grammarID) { - case 226: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { - errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 227; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 227: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { - errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 227; - break; - case 1: - done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11109,14 +10152,14 @@ static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTa /* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) { - int grammarID = 0; + int grammarID = 69; int done = 0; init_dinWeldingDetectionResType(dinWeldingDetectionResType); while(!done) { switch(grammarID) { - case 0: + case 69: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -11137,7 +10180,7 @@ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeld /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 1; + grammarID = 70; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11149,14 +10192,14 @@ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeld } } break; - case 1: + case 70: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus); - grammarID = 2; + grammarID = 71; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11164,14 +10207,14 @@ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeld } } break; - case 2: + case 71: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage); - grammarID = 3; + grammarID = 10; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11179,2113 +10222,14 @@ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeld } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ -static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { - int grammarID = 228; - int done = 0; - - init_dinAnonType_V2G_Message(dinAnonType_V2G_Message); - - while(!done) { - switch(grammarID) { - case 228: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header); - grammarID = 229; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinBodyType(stream, &dinAnonType_V2G_Message->Body); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { - int grammarID = 230; - int done = 0; - - init_dinDC_EVSEChargeParameterType(dinDC_EVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 230: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus); - grammarID = 231; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 231: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); - grammarID = 232; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 232: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); - dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 233; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); - grammarID = 234; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 233: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); - grammarID = 234; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 234: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); - grammarID = 235; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 235: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); - grammarID = 236; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); - dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; - grammarID = 237; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 238; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 237: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 238; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 238: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); - dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ -static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { - int grammarID = 239; - int done = 0; - - init_dinSalesTariffEntryType(dinSalesTariffEntryType); - - while(!done) { - switch(grammarID) { - case 239: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval); - dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 240; - break; - case 1: - errn = decode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval); - dinSalesTariffEntryType->TimeInterval_isUsed = 1u; - grammarID = 240; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 240: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - dinSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 241; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 241: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSalesTariffEntryType->ConsumptionCost.arrayLen < dinSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array[dinSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 241; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { - int grammarID = 9; - int done = 0; - - init_dinEVChargeParameterType(dinEVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { - int grammarID = 242; - int done = 0; - - init_dinPaymentDetailsReqType(dinPaymentDetailsReqType); - - while(!done) { - switch(grammarID) { - case 242: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 243; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 243: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { - int grammarID = 244; - int done = 0; - - init_dinSessionSetupReqType(dinSessionSetupReqType); - - while(!done) { - switch(grammarID) { - case 244: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSessionSetupReqType->EVCCID.bytesLen); - if (errn == 0) { - errn = (dinSessionSetupReqType->EVCCID.bytesLen) <= dinSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSessionSetupReqType->EVCCID.bytesLen, dinSessionSetupReqType->EVCCID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { - int grammarID = 9; - int done = 0; - - init_dinChargingStatusReqType(dinChargingStatusReqType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { - int grammarID = 245; - int done = 0; - - init_dinSignaturePropertyType(dinSignaturePropertyType); - - while(!done) { - switch(grammarID) { - case 245: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinSignaturePropertyType->Id_isUsed = 1u; - grammarID = 246; - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 247; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 246: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 247; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 247: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - grammarID = 248; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 248: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - grammarID = 248; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ -static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { - int grammarID = 249; - int done = 0; - - init_dinCertificateUpdateResType(dinCertificateUpdateResType); - - while(!done) { - switch(grammarID) { - case 249: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 250; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 250: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCertificateUpdateResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 251; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 251: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain); - grammarID = 252; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 252: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); - if (errn == 0) { - errn = (dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 253; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 253: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->DHParams.bytesLen); - if (errn == 0) { - errn = (dinCertificateUpdateResType->DHParams.bytesLen) <= dinCertificateUpdateResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateUpdateResType->DHParams.bytesLen, dinCertificateUpdateResType->DHParams.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 254; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 254: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 255; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 255: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinCertificateUpdateResType->RetryCounter); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { - int grammarID = 256; - int done = 0; - - init_dinServiceDetailResType(dinServiceDetailResType); - - while(!done) { - switch(grammarID) { - case 256: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinServiceDetailResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 257; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 257: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinServiceDetailResType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 258; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 258: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList); - dinServiceDetailResType->ServiceParameterList_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType) { - int grammarID = 259; - int done = 0; - - init_dinDSAKeyValueType(dinDSAKeyValueType); - - while(!done) { - switch(grammarID) { - case 259: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->P.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->P.bytesLen) <= dinDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->P.bytesLen, dinDSAKeyValueType->P.bytes); - } - dinDSAKeyValueType->P_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 260; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes); - } - dinDSAKeyValueType->G_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 261; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 262; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 260: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Q.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->Q.bytesLen) <= dinDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->Q.bytesLen, dinDSAKeyValueType->Q.bytes); - } - dinDSAKeyValueType->Q_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 263; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 263: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes); - } - dinDSAKeyValueType->G_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 261; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 262; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 261: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 262; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 262: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->J.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->J.bytesLen) <= dinDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->J.bytesLen, dinDSAKeyValueType->J.bytes); - } - dinDSAKeyValueType->J_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 264; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes); - } - dinDSAKeyValueType->Seed_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 265; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 264: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes); - } - dinDSAKeyValueType->Seed_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 265; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 265: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->PgenCounter.bytesLen); - if (errn == 0) { - errn = (dinDSAKeyValueType->PgenCounter.bytesLen) <= dinDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinDSAKeyValueType->PgenCounter.bytesLen, dinDSAKeyValueType->PgenCounter.bytes); - } - dinDSAKeyValueType->PgenCounter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ -static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { - int grammarID = 266; - int done = 0; - - init_dinAC_EVSEChargeParameterType(dinAC_EVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 266: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus); - grammarID = 267; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 267: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage); - grammarID = 268; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 268: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent); - grammarID = 269; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 269: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { - int grammarID = 270; - int done = 0; - - init_dinObjectType(dinObjectType); - - while(!done) { - switch(grammarID) { - case 270: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->Encoding_isUsed = 1u; - grammarID = 271; - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->Id_isUsed = 1u; - grammarID = 272; - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->MimeType_isUsed = 1u; - grammarID = 139; - break; - case 3: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 4: - done = 1; - grammarID = 4; - break; - case 5: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 271: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->Id_isUsed = 1u; - grammarID = 272; - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->MimeType_isUsed = 1u; - grammarID = 139; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 3: - done = 1; - grammarID = 4; - break; - case 4: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 272: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->MimeType_isUsed = 1u; - grammarID = 139; - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 139: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { - int grammarID = 273; - int done = 0; - - init_dinKeyValueType(dinKeyValueType); - - while(!done) { - switch(grammarID) { - case 273: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); - dinKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 274; - break; - case 1: - errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); - dinKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 274; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 274; - break; - case 3: - grammarID = 275; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 274: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - case 1: - grammarID = 274; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 275: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); - dinKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 274; - break; - case 1: - errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); - dinKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 274; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 274; - break; - case 3: - grammarID = 275; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { - int grammarID = 9; - int done = 0; - - init_dinEVPowerDeliveryParameterType(dinEVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) { - int grammarID = 138; - int done = 0; - - init_dinDigestMethodType(dinDigestMethodType); - - while(!done) { - switch(grammarID) { - case 138: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 139; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 139: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 45; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 45; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13306,14 +10250,14 @@ static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMetho /* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { - int grammarID = 276; + int grammarID = 213; int done = 0; init_dinCertificateUpdateReqType(dinCertificateUpdateReqType); while(!done) { switch(grammarID) { - case 276: + case 213: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -13333,11 +10277,11 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer } } dinCertificateUpdateReqType->Id_isUsed = 1u; - grammarID = 277; + grammarID = 214; break; case 1: errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain); - grammarID = 278; + grammarID = 215; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13345,14 +10289,14 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer } } break; - case 277: + case 214: /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain); - grammarID = 278; + grammarID = 215; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13360,7 +10304,7 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer } } break; - case 278: + case 215: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13392,7 +10336,7 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 41; + grammarID = 132; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13404,14 +10348,14 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer } } break; - case 41: + case 132: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs); - grammarID = 42; + grammarID = 133; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13419,7 +10363,7 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer } } break; - case 42: + case 133: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13445,7 +10389,7 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 10; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13457,14 +10401,14 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer } } break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13483,59 +10427,222 @@ static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { - int grammarID = 279; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType) { + int grammarID = 216; int done = 0; - init_dinMeteringReceiptReqType(dinMeteringReceiptReqType); + init_dinServiceTagListType(dinServiceTagListType); while(!done) { switch(grammarID) { - case 279: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + case 216: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { + errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 217; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->Id.charactersLen); + if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { + errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 217; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { + int grammarID = 218; + int done = 0; + + init_dinSignedInfoType(dinSignedInfoType); + + while(!done) { + switch(grammarID) { + case 218: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignedInfoType->Id.charactersLen); if (errn == 0) { - errn = (dinMeteringReceiptReqType->Id.charactersLen - 2) <= dinMeteringReceiptReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinSignedInfoType->Id.charactersLen - 2) <= dinSignedInfoType_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); + 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); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - dinMeteringReceiptReqType->Id_isUsed = 1u; - grammarID = 280; + dinSignedInfoType->Id_isUsed = 1u; + grammarID = 219; break; case 1: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); + grammarID = 220; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 219: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); + grammarID = 220; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 220: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod); + grammarID = 221; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 221: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 38; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 38: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 38; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { + int grammarID = 222; + int done = 0; + + init_dinPowerDeliveryReqType(dinPowerDeliveryReqType); + + while(!done) { + switch(grammarID) { + case 222: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); - if (errn == 0) { - errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); - } + errn = decodeBoolean(stream, &dinPowerDeliveryReqType->ReadyToChargeState); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 281; + grammarID = 223; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13547,8 +10654,682 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter } } break; - case 280: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile); + dinPowerDeliveryReqType->ChargingProfile_isUsed = 1u; + grammarID = 224; + break; + case 1: + errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 10; + break; + case 2: + errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); + dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 10; + break; + case 3: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 224: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 10; + break; + case 1: + errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); + dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 10; + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType) { + int grammarID = 225; + int done = 0; + + init_dinCostType(dinCostType); + + while(!done) { + switch(grammarID) { + case 225: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinCostType->costKind = (dincostKindType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 226; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 226: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinCostType->amount); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 227; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 227: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + dinCostType->amountMultiplier = (int8_t)(uint32 -3); + dinCostType->amountMultiplier_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { + int grammarID = 228; + int done = 0; + + init_dinDC_EVChargeParameterType(dinDC_EVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 228: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus); + grammarID = 229; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 229: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit); + grammarID = 230; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 230: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit); + dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 231; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 232; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 232; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 232: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity); + dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; + grammarID = 233; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); + dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 234; + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 235; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 233: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); + dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 234; + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 235; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 234: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 235; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 235: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { + int grammarID = 236; + int done = 0; + + init_dinSubCertificatesType(dinSubCertificatesType); + + while(!done) { + switch(grammarID) { + case 236: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); + } + dinSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 237; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 237: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); + } + dinSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 237; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { + int grammarID = 238; + int done = 0; + + init_dinSessionSetupReqType(dinSessionSetupReqType); + + while(!done) { + switch(grammarID) { + case 238: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -13557,12 +11338,12 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); + errn = decodeUnsignedInteger16(stream, &dinSessionSetupReqType->EVCCID.bytesLen); if (errn == 0) { - errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + errn = (dinSessionSetupReqType->EVCCID.bytesLen) <= dinSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } if (errn == 0) { - errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); + errn = decodeBytes(stream, dinSessionSetupReqType->EVCCID.bytesLen, dinSessionSetupReqType->EVCCID.bytes); } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -13570,7 +11351,2114 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ +static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { + int grammarID = 239; + int done = 0; + + init_dinAnonType_V2G_Message(dinAnonType_V2G_Message); + + while(!done) { + switch(grammarID) { + case 239: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header); + grammarID = 240; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 240: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinBodyType(stream, &dinAnonType_V2G_Message->Body); + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { + int grammarID = 241; + int done = 0; + + init_dinMeterInfoType(dinMeterInfoType); + + while(!done) { + switch(grammarID) { + case 241: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 242; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 242: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading); + dinMeterInfoType->MeterReading_isUsed = 1u; + grammarID = 243; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); + } + dinMeterInfoType->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 244; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); + dinMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 245; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 243: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); + } + dinMeterInfoType->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 244; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); + dinMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 245; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 244: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); + dinMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 245; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 245: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ +static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { + int grammarID = 246; + int done = 0; + + init_dinCertificateInstallationResType(dinCertificateInstallationResType); + + while(!done) { + switch(grammarID) { + case 246: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 247; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 247: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinCertificateInstallationResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 248; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 248: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain); + grammarID = 249; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 249: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 250; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 250: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->DHParams.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationResType->DHParams.bytesLen) <= dinCertificateInstallationResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationResType->DHParams.bytesLen, dinCertificateInstallationResType->DHParams.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 251; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 251: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { + int grammarID = 252; + int done = 0; + + init_dinServiceDetailResType(dinServiceDetailResType); + + while(!done) { + switch(grammarID) { + case 252: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinServiceDetailResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 253; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 253: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinServiceDetailResType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 254; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 254: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList); + dinServiceDetailResType->ServiceParameterList_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { + int grammarID = 255; + int done = 0; + + init_dinX509IssuerSerialType(dinX509IssuerSerialType); + + while(!done) { + switch(grammarID) { + case 255: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 256; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 256: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinX509IssuerSerialType->X509SerialNumber); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { + int grammarID = 257; + int done = 0; + + init_dinDC_EVSEChargeParameterType(dinDC_EVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 257: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus); + grammarID = 258; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 258: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); + grammarID = 259; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 259: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); + dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 260; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); + grammarID = 261; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 260: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); + grammarID = 261; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 261: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); + grammarID = 262; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 262: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); + grammarID = 263; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 263: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); + dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; + grammarID = 264; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 265; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 264: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 265; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 265: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); + dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; + grammarID = 10; + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { + int grammarID = 44; + int done = 0; + + init_dinEVStatusType(dinEVStatusType); + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { + int grammarID = 266; + int done = 0; + + init_dinX509DataType(dinX509DataType); + + while(!done) { + switch(grammarID) { + case 266: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 267; + break; + case 1: + if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); + } + dinX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); + } + dinX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); + } + dinX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 267; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 267: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 267; + break; + case 1: + if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); + } + dinX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); + } + dinX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); + } + dinX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 267; + break; + case 6: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { + int grammarID = 268; + int done = 0; + + init_dinPowerDeliveryResType(dinPowerDeliveryResType); + + while(!done) { + switch(grammarID) { + case 268: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinPowerDeliveryResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 269; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 269: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus); + dinPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; + grammarID = 10; + break; + case 1: + errn = decode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus); + dinPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; + grammarID = 10; + break; + case 2: + errn = decode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus); + dinPowerDeliveryResType->EVSEStatus_isUsed = 1u; + grammarID = 10; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType) { + int grammarID = 270; + int done = 0; + + init_dinDSAKeyValueType(dinDSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 270: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->P.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->P.bytesLen) <= dinDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->P.bytesLen, dinDSAKeyValueType->P.bytes); + } + dinDSAKeyValueType->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 271; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes); + } + dinDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 272; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 273; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 271: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Q.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Q.bytesLen) <= dinDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Q.bytesLen, dinDSAKeyValueType->Q.bytes); + } + dinDSAKeyValueType->Q_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 274; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 274: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes); + } + dinDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 272; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 273; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 272: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 273; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 273: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->J.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->J.bytesLen) <= dinDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->J.bytesLen, dinDSAKeyValueType->J.bytes); + } + dinDSAKeyValueType->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 275; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes); + } + dinDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 276; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 275: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes); + } + dinDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 276; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 276: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->PgenCounter.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->PgenCounter.bytesLen) <= dinDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->PgenCounter.bytesLen, dinDSAKeyValueType->PgenCounter.bytes); + } + dinDSAKeyValueType->PgenCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ +static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { + int grammarID = 277; + int done = 0; + + init_dinCertificateUpdateResType(dinCertificateUpdateResType); + + while(!done) { + switch(grammarID) { + case 277: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 278; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 278: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinCertificateUpdateResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 279; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 279: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain); + grammarID = 280; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 280: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); + if (errn == 0) { + errn = (dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 281; @@ -13586,24 +13474,29 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter } break; case 281: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeteringReceiptReqType->SAScheduleTupleID); - dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 1u; + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->DHParams.bytesLen); + if (errn == 0) { + errn = (dinCertificateUpdateResType->DHParams.bytesLen) <= dinCertificateUpdateResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateUpdateResType->DHParams.bytesLen, dinCertificateUpdateResType->DHParams.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 282; @@ -13612,10 +13505,6 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter } } break; - case 1: - errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); - grammarID = 3; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -13623,13 +13512,42 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter } break; case 282: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); - grammarID = 3; + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 283; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13637,14 +13555,46 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter } } break; - case 3: + case 283: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinCertificateUpdateResType->RetryCounter); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13663,40 +13613,23 @@ static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { - int grammarID = 283; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { + int grammarID = 44; int done = 0; - init_dinConsumptionCostType(dinConsumptionCostType); + init_dinSessionStopType(dinSessionStopType); while(!done) { switch(grammarID) { - case 283: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ + case 44: + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinConsumptionCostType->startValue); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 284; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + done = 1; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13704,22 +13637,75 @@ static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumpt } } break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { + int grammarID = 44; + int done = 0; + + init_dinEVSEChargeParameterType(dinEVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { + int grammarID = 284; + int done = 0; + + init_dinEntryType(dinEntryType); + + while(!done) { + switch(grammarID) { case 284: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinConsumptionCostType->Cost.arrayLen < dinConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_dinCostType(stream, &dinConsumptionCostType->Cost.array[dinConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 284; + errn = decode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval); + dinEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 10; break; case 1: - done = 1; - grammarID = 4; + errn = decode_dinIntervalType(stream, &dinEntryType->TimeInterval); + dinEntryType->TimeInterval_isUsed = 1u; + grammarID = 10; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13727,67 +13713,14 @@ static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumpt } } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType) { - int grammarID = 50; - int done = 0; - - init_dinSessionStopResType(dinSessionStopResType); - - while(!done) { - switch(grammarID) { - case 50: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinSessionStopResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13806,44 +13739,57 @@ static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionSt return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) { +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { int grammarID = 285; int done = 0; - init_dinSignaturePropertiesType(dinSignaturePropertiesType); + init_dinListOfRootCertificateIDsType(dinListOfRootCertificateIDsType); while(!done) { switch(grammarID) { case 285: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } } - } - dinSignaturePropertiesType->Id_isUsed = 1u; - grammarID = 286; - break; - case 1: - if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 287; + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 286; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13852,40 +13798,51 @@ static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign } break; case 286: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 287; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 287: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); + if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 287; + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 286; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 1: done = 1; - grammarID = 4; + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13904,42 +13861,104 @@ static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) { - int grammarID = 288; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { + int grammarID = 287; int done = 0; - init_dinNotificationType(dinNotificationType); + init_dinSignatureMethodType(dinSignatureMethodType); while(!done) { switch(grammarID) { - case 288: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ + case 287: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 288; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 288: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinNotificationType->FaultCode = (dinfaultCodeType) uint32; + errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); + dinSignatureMethodType->HMACOutputLength_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 289; + grammarID = 14; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 2: + done = 1; + grammarID = 11; + break; + case 3: + grammarID = 289; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; + break; + case 1: + done = 1; + grammarID = 11; + break; + case 2: + grammarID = 14; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -13947,62 +13966,43 @@ static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificatio } break; case 289: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); 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); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinNotificationType->FaultMsg_isUsed = 1u; + errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); + dinSignatureMethodType->HMACOutputLength_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 14; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; case 1: - done = 1; - grammarID = 4; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 14; break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: + case 2: done = 1; - grammarID = 4; + grammarID = 11; + break; + case 3: + grammarID = 289; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14505,6 +14505,2158 @@ int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { return errn; } + +#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES +int decode_dinExiFragment(bitstream_t* stream, struct dinEXIFragment* exiFrag) { + errn = readEXIHeader(stream); + + if(errn == 0) { + /* FragmentContent[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier), START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID), START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue), START_ELEMENT_GENERIC, END_DOCUMENT] */ + init_dinEXIFragment(exiFrag); + errn = decodeNBitUnsignedInteger(stream, 8, &eventCode); + if(errn == 0) { + switch(eventCode) { + case 0: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter) */ + errn = decode_dinAC_EVChargeParameterType(stream, &exiFrag->AC_EVChargeParameter); + exiFrag->AC_EVChargeParameter_isUsed = 1u; + break; + case 1: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter) */ + errn = decode_dinAC_EVSEChargeParameterType(stream, &exiFrag->AC_EVSEChargeParameter); + exiFrag->AC_EVSEChargeParameter_isUsed = 1u; + break; + case 2: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + break; + case 3: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + break; + case 4: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body) */ + errn = decode_dinBodyType(stream, &exiFrag->Body); + exiFrag->Body_isUsed = 1u; + break; + case 5: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement) */ + errn = decode_dinBodyBaseType(stream, &exiFrag->BodyElement); + exiFrag->BodyElement_isUsed = 1u; + break; + case 6: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + break; + case 7: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + break; + case 8: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + exiFrag->BulkSOC = (int8_t)(uint32 + 0); + exiFrag->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 9: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq) */ + errn = decode_dinCableCheckReqType(stream, &exiFrag->CableCheckReq); + exiFrag->CableCheckReq_isUsed = 1u; + break; + case 10: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes) */ + errn = decode_dinCableCheckResType(stream, &exiFrag->CableCheckRes); + exiFrag->CableCheckRes_isUsed = 1u; + break; + case 11: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = decode_dinCanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod); + exiFrag->CanonicalizationMethod_isUsed = 1u; + break; + case 12: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name Certificate */ + break; + case 13: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq) */ + errn = decode_dinCertificateInstallationReqType(stream, &exiFrag->CertificateInstallationReq); + exiFrag->CertificateInstallationReq_isUsed = 1u; + break; + case 14: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes) */ + errn = decode_dinCertificateInstallationResType(stream, &exiFrag->CertificateInstallationRes); + exiFrag->CertificateInstallationRes_isUsed = 1u; + break; + case 15: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq) */ + errn = decode_dinCertificateUpdateReqType(stream, &exiFrag->CertificateUpdateReq); + exiFrag->CertificateUpdateReq_isUsed = 1u; + break; + case 16: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes) */ + errn = decode_dinCertificateUpdateResType(stream, &exiFrag->CertificateUpdateRes); + exiFrag->CertificateUpdateRes_isUsed = 1u; + break; + case 17: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq) */ + errn = decode_dinChargeParameterDiscoveryReqType(stream, &exiFrag->ChargeParameterDiscoveryReq); + exiFrag->ChargeParameterDiscoveryReq_isUsed = 1u; + break; + case 18: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes) */ + errn = decode_dinChargeParameterDiscoveryResType(stream, &exiFrag->ChargeParameterDiscoveryRes); + exiFrag->ChargeParameterDiscoveryRes_isUsed = 1u; + break; + case 19: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService) */ + errn = decode_dinServiceChargeType(stream, &exiFrag->ChargeService); + exiFrag->ChargeService_isUsed = 1u; + break; + case 20: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + break; + case 21: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + break; + case 22: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile) */ + errn = decode_dinChargingProfileType(stream, &exiFrag->ChargingProfile); + exiFrag->ChargingProfile_isUsed = 1u; + break; + case 23: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->ChargingProfileEntryMaxPower); + exiFrag->ChargingProfileEntryMaxPower_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 24: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->ChargingProfileEntryStart); + exiFrag->ChargingProfileEntryStart_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 25: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq) */ + errn = decode_dinChargingStatusReqType(stream, &exiFrag->ChargingStatusReq); + exiFrag->ChargingStatusReq_isUsed = 1u; + break; + case 26: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes) */ + errn = decode_dinChargingStatusResType(stream, &exiFrag->ChargingStatusRes); + exiFrag->ChargingStatusRes_isUsed = 1u; + break; + case 27: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost) */ + errn = decode_dinConsumptionCostType(stream, &exiFrag->ConsumptionCost); + exiFrag->ConsumptionCost_isUsed = 1u; + break; + case 28: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq) */ + errn = decode_dinContractAuthenticationReqType(stream, &exiFrag->ContractAuthenticationReq); + exiFrag->ContractAuthenticationReq_isUsed = 1u; + break; + case 29: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes) */ + errn = decode_dinContractAuthenticationResType(stream, &exiFrag->ContractAuthenticationRes); + exiFrag->ContractAuthenticationRes_isUsed = 1u; + break; + case 30: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractID */ + break; + case 31: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureCertChain */ + break; + case 32: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureEncryptedPrivateKey */ + break; + case 33: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost) */ + errn = decode_dinCostType(stream, &exiFrag->Cost); + exiFrag->Cost_isUsed = 1u; + break; + case 34: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq) */ + errn = decode_dinCurrentDemandReqType(stream, &exiFrag->CurrentDemandReq); + exiFrag->CurrentDemandReq_isUsed = 1u; + break; + case 35: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes) */ + errn = decode_dinCurrentDemandResType(stream, &exiFrag->CurrentDemandRes); + exiFrag->CurrentDemandRes_isUsed = 1u; + break; + case 36: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter) */ + errn = decode_dinDC_EVChargeParameterType(stream, &exiFrag->DC_EVChargeParameter); + exiFrag->DC_EVChargeParameter_isUsed = 1u; + break; + case 37: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter) */ + errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &exiFrag->DC_EVPowerDeliveryParameter); + exiFrag->DC_EVPowerDeliveryParameter_isUsed = 1u; + break; + case 38: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter) */ + errn = decode_dinDC_EVSEChargeParameterType(stream, &exiFrag->DC_EVSEChargeParameter); + exiFrag->DC_EVSEChargeParameter_isUsed = 1u; + break; + case 39: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + break; + case 40: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + break; + case 41: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + break; + case 42: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + break; + case 43: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DHParams */ + break; + case 44: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = decode_dinDSAKeyValueType(stream, &exiFrag->DSAKeyValue); + exiFrag->DSAKeyValue_isUsed = 1u; + break; + case 45: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DateTimeNow */ + break; + case 46: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->DepartureTime); + exiFrag->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 47: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = decode_dinDigestMethodType(stream, &exiFrag->DigestMethod); + exiFrag->DigestMethod_isUsed = 1u; + break; + case 48: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->DigestValue.bytesLen); + if (errn == 0) { + errn = (exiFrag->DigestValue.bytesLen) <= EXIFragment_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->DigestValue.bytesLen, exiFrag->DigestValue.bytes); + } + exiFrag->DigestValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 49: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EAmount); + exiFrag->EAmount_isUsed = 1u; + break; + case 50: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + exiFrag->EPriceLevel = (uint8_t)(uint32 + 0); + exiFrag->EPriceLevel_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 51: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) */ + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->EVCCID.bytesLen); + if (errn == 0) { + errn = (exiFrag->EVCCID.bytesLen) <= EXIFragment_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->EVCCID.bytesLen, exiFrag->EVCCID.bytes); + } + exiFrag->EVCCID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 52: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVCabinConditioning); + exiFrag->EVCabinConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 53: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter) */ + errn = decode_dinEVChargeParameterType(stream, &exiFrag->EVChargeParameter); + exiFrag->EVChargeParameter_isUsed = 1u; + break; + case 54: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVEnergyCapacity); + exiFrag->EVEnergyCapacity_isUsed = 1u; + break; + case 55: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVEnergyRequest); + exiFrag->EVEnergyRequest_isUsed = 1u; + break; + case 56: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + exiFrag->EVErrorCode = (dinDC_EVErrorCodeType) uint32; + exiFrag->EVErrorCode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 57: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaxCurrent); + exiFrag->EVMaxCurrent_isUsed = 1u; + break; + case 58: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaxVoltage); + exiFrag->EVMaxVoltage_isUsed = 1u; + break; + case 59: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + break; + case 60: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + break; + case 61: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + break; + case 62: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + break; + case 63: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + break; + case 64: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + break; + case 65: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMinCurrent); + exiFrag->EVMinCurrent_isUsed = 1u; + break; + case 66: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter) */ + errn = decode_dinEVPowerDeliveryParameterType(stream, &exiFrag->EVPowerDeliveryParameter); + exiFrag->EVPowerDeliveryParameter_isUsed = 1u; + break; + case 67: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVRESSConditioning); + exiFrag->EVRESSConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 68: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + exiFrag->EVRESSSOC = (int8_t)(uint32 + 0); + exiFrag->EVRESSSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 69: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVReady); + exiFrag->EVReady_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 70: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + exiFrag->EVRequestedEnergyTransferType = (dinEVRequestedEnergyTransferType) uint32; + exiFrag->EVRequestedEnergyTransferType_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 71: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter) */ + errn = decode_dinEVSEChargeParameterType(stream, &exiFrag->EVSEChargeParameter); + exiFrag->EVSEChargeParameter_isUsed = 1u; + break; + case 72: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVSECurrentLimitAchieved); + exiFrag->EVSECurrentLimitAchieved_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 73: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSECurrentRegulationTolerance); + exiFrag->EVSECurrentRegulationTolerance_isUsed = 1u; + break; + case 74: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEEnergyToBeDelivered); + exiFrag->EVSEEnergyToBeDelivered_isUsed = 1u; + break; + case 75: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEID */ + break; + case 76: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + exiFrag->EVSEIsolationStatus = (dinisolationLevelType) uint32; + exiFrag->EVSEIsolationStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 77: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + break; + case 78: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + break; + case 79: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaxVoltage); + exiFrag->EVSEMaxVoltage_isUsed = 1u; + break; + case 80: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + break; + case 81: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + break; + case 82: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + break; + case 83: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + break; + case 84: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + break; + case 85: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + break; + case 86: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMinCurrent); + exiFrag->EVSEMinCurrent_isUsed = 1u; + break; + case 87: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMinimumCurrentLimit); + exiFrag->EVSEMinimumCurrentLimit_isUsed = 1u; + break; + case 88: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMinimumVoltageLimit); + exiFrag->EVSEMinimumVoltageLimit_isUsed = 1u; + break; + case 89: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSENotification */ + break; + case 90: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEPeakCurrentRipple); + exiFrag->EVSEPeakCurrentRipple_isUsed = 1u; + break; + case 91: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVSEPowerLimitAchieved); + exiFrag->EVSEPowerLimitAchieved_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 92: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEPresentCurrent); + exiFrag->EVSEPresentCurrent_isUsed = 1u; + break; + case 93: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEPresentVoltage */ + break; + case 94: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEProcessing */ + break; + case 95: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus) */ + errn = decode_dinEVSEStatusType(stream, &exiFrag->EVSEStatus); + exiFrag->EVSEStatus_isUsed = 1u; + break; + case 96: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + exiFrag->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32; + exiFrag->EVSEStatusCode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 97: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->EVSEVoltageLimitAchieved); + exiFrag->EVSEVoltageLimitAchieved_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 98: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus) */ + errn = decode_dinEVStatusType(stream, &exiFrag->EVStatus); + exiFrag->EVStatus_isUsed = 1u; + break; + case 99: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetCurrent */ + break; + case 100: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetVoltage */ + break; + case 101: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + exiFrag->EnergyTransferType = (dinEVSESupportedEnergyTransferType) uint32; + exiFrag->EnergyTransferType_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 102: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry) */ + errn = decode_dinEntryType(stream, &exiFrag->Entry); + exiFrag->Entry_isUsed = 1u; + break; + case 103: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Exponent.bytesLen); + if (errn == 0) { + errn = (exiFrag->Exponent.bytesLen) <= EXIFragment_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Exponent.bytesLen, exiFrag->Exponent.bytes); + } + exiFrag->Exponent_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 104: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + exiFrag->FaultCode = (dinfaultCodeType) uint32; + exiFrag->FaultCode_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 105: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->FaultMsg.charactersLen); + if (errn == 0) { + errn = (exiFrag->FaultMsg.charactersLen - 2) <= EXIFragment_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->FaultMsg.charactersLen >= 2) { + exiFrag->FaultMsg.charactersLen = (uint16_t)(exiFrag->FaultMsg.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->FaultMsg.charactersLen, exiFrag->FaultMsg.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->FaultMsg_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 106: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->FreeService); + exiFrag->FreeService_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 107: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + exiFrag->FullSOC = (int8_t)(uint32 + 0); + exiFrag->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 108: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->G.bytesLen); + if (errn == 0) { + errn = (exiFrag->G.bytesLen) <= EXIFragment_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->G.bytesLen, exiFrag->G.bytes); + } + exiFrag->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 109: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name GenChallenge */ + break; + case 110: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->HMACOutputLength); + exiFrag->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 111: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header) */ + errn = decode_dinMessageHeaderType(stream, &exiFrag->Header); + exiFrag->Header_isUsed = 1u; + break; + case 112: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->J.bytesLen); + if (errn == 0) { + errn = (exiFrag->J.bytesLen) <= EXIFragment_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->J.bytesLen, exiFrag->J.bytes); + } + exiFrag->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 113: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = decode_dinKeyInfoType(stream, &exiFrag->KeyInfo); + exiFrag->KeyInfo_isUsed = 1u; + break; + case 114: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->KeyName.charactersLen); + if (errn == 0) { + errn = (exiFrag->KeyName.charactersLen - 2) <= EXIFragment_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->KeyName.charactersLen >= 2) { + exiFrag->KeyName.charactersLen = (uint16_t)(exiFrag->KeyName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->KeyName.charactersLen, exiFrag->KeyName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->KeyName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 115: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = decode_dinKeyValueType(stream, &exiFrag->KeyValue); + exiFrag->KeyValue_isUsed = 1u; + break; + case 116: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ListOfRootCertificateIDs */ + break; + case 117: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = decode_dinManifestType(stream, &exiFrag->Manifest); + exiFrag->Manifest_isUsed = 1u; + break; + case 118: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->MeterID.charactersLen); + if (errn == 0) { + errn = (exiFrag->MeterID.charactersLen - 2) <= EXIFragment_MeterID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->MeterID.charactersLen >= 2) { + exiFrag->MeterID.charactersLen = (uint16_t)(exiFrag->MeterID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->MeterID.charactersLen, exiFrag->MeterID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->MeterID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 119: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name MeterInfo */ + break; + case 120: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->MeterReading); + exiFrag->MeterReading_isUsed = 1u; + break; + case 121: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->MeterStatus); + exiFrag->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 122: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq) */ + errn = decode_dinMeteringReceiptReqType(stream, &exiFrag->MeteringReceiptReq); + exiFrag->MeteringReceiptReq_isUsed = 1u; + break; + case 123: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes) */ + errn = decode_dinMeteringReceiptResType(stream, &exiFrag->MeteringReceiptRes); + exiFrag->MeteringReceiptRes_isUsed = 1u; + break; + case 124: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->MgmtData.charactersLen); + if (errn == 0) { + errn = (exiFrag->MgmtData.charactersLen - 2) <= EXIFragment_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->MgmtData.charactersLen >= 2) { + exiFrag->MgmtData.charactersLen = (uint16_t)(exiFrag->MgmtData.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->MgmtData.charactersLen, exiFrag->MgmtData.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->MgmtData_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 125: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Modulus.bytesLen); + if (errn == 0) { + errn = (exiFrag->Modulus.bytesLen) <= EXIFragment_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Modulus.bytesLen, exiFrag->Modulus.bytes); + } + exiFrag->Modulus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 126: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + exiFrag->Multiplier = (int8_t)(uint32 -3); + exiFrag->Multiplier_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 127: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification) */ + errn = decode_dinNotificationType(stream, &exiFrag->Notification); + exiFrag->Notification_isUsed = 1u; + break; + case 128: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name NotificationMaxDelay */ + break; + case 129: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + exiFrag->NumEPriceLevels = (uint8_t)(uint32 + 0); + exiFrag->NumEPriceLevels_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 130: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (exiFrag->OEMProvisioningCert.bytesLen) <= EXIFragment_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->OEMProvisioningCert.bytesLen, exiFrag->OEMProvisioningCert.bytes); + } + exiFrag->OEMProvisioningCert_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 131: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = decode_dinObjectType(stream, &exiFrag->Object); + exiFrag->Object_isUsed = 1u; + break; + case 132: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->P.bytesLen); + if (errn == 0) { + errn = (exiFrag->P.bytesLen) <= EXIFragment_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->P.bytesLen, exiFrag->P.bytes); + } + exiFrag->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 133: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = decode_dinPGPDataType(stream, &exiFrag->PGPData); + exiFrag->PGPData_isUsed = 1u; + break; + case 134: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->PGPKeyID.bytesLen); + if (errn == 0) { + errn = (exiFrag->PGPKeyID.bytesLen) <= EXIFragment_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->PGPKeyID.bytesLen, exiFrag->PGPKeyID.bytes); + } + exiFrag->PGPKeyID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 135: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name PGPKeyPacket */ + break; + case 136: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->PMax); + exiFrag->PMax_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 137: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule) */ + errn = decode_dinPMaxScheduleType(stream, &exiFrag->PMaxSchedule); + exiFrag->PMaxSchedule_isUsed = 1u; + break; + case 138: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry) */ + errn = decode_dinPMaxScheduleEntryType(stream, &exiFrag->PMaxScheduleEntry); + exiFrag->PMaxScheduleEntry_isUsed = 1u; + break; + case 139: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->PMaxScheduleID); + exiFrag->PMaxScheduleID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 140: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter) */ + errn = decode_dinParameterType(stream, &exiFrag->Parameter); + exiFrag->Parameter_isUsed = 1u; + break; + case 141: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet) */ + errn = decode_dinParameterSetType(stream, &exiFrag->ParameterSet); + exiFrag->ParameterSet_isUsed = 1u; + break; + case 142: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ParameterSetID */ + break; + case 143: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq) */ + errn = decode_dinPaymentDetailsReqType(stream, &exiFrag->PaymentDetailsReq); + exiFrag->PaymentDetailsReq_isUsed = 1u; + break; + case 144: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes) */ + errn = decode_dinPaymentDetailsResType(stream, &exiFrag->PaymentDetailsRes); + exiFrag->PaymentDetailsRes_isUsed = 1u; + break; + case 145: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + exiFrag->PaymentOption = (dinpaymentOptionType) uint32; + exiFrag->PaymentOption_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 146: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions) */ + errn = decode_dinPaymentOptionsType(stream, &exiFrag->PaymentOptions); + exiFrag->PaymentOptions_isUsed = 1u; + break; + case 147: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->PgenCounter.bytesLen); + if (errn == 0) { + errn = (exiFrag->PgenCounter.bytesLen) <= EXIFragment_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->PgenCounter.bytesLen, exiFrag->PgenCounter.bytes); + } + exiFrag->PgenCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 148: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq) */ + errn = decode_dinPowerDeliveryReqType(stream, &exiFrag->PowerDeliveryReq); + exiFrag->PowerDeliveryReq_isUsed = 1u; + break; + case 149: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes) */ + errn = decode_dinPowerDeliveryResType(stream, &exiFrag->PowerDeliveryRes); + exiFrag->PowerDeliveryRes_isUsed = 1u; + break; + case 150: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->PowerSwitchClosed); + exiFrag->PowerSwitchClosed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 151: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq) */ + errn = decode_dinPreChargeReqType(stream, &exiFrag->PreChargeReq); + exiFrag->PreChargeReq_isUsed = 1u; + break; + case 152: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes) */ + errn = decode_dinPreChargeResType(stream, &exiFrag->PreChargeRes); + exiFrag->PreChargeRes_isUsed = 1u; + break; + case 153: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry) */ + errn = decode_dinProfileEntryType(stream, &exiFrag->ProfileEntry); + exiFrag->ProfileEntry_isUsed = 1u; + break; + case 154: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Q.bytesLen); + if (errn == 0) { + errn = (exiFrag->Q.bytesLen) <= EXIFragment_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Q.bytesLen, exiFrag->Q.bytes); + } + exiFrag->Q_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 155: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->RCD); + exiFrag->RCD_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 156: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = decode_dinRSAKeyValueType(stream, &exiFrag->RSAKeyValue); + exiFrag->RSAKeyValue_isUsed = 1u; + break; + case 157: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->ReadyToChargeState); + exiFrag->ReadyToChargeState_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 158: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->ReceiptRequired); + exiFrag->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 159: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = decode_dinReferenceType(stream, &exiFrag->Reference); + exiFrag->Reference_isUsed = 1u; + break; + case 160: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval) */ + errn = decode_dinRelativeTimeIntervalType(stream, &exiFrag->RelativeTimeInterval); + exiFrag->RelativeTimeInterval_isUsed = 1u; + break; + case 161: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->RemainingTimeToBulkSoC); + exiFrag->RemainingTimeToBulkSoC_isUsed = 1u; + break; + case 162: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->RemainingTimeToFullSoC); + exiFrag->RemainingTimeToFullSoC_isUsed = 1u; + break; + case 163: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ResponseCode */ + break; + case 164: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = decode_dinRetrievalMethodType(stream, &exiFrag->RetrievalMethod); + exiFrag->RetrievalMethod_isUsed = 1u; + break; + case 165: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->RetryCounter); + exiFrag->RetryCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 166: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->RootCertificateID.charactersLen); + if (errn == 0) { + errn = (exiFrag->RootCertificateID.charactersLen - 2) <= EXIFragment_RootCertificateID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->RootCertificateID.charactersLen >= 2) { + exiFrag->RootCertificateID.charactersLen = (uint16_t)(exiFrag->RootCertificateID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->RootCertificateID.charactersLen, exiFrag->RootCertificateID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->RootCertificateID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 167: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList) */ + errn = decode_dinSAScheduleListType(stream, &exiFrag->SAScheduleList); + exiFrag->SAScheduleList_isUsed = 1u; + break; + case 168: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple) */ + errn = decode_dinSAScheduleTupleType(stream, &exiFrag->SAScheduleTuple); + exiFrag->SAScheduleTuple_isUsed = 1u; + break; + case 169: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + break; + case 170: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + break; + case 171: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules) */ + errn = decode_dinSASchedulesType(stream, &exiFrag->SASchedules); + exiFrag->SASchedules_isUsed = 1u; + break; + case 172: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = decode_dinSPKIDataType(stream, &exiFrag->SPKIData); + exiFrag->SPKIData_isUsed = 1u; + break; + case 173: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->SPKISexp.bytesLen); + if (errn == 0) { + errn = (exiFrag->SPKISexp.bytesLen) <= EXIFragment_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->SPKISexp.bytesLen, exiFrag->SPKISexp.bytes); + } + exiFrag->SPKISexp_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 174: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff) */ + errn = decode_dinSalesTariffType(stream, &exiFrag->SalesTariff); + exiFrag->SalesTariff_isUsed = 1u; + break; + case 175: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->SalesTariffDescription.charactersLen); + if (errn == 0) { + errn = (exiFrag->SalesTariffDescription.charactersLen - 2) <= EXIFragment_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->SalesTariffDescription.charactersLen >= 2) { + exiFrag->SalesTariffDescription.charactersLen = (uint16_t)(exiFrag->SalesTariffDescription.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->SalesTariffDescription.charactersLen, exiFrag->SalesTariffDescription.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->SalesTariffDescription_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 176: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry) */ + errn = decode_dinSalesTariffEntryType(stream, &exiFrag->SalesTariffEntry); + exiFrag->SalesTariffEntry_isUsed = 1u; + break; + case 177: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->SalesTariffID); + exiFrag->SalesTariffID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 178: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Seed.bytesLen); + if (errn == 0) { + errn = (exiFrag->Seed.bytesLen) <= EXIFragment_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Seed.bytesLen, exiFrag->Seed.bytes); + } + exiFrag->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 179: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + exiFrag->SelectedPaymentOption = (dinpaymentOptionType) uint32; + exiFrag->SelectedPaymentOption_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 180: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService) */ + errn = decode_dinSelectedServiceType(stream, &exiFrag->SelectedService); + exiFrag->SelectedService_isUsed = 1u; + break; + case 181: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList) */ + errn = decode_dinSelectedServiceListType(stream, &exiFrag->SelectedServiceList); + exiFrag->SelectedServiceList_isUsed = 1u; + break; + case 182: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service) */ + errn = decode_dinServiceType(stream, &exiFrag->Service); + exiFrag->Service_isUsed = 1u; + break; + case 183: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + break; + case 184: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + break; + case 185: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge) */ + errn = decode_dinServiceChargeType(stream, &exiFrag->ServiceCharge); + exiFrag->ServiceCharge_isUsed = 1u; + break; + case 186: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq) */ + errn = decode_dinServiceDetailReqType(stream, &exiFrag->ServiceDetailReq); + exiFrag->ServiceDetailReq_isUsed = 1u; + break; + case 187: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes) */ + errn = decode_dinServiceDetailResType(stream, &exiFrag->ServiceDetailRes); + exiFrag->ServiceDetailRes_isUsed = 1u; + break; + case 188: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq) */ + errn = decode_dinServiceDiscoveryReqType(stream, &exiFrag->ServiceDiscoveryReq); + exiFrag->ServiceDiscoveryReq_isUsed = 1u; + break; + case 189: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes) */ + errn = decode_dinServiceDiscoveryResType(stream, &exiFrag->ServiceDiscoveryRes); + exiFrag->ServiceDiscoveryRes_isUsed = 1u; + break; + case 190: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + break; + case 191: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + break; + case 192: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList) */ + errn = decode_dinServiceTagListType(stream, &exiFrag->ServiceList); + exiFrag->ServiceList_isUsed = 1u; + break; + case 193: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName) */ + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceName.charactersLen); + if (errn == 0) { + errn = (exiFrag->ServiceName.charactersLen - 2) <= EXIFragment_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->ServiceName.charactersLen >= 2) { + exiFrag->ServiceName.charactersLen = (uint16_t)(exiFrag->ServiceName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->ServiceName.charactersLen, exiFrag->ServiceName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->ServiceName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 194: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList) */ + errn = decode_dinServiceParameterListType(stream, &exiFrag->ServiceParameterList); + exiFrag->ServiceParameterList_isUsed = 1u; + break; + case 195: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq) */ + errn = decode_dinServicePaymentSelectionReqType(stream, &exiFrag->ServicePaymentSelectionReq); + exiFrag->ServicePaymentSelectionReq_isUsed = 1u; + break; + case 196: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes) */ + errn = decode_dinServicePaymentSelectionResType(stream, &exiFrag->ServicePaymentSelectionRes); + exiFrag->ServicePaymentSelectionRes_isUsed = 1u; + break; + case 197: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + break; + case 198: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + break; + case 199: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag) */ + errn = decode_dinServiceTagType(stream, &exiFrag->ServiceTag); + exiFrag->ServiceTag_isUsed = 1u; + break; + case 200: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + break; + case 201: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + break; + case 202: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq) */ + errn = decode_dinSessionSetupReqType(stream, &exiFrag->SessionSetupReq); + exiFrag->SessionSetupReq_isUsed = 1u; + break; + case 203: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes) */ + errn = decode_dinSessionSetupResType(stream, &exiFrag->SessionSetupRes); + exiFrag->SessionSetupRes_isUsed = 1u; + break; + case 204: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq) */ + errn = decode_dinSessionStopType(stream, &exiFrag->SessionStopReq); + exiFrag->SessionStopReq_isUsed = 1u; + break; + case 205: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes) */ + errn = decode_dinSessionStopResType(stream, &exiFrag->SessionStopRes); + exiFrag->SessionStopRes_isUsed = 1u; + break; + case 206: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (exiFrag->SigMeterReading.bytesLen) <= EXIFragment_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->SigMeterReading.bytesLen, exiFrag->SigMeterReading.bytes); + } + exiFrag->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 207: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = decode_dinSignatureType(stream, &exiFrag->Signature); + exiFrag->Signature_isUsed = 1u; + break; + case 208: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = decode_dinSignatureMethodType(stream, &exiFrag->SignatureMethod); + exiFrag->SignatureMethod_isUsed = 1u; + break; + case 209: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = decode_dinSignaturePropertiesType(stream, &exiFrag->SignatureProperties); + exiFrag->SignatureProperties_isUsed = 1u; + break; + case 210: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = decode_dinSignaturePropertyType(stream, &exiFrag->SignatureProperty); + exiFrag->SignatureProperty_isUsed = 1u; + break; + case 211: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = decode_dinSignatureValueType(stream, &exiFrag->SignatureValue); + exiFrag->SignatureValue_isUsed = 1u; + break; + case 212: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = decode_dinSignedInfoType(stream, &exiFrag->SignedInfo); + exiFrag->SignedInfo_isUsed = 1u; + break; + case 213: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates) */ + errn = decode_dinSubCertificatesType(stream, &exiFrag->SubCertificates); + exiFrag->SubCertificates_isUsed = 1u; + break; + case 214: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->TMeter); + exiFrag->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 215: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval) */ + errn = decode_dinIntervalType(stream, &exiFrag->TimeInterval); + exiFrag->TimeInterval_isUsed = 1u; + break; + case 216: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = decode_dinTransformType(stream, &exiFrag->Transform); + exiFrag->Transform_isUsed = 1u; + break; + case 217: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = decode_dinTransformsType(stream, &exiFrag->Transforms); + exiFrag->Transforms_isUsed = 1u; + break; + case 218: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + exiFrag->Unit = (dinunitSymbolType) uint32; + exiFrag->Unit_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 219: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message) */ + errn = decode_dinAnonType_V2G_Message(stream, &exiFrag->V2G_Message); + exiFrag->V2G_Message_isUsed = 1u; + break; + case 220: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->Value); + exiFrag->Value_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 221: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq) */ + errn = decode_dinWeldingDetectionReqType(stream, &exiFrag->WeldingDetectionReq); + exiFrag->WeldingDetectionReq_isUsed = 1u; + break; + case 222: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes) */ + errn = decode_dinWeldingDetectionResType(stream, &exiFrag->WeldingDetectionRes); + exiFrag->WeldingDetectionRes_isUsed = 1u; + break; + case 223: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509CRL.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509CRL.bytesLen) <= EXIFragment_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509CRL.bytesLen, exiFrag->X509CRL.bytes); + } + exiFrag->X509CRL_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 224: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509Certificate.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509Certificate.bytesLen) <= EXIFragment_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509Certificate.bytesLen, exiFrag->X509Certificate.bytes); + } + exiFrag->X509Certificate_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 225: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = decode_dinX509DataType(stream, &exiFrag->X509Data); + exiFrag->X509Data_isUsed = 1u; + break; + case 226: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509IssuerName.charactersLen); + if (errn == 0) { + errn = (exiFrag->X509IssuerName.charactersLen - 2) <= EXIFragment_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->X509IssuerName.charactersLen >= 2) { + exiFrag->X509IssuerName.charactersLen = (uint16_t)(exiFrag->X509IssuerName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->X509IssuerName.charactersLen, exiFrag->X509IssuerName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->X509IssuerName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 227: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial) */ + errn = decode_dinX509IssuerSerialType(stream, &exiFrag->X509IssuerSerial); + exiFrag->X509IssuerSerial_isUsed = 1u; + break; + case 228: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509SKI.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509SKI.bytesLen) <= EXIFragment_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509SKI.bytesLen, exiFrag->X509SKI.bytes); + } + exiFrag->X509SKI_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 229: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->X509SerialNumber); + exiFrag->X509SerialNumber_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 230: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509SubjectName.charactersLen); + if (errn == 0) { + errn = (exiFrag->X509SubjectName.charactersLen - 2) <= EXIFragment_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->X509SubjectName.charactersLen >= 2) { + exiFrag->X509SubjectName.charactersLen = (uint16_t)(exiFrag->X509SubjectName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->X509SubjectName.charactersLen, exiFrag->X509SubjectName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->X509SubjectName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 231: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->XPath.charactersLen); + if (errn == 0) { + errn = (exiFrag->XPath.charactersLen - 2) <= EXIFragment_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->XPath.charactersLen >= 2) { + exiFrag->XPath.charactersLen = (uint16_t)(exiFrag->XPath.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->XPath.charactersLen, exiFrag->XPath.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->XPath_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 232: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Y.bytesLen); + if (errn == 0) { + errn = (exiFrag->Y.bytesLen) <= EXIFragment_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Y.bytesLen, exiFrag->Y.bytes); + } + exiFrag->Y_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 233: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->amount); + exiFrag->amount_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 234: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier) */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + exiFrag->amountMultiplier = (int8_t)(uint32 -3); + exiFrag->amountMultiplier_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 235: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue) */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &exiFrag->boolValue); + exiFrag->boolValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 236: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue) */ + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + exiFrag->byteValue = (int8_t)(uint32 -128); + exiFrag->byteValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 237: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + exiFrag->costKind = (dincostKindType) uint32; + exiFrag->costKind_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 238: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->duration); + exiFrag->duration_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 239: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger32(stream, &exiFrag->intValue); + exiFrag->intValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 240: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue) */ + errn = decode_dinPhysicalValueType(stream, &exiFrag->physicalValue); + exiFrag->physicalValue_isUsed = 1u; + break; + case 241: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &exiFrag->shortValue); + exiFrag->shortValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 242: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->start); + exiFrag->start_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 243: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &exiFrag->startValue); + exiFrag->startValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 244: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->stringValue.charactersLen); + if (errn == 0) { + errn = (exiFrag->stringValue.charactersLen - 2) <= EXIFragment_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->stringValue.charactersLen >= 2) { + exiFrag->stringValue.charactersLen = (uint16_t)(exiFrag->stringValue.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->stringValue.charactersLen, exiFrag->stringValue.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->stringValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + default: + errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1; + break; + } + } + if(errn == 0) { + /* EndDocument */ + errn = decodeNBitUnsignedInteger(stream, 8, &eventCode); + if (eventCode != 246) { + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; + } + } + + } + + return errn; +} +#endif /* DEPLOY_DIN_CODEC_FRAGMENT */ #endif /* DEPLOY_DIN_CODEC */ diff --git a/src/din/dinEXIDatatypesDecoder.h b/src/din/dinEXIDatatypesDecoder.h index 54f3ba9..b54d83f 100644 --- a/src/din/dinEXIDatatypesDecoder.h +++ b/src/din/dinEXIDatatypesDecoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -50,6 +50,10 @@ extern "C" { #include "dinEXIDatatypes.h" int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc); + +#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES +int decode_dinExiFragment(bitstream_t* stream, struct dinEXIFragment* exiFrag); +#endif /* DEPLOY_DIN_CODEC_FRAGMENT */ #endif /* DEPLOY_DIN_CODEC */ diff --git a/src/din/dinEXIDatatypesEncoder.c b/src/din/dinEXIDatatypesEncoder.c index 4ffa5db..2ec4aaa 100644 --- a/src/din/dinEXIDatatypesEncoder.c +++ b/src/din/dinEXIDatatypesEncoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -46,113 +46,113 @@ static int errn; /* Forward Declarations */ -static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType); -static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); -static int encode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType); -static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); -static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); -static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); -static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); -static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); -static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); -static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); -static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); -static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); -static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); -static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); -static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); -static int encode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType); -static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); -static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); -static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); -static int encode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); -static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); -static int encode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); -static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType); -static int encode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType); -static int encode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType); -static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType); +static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); +static int encode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType); static int encode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); -static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); -static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); -static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); -static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); -static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); -static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); +static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); +static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); static int encode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType); -static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); -static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); -static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); +static int encode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); +static int encode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); +static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); +static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); +static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); +static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); +static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); +static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); +static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); +static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); +static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); +static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); +static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); +static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); +static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); +static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType); +static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); +static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); +static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); +static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); +static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); +static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); +static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); +static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); +static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); +static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); +static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); +static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); +static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); +static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); +static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); +static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType); static int encode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType); -static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); -static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); -static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); -static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); -static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); -static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); -static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); -static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); -static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); -static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); -static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); -static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); -static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); -static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); -static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); -static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); -static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); -static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); -static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); -static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); -static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); -static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); -static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); -static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); -static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); -static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); -static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); -static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); -static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); -static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); -static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); -static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); static int encode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType); +static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); +static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); static int encode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType); -static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); -static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); -static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); -static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); -static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); -static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); -static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); -static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); -static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); -static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); -static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); -static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); -static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); -static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); -static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); -static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); -static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); -static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); -static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); -static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); +static int encode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType); +static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); +static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); static int encode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType); -static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); -static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); -static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); -static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); -static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); +static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); +static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); +static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); +static int encode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType); +static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType); -static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); -static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); +static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); +static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); +static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); +static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); +static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); +static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); +static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); +static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); +static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); +static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); +static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); +static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); +static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); +static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); +static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); +static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); +static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); +static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); +static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); +static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); +static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); +static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType); +static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); +static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); +static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); +static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); +static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); +static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); +static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); +static int encode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType); +static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); +static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); +static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); +static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); +static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); +static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); +static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); +static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); +static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); +static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); +static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); +static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); +static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); +static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); +static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); +static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); - /* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { + /* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { int grammarID = 0; int done = 0; @@ -167,7 +167,7 @@ static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinPreChargeResType->ResponseCode); + errn = encodeNBitUnsignedInteger(stream, 5, dinCurrentDemandResType->ResponseCode); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -182,7 +182,7 @@ static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus ); + errn = encode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus ); } grammarID = 2; } else { @@ -190,2089 +190,30 @@ static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeRe } break; case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { - int grammarID = 5; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 5: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMessageHeaderType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMessageHeaderType->SessionID.bytes, dinMessageHeaderType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 6; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 6: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( dinMessageHeaderType->Notification_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinNotificationType(stream, &dinMessageHeaderType->Notification ); - } - grammarID = 7; - } else if ( dinMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 7: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( dinMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -static int encode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) { - int grammarID = 8; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 8: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinServiceDetailReqType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { - int grammarID = 10; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 10: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( dinRetrievalMethodType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinRetrievalMethodType->Type.characters, dinRetrievalMethodType->Type.charactersLen); - } - } - grammarID = 11; - } else if ( dinRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 12; - } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 11: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( dinRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 12; - } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 12: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinSessionSetupResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 14; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 14: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupResType->EVSEID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSessionSetupResType->EVSEID.bytes, dinSessionSetupResType->EVSEID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 15: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ - if ( dinSessionSetupResType->DateTimeNow_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinSessionSetupResType->DateTimeNow); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { - int grammarID = 16; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 16: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Modulus.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinRSAKeyValueType->Modulus.bytes, dinRSAKeyValueType->Modulus.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 17; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 17: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Exponent.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinRSAKeyValueType->Exponent.bytes, dinRSAKeyValueType->Exponent.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { - int grammarID = 18; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 18: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateInstallationResType->Id.characters, dinCertificateInstallationResType->Id.charactersLen); - } - } - grammarID = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 19: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateInstallationResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 20; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 20: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain ); - } - grammarID = 21; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 21: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 22; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 22: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationResType->DHParams.bytes, dinCertificateInstallationResType->DHParams.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 23; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 23: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateInstallationResType->ContractID.characters, dinCertificateInstallationResType->ContractID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { - int grammarID = 24; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 24: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus ); - } - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 25: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit ); - } - grammarID = 26; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 26: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit ); - } - grammarID = 27; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 28; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 27: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 28; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 28: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity ); - } - grammarID = 29; - } else if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 30; - } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 31; - } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 29: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 30; - } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 31; - } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 30: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 31; - } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 31: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) { - int grammarID = 32; - int done = 0; - - unsigned int dinSPKIDataType_SPKISexp_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 32: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - dinSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 33: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - dinSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 33; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 34; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 34: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ - if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - dinSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { - int grammarID = 35; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 35: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 36; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 36: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ - if ( dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ -static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { - int grammarID = 37; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 37: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinProfileEntryType->ChargingProfileEntryStart); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 38; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 38: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinProfileEntryType->ChargingProfileEntryMaxPower); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { - int grammarID = 39; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 39: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - if ( dinCertificateInstallationReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateInstallationReqType->Id.characters, dinCertificateInstallationReqType->Id.charactersLen); - } - } - grammarID = 40; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 40: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs ); - } - grammarID = 42; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytes, dinCertificateInstallationReqType->DHParams.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { - int grammarID = 43; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 43: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignatureMethodType->Algorithm.characters, dinSignatureMethodType->Algorithm.charactersLen); - } - } - grammarID = 44; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 44: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 45; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 46; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 46: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 45; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 46; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { - int grammarID = 47; - int done = 0; - - unsigned int dinSelectedServiceListType_SelectedService_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 47: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ - if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 48; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 48: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ - if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 48; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { - int grammarID = 49; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 49: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { - int grammarID = 50; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 50: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinServicePaymentSelectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { - int grammarID = 51; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 51: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinChargeParameterDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 52; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 52: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinChargeParameterDiscoveryResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 53; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 53: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ - if ( dinChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList ); - } - grammarID = 54; - } else if ( dinChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules ); - } - grammarID = 54; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 54: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ - if ( dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { - int grammarID = 55; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 55: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.characters, dinX509IssuerSerialType->X509IssuerName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 56; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 56: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinX509IssuerSerialType->X509SerialNumber); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { - int grammarID = 57; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 57: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCableCheckResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 58; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 58: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus ); - } - grammarID = 59; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 59: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinCableCheckResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { - int grammarID = 60; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 60: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->MeterID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinMeterInfoType->MeterID.characters, dinMeterInfoType->MeterID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 61; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 61: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->MeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading ); - } - grammarID = 62; - } else if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 63; - } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 64; - } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 62: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 63; - } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 64; - } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 63: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 64; - } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 64: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { - int grammarID = 65; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 65: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCurrentDemandResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 66; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 66: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus ); - } - grammarID = 67; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 67: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage ); } - grammarID = 68; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 68: + case 3: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent ); } - grammarID = 69; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 69: + case 4: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -2285,12 +226,12 @@ static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 70; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 70: + case 5: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -2303,12 +244,12 @@ static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 71; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 71: + case 6: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -2321,2090 +262,91 @@ static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrent errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 72; + grammarID = 7; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 72: + case 7: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ if ( dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit ); } - grammarID = 73; + grammarID = 8; } else if ( dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit ); } - grammarID = 74; + grammarID = 9; } else if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); } - grammarID = 3; + grammarID = 10; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 73: + case 8: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ if ( dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit ); } - grammarID = 74; + grammarID = 9; } else if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); } - grammarID = 3; + grammarID = 10; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 74: + case 9: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); } - grammarID = 3; + grammarID = 10; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { - int grammarID = 75; - int done = 0; - - unsigned int dinParameterSetType_Parameter_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 75: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinParameterSetType->ParameterSetID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 76; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 76: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ - if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 77; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 77: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ - if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 77; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { - int grammarID = 78; - int done = 0; - - unsigned int dinSubCertificatesType_Certificate_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 78: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); - dinSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 79; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ - if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); - dinSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 79; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -static int encode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { - int grammarID = 80; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 80: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinAC_EVSEStatusType->PowerSwitchClosed); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 81; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinAC_EVSEStatusType->RCD); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 82; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinAC_EVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 83; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinAC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { - int grammarID = 84; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 84: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - if ( dinEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval ); - } - grammarID = 3; - } else if ( dinEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinIntervalType(stream, &dinEntryType->TimeInterval ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { - int grammarID = 85; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 85: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinPowerDeliveryReqType->ReadyToChargeState); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 86; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 86: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( dinPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile ); - } - grammarID = 87; - } else if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 87: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType) { - int grammarID = 88; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 88: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinCostType->costKind); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 89: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinCostType->amount); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 90; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 90: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ - if ( dinCostType->amountMultiplier_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(dinCostType->amountMultiplier + 3)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { - int grammarID = 49; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 49: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { - int grammarID = 91; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 91: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 92; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 92: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions ); - } - grammarID = 93; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 93: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService ); - } - grammarID = 94; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ - if ( dinServiceDiscoveryResType->ServiceList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { - int grammarID = 95; - int done = 0; - - unsigned int dinPaymentOptionsType_PaymentOption_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ - if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 96: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ - if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int encode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) { - int grammarID = 97; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 97: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - if ( dinPGPDataType->PGPKeyID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinPGPDataType->PGPKeyID.bytes, dinPGPDataType->PGPKeyID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 98; - } else if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 99; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 98: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 99; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 99; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 99: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 99; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { - int grammarID = 100; - int done = 0; - - unsigned int dinChargingProfileType_ProfileEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 100: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinChargingProfileType->SAScheduleTupleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 101; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 101: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ - if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 102; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 102: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 102; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { - int grammarID = 103; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 103: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus ); - } - grammarID = 104; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 104: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent ); - } - grammarID = 105; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 105: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit ); - } - grammarID = 106; - } else if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 107; - } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 108; - } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 109; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 106: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 107; - } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 108; - } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 109; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 107: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 108; - } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 109; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 108: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 109; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - if ( dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC ); - } - grammarID = 111; - } else if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 112; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 111: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 112; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 112: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { - int grammarID = 113; - int done = 0; - - unsigned int dinSignedInfoType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 113: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( dinSignedInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignedInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignedInfoType->Id.characters, dinSignedInfoType->Id.charactersLen); - } - } - grammarID = 114; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); - } - grammarID = 115; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 114: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); - } - grammarID = 115; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 115: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod ); - } - grammarID = 116; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 116: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 117; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 117: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 117; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { - int grammarID = 118; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 118: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinServiceTagType(stream, &dinServiceType->ServiceTag ); - } - grammarID = 119; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 119: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":BodyElement{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType) { - int grammarID = 120; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 120: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ - if ( dinBodyType->BodyElement_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 0); - if(errn == 0) { - errn = encode_dinBodyBaseType(stream, &dinBodyType->BodyElement ); - } - grammarID = 3; - } else if ( dinBodyType->CableCheckReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 1); - if(errn == 0) { - errn = encode_dinCableCheckReqType(stream, &dinBodyType->CableCheckReq ); - } - grammarID = 3; - } else if ( dinBodyType->CableCheckRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 2); - if(errn == 0) { - errn = encode_dinCableCheckResType(stream, &dinBodyType->CableCheckRes ); - } - grammarID = 3; - } else if ( dinBodyType->CertificateInstallationReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 3); - if(errn == 0) { - errn = encode_dinCertificateInstallationReqType(stream, &dinBodyType->CertificateInstallationReq ); - } - grammarID = 3; - } else if ( dinBodyType->CertificateInstallationRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 4); - if(errn == 0) { - errn = encode_dinCertificateInstallationResType(stream, &dinBodyType->CertificateInstallationRes ); - } - grammarID = 3; - } else if ( dinBodyType->CertificateUpdateReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 5); - if(errn == 0) { - errn = encode_dinCertificateUpdateReqType(stream, &dinBodyType->CertificateUpdateReq ); - } - grammarID = 3; - } else if ( dinBodyType->CertificateUpdateRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 6); - if(errn == 0) { - errn = encode_dinCertificateUpdateResType(stream, &dinBodyType->CertificateUpdateRes ); - } - grammarID = 3; - } else if ( dinBodyType->ChargeParameterDiscoveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 7); - if(errn == 0) { - errn = encode_dinChargeParameterDiscoveryReqType(stream, &dinBodyType->ChargeParameterDiscoveryReq ); - } - grammarID = 3; - } else if ( dinBodyType->ChargeParameterDiscoveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 8); - if(errn == 0) { - errn = encode_dinChargeParameterDiscoveryResType(stream, &dinBodyType->ChargeParameterDiscoveryRes ); - } - grammarID = 3; - } else if ( dinBodyType->ChargingStatusReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 9); - if(errn == 0) { - errn = encode_dinChargingStatusReqType(stream, &dinBodyType->ChargingStatusReq ); - } - grammarID = 3; - } else if ( dinBodyType->ChargingStatusRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 10); - if(errn == 0) { - errn = encode_dinChargingStatusResType(stream, &dinBodyType->ChargingStatusRes ); - } - grammarID = 3; - } else if ( dinBodyType->ContractAuthenticationReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 11); - if(errn == 0) { - errn = encode_dinContractAuthenticationReqType(stream, &dinBodyType->ContractAuthenticationReq ); - } - grammarID = 3; - } else if ( dinBodyType->ContractAuthenticationRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 12); - if(errn == 0) { - errn = encode_dinContractAuthenticationResType(stream, &dinBodyType->ContractAuthenticationRes ); - } - grammarID = 3; - } else if ( dinBodyType->CurrentDemandReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 13); - if(errn == 0) { - errn = encode_dinCurrentDemandReqType(stream, &dinBodyType->CurrentDemandReq ); - } - grammarID = 3; - } else if ( dinBodyType->CurrentDemandRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 14); - if(errn == 0) { - errn = encode_dinCurrentDemandResType(stream, &dinBodyType->CurrentDemandRes ); - } - grammarID = 3; - } else if ( dinBodyType->MeteringReceiptReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 15); - if(errn == 0) { - errn = encode_dinMeteringReceiptReqType(stream, &dinBodyType->MeteringReceiptReq ); - } - grammarID = 3; - } else if ( dinBodyType->MeteringReceiptRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 16); - if(errn == 0) { - errn = encode_dinMeteringReceiptResType(stream, &dinBodyType->MeteringReceiptRes ); - } - grammarID = 3; - } else if ( dinBodyType->PaymentDetailsReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 17); - if(errn == 0) { - errn = encode_dinPaymentDetailsReqType(stream, &dinBodyType->PaymentDetailsReq ); - } - grammarID = 3; - } else if ( dinBodyType->PaymentDetailsRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 18); - if(errn == 0) { - errn = encode_dinPaymentDetailsResType(stream, &dinBodyType->PaymentDetailsRes ); - } - grammarID = 3; - } else if ( dinBodyType->PowerDeliveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 19); - if(errn == 0) { - errn = encode_dinPowerDeliveryReqType(stream, &dinBodyType->PowerDeliveryReq ); - } - grammarID = 3; - } else if ( dinBodyType->PowerDeliveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 20); - if(errn == 0) { - errn = encode_dinPowerDeliveryResType(stream, &dinBodyType->PowerDeliveryRes ); - } - grammarID = 3; - } else if ( dinBodyType->PreChargeReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 21); - if(errn == 0) { - errn = encode_dinPreChargeReqType(stream, &dinBodyType->PreChargeReq ); - } - grammarID = 3; - } else if ( dinBodyType->PreChargeRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 22); - if(errn == 0) { - errn = encode_dinPreChargeResType(stream, &dinBodyType->PreChargeRes ); - } - grammarID = 3; - } else if ( dinBodyType->ServiceDetailReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 23); - if(errn == 0) { - errn = encode_dinServiceDetailReqType(stream, &dinBodyType->ServiceDetailReq ); - } - grammarID = 3; - } else if ( dinBodyType->ServiceDetailRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 24); - if(errn == 0) { - errn = encode_dinServiceDetailResType(stream, &dinBodyType->ServiceDetailRes ); - } - grammarID = 3; - } else if ( dinBodyType->ServiceDiscoveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 25); - if(errn == 0) { - errn = encode_dinServiceDiscoveryReqType(stream, &dinBodyType->ServiceDiscoveryReq ); - } - grammarID = 3; - } else if ( dinBodyType->ServiceDiscoveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 26); - if(errn == 0) { - errn = encode_dinServiceDiscoveryResType(stream, &dinBodyType->ServiceDiscoveryRes ); - } - grammarID = 3; - } else if ( dinBodyType->ServicePaymentSelectionReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 27); - if(errn == 0) { - errn = encode_dinServicePaymentSelectionReqType(stream, &dinBodyType->ServicePaymentSelectionReq ); - } - grammarID = 3; - } else if ( dinBodyType->ServicePaymentSelectionRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 28); - if(errn == 0) { - errn = encode_dinServicePaymentSelectionResType(stream, &dinBodyType->ServicePaymentSelectionRes ); - } - grammarID = 3; - } else if ( dinBodyType->SessionSetupReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 29); - if(errn == 0) { - errn = encode_dinSessionSetupReqType(stream, &dinBodyType->SessionSetupReq ); - } - grammarID = 3; - } else if ( dinBodyType->SessionSetupRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 30); - if(errn == 0) { - errn = encode_dinSessionSetupResType(stream, &dinBodyType->SessionSetupRes ); - } - grammarID = 3; - } else if ( dinBodyType->SessionStopReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 31); - if(errn == 0) { - errn = encode_dinSessionStopType(stream, &dinBodyType->SessionStopReq ); - } - grammarID = 3; - } else if ( dinBodyType->SessionStopRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 32); - if(errn == 0) { - errn = encode_dinSessionStopResType(stream, &dinBodyType->SessionStopRes ); - } - grammarID = 3; - } else if ( dinBodyType->WeldingDetectionReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 33); - if(errn == 0) { - errn = encode_dinWeldingDetectionReqType(stream, &dinBodyType->WeldingDetectionReq ); - } - grammarID = 3; - } else if ( dinBodyType->WeldingDetectionRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 34); - if(errn == 0) { - errn = encode_dinWeldingDetectionResType(stream, &dinBodyType->WeldingDetectionRes ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 6, 35); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ -static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { - int grammarID = 121; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 121: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinAC_EVChargeParameterType->DepartureTime); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 122; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EAmount ); - } - grammarID = 123; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxVoltage ); - } - grammarID = 124; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 124: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxCurrent ); - } - grammarID = 125; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 125: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMinCurrent ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { - int grammarID = 126; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 126: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinSAScheduleTupleType->SAScheduleTupleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 127; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule ); - } - grammarID = 128; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 128: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ - if ( dinSAScheduleTupleType->SalesTariff_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple{1-UNBOUNDED})', derivedBy='EXTENSION'. */ -static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) { - int grammarID = 129; - int done = 0; - - unsigned int dinSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 129: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ - if (dinSAScheduleListType_SAScheduleTuple_currArrayIndex < dinSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array [dinSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 130; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 130: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ - if (dinSAScheduleListType_SAScheduleTuple_currArrayIndex < dinSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array [dinSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 130; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { - int grammarID = 131; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 131: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinServicePaymentSelectionReqType->SelectedPaymentOption); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 132; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 132: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) { - int grammarID = 133; - int done = 0; - - unsigned int dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 133: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinPMaxScheduleType->PMaxScheduleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 134; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 134: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ - if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); - } - grammarID = 135; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 135: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ - if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); - } - grammarID = 135; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { - int grammarID = 136; - int done = 0; - - unsigned int dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 136: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ - if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); - dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 137; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 137: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ - if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); - dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 137; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -4422,13 +364,13 @@ static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct di /* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { - int grammarID = 138; + int grammarID = 12; int done = 0; while(!done) { switch(grammarID) { - case 138: + case 12: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4439,43 +381,43 @@ static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinC errn = encodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.characters, dinCanonicalizationMethodType->Algorithm.charactersLen); } } - grammarID = 139; + grammarID = 13; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 139: + case 13: /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 45: + case 14: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -4491,510 +433,40 @@ static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinC return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) { - int grammarID = 140; - int done = 0; - - unsigned int dinTransformType_XPath_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 140: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinTransformType->Algorithm.characters, dinTransformType->Algorithm.charactersLen); - } - } - grammarID = 141; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 141: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); - dinTransformType_XPath_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 142; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 142; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 142; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 142: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); - dinTransformType_XPath_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 142; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 142; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 142; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) { - int grammarID = 143; - int done = 0; - - unsigned int dinKeyInfoType_KeyName_currArrayIndex = 0; - unsigned int dinKeyInfoType_KeyValue_currArrayIndex = 0; - unsigned int dinKeyInfoType_RetrievalMethod_currArrayIndex = 0; - unsigned int dinKeyInfoType_X509Data_currArrayIndex = 0; - unsigned int dinKeyInfoType_PGPData_currArrayIndex = 0; - unsigned int dinKeyInfoType_SPKIData_currArrayIndex = 0; - unsigned int dinKeyInfoType_MgmtData_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( dinKeyInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->Id.characters, dinKeyInfoType->Id.charactersLen); - } - } - grammarID = 144; - } else if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 7); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 145; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 146; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 144: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 145; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 146; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 145: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 145; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 4, 8); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 145; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 146: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 145; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 145; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 146; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType) { - int grammarID = 147; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +static int encode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) { + int grammarID = 15; int done = 0; while(!done) { switch(grammarID) { - case 147: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + case 15: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinContractAuthenticationResType->ResponseCode); + errn = encodeUnsignedInteger16(stream, dinServiceDetailReqType->ServiceID); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 59; + grammarID = 10; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 59: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinContractAuthenticationResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -5010,70 +482,94 @@ static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ -static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { - int grammarID = 148; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +static int encode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { + int grammarID = 16; int done = 0; while(!done) { switch(grammarID) { - case 148: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag ); - } - grammarID = 149; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 149: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + case 16: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeBoolean(stream, dinServiceChargeType->FreeService); + errn = encodeBoolean(stream, dinAC_EVSEStatusType->PowerSwitchClosed); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 150; + grammarID = 17; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 150: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ + case 17: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinAC_EVSEStatusType->RCD); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 18; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinAC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinServiceChargeType->EnergyTransferType); + errn = encodeNBitUnsignedInteger(stream, 2, dinAC_EVSEStatusType->EVSENotification); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 10; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -5089,149 +585,92 @@ static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceCha return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { - int grammarID = 151; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) { + int grammarID = 20; int done = 0; - unsigned int dinServiceParameterListType_ParameterSet_currArrayIndex = 0; + unsigned int dinSPKIDataType_SPKISexp_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 151: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ - if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { + case 20: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 152; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 152: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ - if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 152; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { - int grammarID = 153; - int done = 0; - - unsigned int dinSignatureType_Object_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 153: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( dinSignatureType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignatureType->Id.characters, dinSignatureType->Id.charactersLen); + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + dinSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 154; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); - } - grammarID = 155; + grammarID = 21; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 154: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); - } - grammarID = 155; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 155: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue ); - } - grammarID = 156; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 156: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if ( dinSignatureType->KeyInfo_isUsed == 1u ) { + case 21: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo ); + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + dinSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 157; - } else if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); - } - grammarID = 157; + grammarID = 21; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 22; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 157: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { + case 22: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + dinSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 157; + grammarID = 21; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -5247,15 +686,15 @@ static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { - int grammarID = 158; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { + int grammarID = 23; int done = 0; while(!done) { switch(grammarID) { - case 158: + case 23: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5263,872 +702,17 @@ static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeter /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinMeteringReceiptResType->ResponseCode); + errn = encodeNBitUnsignedInteger(stream, 5, dinSessionSetupResType->ResponseCode); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 159; + grammarID = 24; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { - int grammarID = 160; - int done = 0; - - unsigned int dinX509DataType_X509IssuerSerial_currArrayIndex = 0; - unsigned int dinX509DataType_X509SKI_currArrayIndex = 0; - unsigned int dinX509DataType_X509SubjectName_currArrayIndex = 0; - unsigned int dinX509DataType_X509Certificate_currArrayIndex = 0; - unsigned int dinX509DataType_X509CRL_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 160: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); - } - grammarID = 161; - } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); - dinX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); - dinX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); - dinX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); - dinX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 161; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 161: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); - } - grammarID = 161; - } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); - dinX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); - dinX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); - dinX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); - dinX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 161; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 161; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 6); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) { - int grammarID = 162; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 162: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->Id.characters, dinReferenceType->Id.charactersLen); - } - } - grammarID = 163; - } else if ( dinReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); - } - } - grammarID = 164; - } else if ( dinReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); - } - } - grammarID = 165; - } else if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 166; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 167; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 163: - /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); - } - } - grammarID = 164; - } else if ( dinReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); - } - } - grammarID = 165; - } else if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 166; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 167; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 164: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); - } - } - grammarID = 165; - } else if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 166; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 167; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 165: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 166; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 167; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 166: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 167; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 167: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->DigestValue.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinReferenceType->DigestValue.bytes, dinReferenceType->DigestValue.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) { - int grammarID = 168; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 168: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(dinPhysicalValueType->Multiplier + 3)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 169; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 169: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - if ( dinPhysicalValueType->Unit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinPhysicalValueType->Unit); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 170; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinPhysicalValueType->Value); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 170: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinPhysicalValueType->Value); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { - int grammarID = 171; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 171: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->start); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 172; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 172: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */ - if ( dinRelativeTimeIntervalType->duration_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->duration); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { - int grammarID = 173; - int done = 0; - - unsigned int dinSalesTariffType_SalesTariffEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 173: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSalesTariffType->Id.characters, dinSalesTariffType->Id.charactersLen); - } - } - grammarID = 174; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 174: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinSalesTariffType->SalesTariffID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 175; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 175: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - if ( dinSalesTariffType->SalesTariffDescription_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.characters, dinSalesTariffType->SalesTariffDescription.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 176; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 177; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 176: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 177; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ - if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 178; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 178: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 178; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { - int grammarID = 179; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 179: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - if ( dinSignatureValueType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignatureValueType->Id.characters, dinSignatureValueType->Id.charactersLen); - } - } - grammarID = 180; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 180: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { - int grammarID = 181; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 181: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinChargingStatusResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 182; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 182: + case 24: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -6136,129 +720,339 @@ static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargi /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinChargingStatusResType->EVSEID.bytesLen)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupResType->EVSEID.bytesLen)); if (errn == 0) { - errn = encodeBytes(stream, dinChargingStatusResType->EVSEID.bytes, dinChargingStatusResType->EVSEID.bytesLen); + errn = encodeBytes(stream, dinSessionSetupResType->EVSEID.bytes, dinSessionSetupResType->EVSEID.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 183; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 183: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinChargingStatusResType->SAScheduleTupleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 184; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 184: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - if ( dinChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ + if ( dinSessionSetupResType->DateTimeNow_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent ); + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinSessionSetupResType->DateTimeNow); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 185; - } else if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { + grammarID = 10; + } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); + done = 1; } - grammarID = 186; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 159; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 185: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); - } - grammarID = 186; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 159; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 186: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 159; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int encode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) { + int grammarID = 26; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 26: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + if ( dinPGPDataType->PGPKeyID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinPGPDataType->PGPKeyID.bytes, dinPGPDataType->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 27; + } else if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 28; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 27: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 28; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 28; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 28: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 28; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { + int grammarID = 29; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 29: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinCableCheckResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 30; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 30: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus ); + } + grammarID = 31; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 31: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinCableCheckResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { + int grammarID = 32; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 32: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinChargeParameterDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 33; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 33: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinChargeParameterDiscoveryResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 34; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 34: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ + if ( dinChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList ); + } + grammarID = 35; + } else if ( dinChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules ); + } + grammarID = 35; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 35: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ + if ( dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); + } + grammarID = 10; + } else if ( dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); + } + grammarID = 10; + } else if ( dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -6276,14 +1070,14 @@ static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargi /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) { - int grammarID = 187; + int grammarID = 36; int done = 0; unsigned int dinManifestType_Reference_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 187: + case 36: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ if ( dinManifestType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -6294,43 +1088,43 @@ static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* d errn = encodeCharacters(stream, dinManifestType->Id.characters, dinManifestType->Id.charactersLen); } } - grammarID = 188; + grammarID = 37; } else if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); } - grammarID = 117; + grammarID = 38; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 188: + case 37: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); } - grammarID = 117; + grammarID = 38; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 117: + case 38: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); } - grammarID = 117; + grammarID = 38; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -6346,204 +1140,88 @@ static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { - int grammarID = 9; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ +static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { + int grammarID = 39; int done = 0; while(!done) { switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { - int grammarID = 189; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 189: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - if ( dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval ); - } - grammarID = 190; - } else if ( dinPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval ); - } - grammarID = 190; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 190: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinPMaxScheduleEntryType->PMax); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { - int grammarID = 191; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 191: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - if ( dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSEIsolationStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 192; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 82; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 192: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 82; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ + case 39: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinDC_EVSEStatusType->NotificationMaxDelay); + errn = encodeUnsignedInteger32(stream, dinAC_EVChargeParameterType->DepartureTime); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 83; + grammarID = 40; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ + case 40: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EAmount ); } - grammarID = 3; + grammarID = 41; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 41: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxVoltage ); + } + grammarID = 42; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 42: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxCurrent ); + } + grammarID = 43; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 43: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMinCurrent ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -6559,931 +1237,22 @@ static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { - int grammarID = 193; +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { + int grammarID = 44; int done = 0; while(!done) { switch(grammarID) { - case 193: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus ); - } - grammarID = 194; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 194: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage ); - } - grammarID = 195; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 195: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ + case 44: + /* FirstStartTag[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType) { - int grammarID = 196; - int done = 0; - - unsigned int dinTransformsType_Transform_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 196: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - if (dinTransformsType_Transform_currArrayIndex < dinTransformsType->Transform.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinTransformType(stream, &dinTransformsType->Transform.array [dinTransformsType_Transform_currArrayIndex++]); - } - grammarID = 197; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 197: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ - if (dinTransformsType_Transform_currArrayIndex < dinTransformsType->Transform.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinTransformType(stream, &dinTransformsType->Transform.array [dinTransformsType_Transform_currArrayIndex++]); - } - grammarID = 197; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ -static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { - int grammarID = 198; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 198: - /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinParameterType->Name.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinParameterType->Name.characters, dinParameterType->Name.charactersLen); - } - } - grammarID = 199; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 199: - /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, dinParameterType->ValueType); - } - grammarID = 200; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 200: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ - if ( dinParameterType->boolValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinParameterType->boolValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( dinParameterType->byteValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinParameterType->byteValue + 128)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( dinParameterType->shortValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinParameterType->shortValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( dinParameterType->intValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger32(stream, dinParameterType->intValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if ( dinParameterType->physicalValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinParameterType->physicalValue ); - } - grammarID = 3; - } else if ( dinParameterType->stringValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 5); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinParameterType->stringValue.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinParameterType->stringValue.characters, dinParameterType->stringValue.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ -static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType) { - int grammarID = 201; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 201: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinPaymentDetailsResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 202; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPaymentDetailsResType->GenChallenge.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinPaymentDetailsResType->GenChallenge.characters, dinPaymentDetailsResType->GenChallenge.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 203; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 203: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinPaymentDetailsResType->DateTimeNow); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { - int grammarID = 204; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 204: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinPowerDeliveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 205; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 205: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ - if ( dinPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus ); - } - grammarID = 3; - } else if ( dinPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus ); - } - grammarID = 3; - } else if ( dinPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { - int grammarID = 206; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 206: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateChainType->Certificate.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateChainType->Certificate.bytes, dinCertificateChainType->Certificate.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 207; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 207: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ - if ( dinCertificateChainType->SubCertificates_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { - int grammarID = 208; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 208: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVReady); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 209; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 209: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - if ( dinDC_EVStatusType->EVCabinConditioning_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVCabinConditioning); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 210; - } else if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 211; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 212; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 210: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 211; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 212; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 211: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 212; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 212: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVStatusType->EVRESSSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { - int grammarID = 213; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 213: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinSelectedServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 214; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ - if ( dinSelectedServiceType->ParameterSetID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinSelectedServiceType->ParameterSetID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) { - int grammarID = 215; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 215: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinServiceTagType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 216; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 216: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ - if ( dinServiceTagType->ServiceName_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinServiceTagType->ServiceName.characters, dinServiceTagType->ServiceName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 217; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 218; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 217: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 218; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 218: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */ - if ( dinServiceTagType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinServiceTagType->ServiceScope.characters, dinServiceTagType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { - int grammarID = 219; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 219: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - if ( dinContractAuthenticationReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinContractAuthenticationReqType->Id.characters, dinContractAuthenticationReqType->Id.charactersLen); - } - } - grammarID = 220; - } else if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 220: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -7501,25 +1270,25 @@ static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct d /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { - int grammarID = 221; + int grammarID = 45; int done = 0; while(!done) { switch(grammarID) { - case 221: + case 45: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus ); } - grammarID = 222; + grammarID = 46; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 222: + case 46: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ if ( dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -7532,7 +1301,7 @@ static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 223; + grammarID = 47; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -7544,12 +1313,12 @@ static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 10; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 223: + case 47: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -7562,19 +1331,19 @@ static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 10; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -7590,1663 +1359,34 @@ static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { - int grammarID = 224; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { + int grammarID = 48; int done = 0; while(!done) { switch(grammarID) { - case 224: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( dinServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + case 48: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.characters, dinServiceDiscoveryReqType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus ); } - grammarID = 225; - } else if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 10; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 225: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType) { - int grammarID = 226; - int done = 0; - - unsigned int dinServiceTagListType_Service_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 226: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ - if (dinServiceTagListType_Service_currArrayIndex < dinServiceTagListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinServiceType(stream, &dinServiceTagListType->Service.array [dinServiceTagListType_Service_currArrayIndex++]); - } - grammarID = 227; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 227: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */ - if (dinServiceTagListType_Service_currArrayIndex < dinServiceTagListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinServiceType(stream, &dinServiceTagListType->Service.array [dinServiceTagListType_Service_currArrayIndex++]); - } - grammarID = 227; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) { - int grammarID = 0; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinWeldingDetectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 1; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus ); - } - grammarID = 2; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ -static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { - int grammarID = 228; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 228: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header ); - } - grammarID = 229; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinBodyType(stream, &dinAnonType_V2G_Message->Body ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { - int grammarID = 230; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 230: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus ); - } - grammarID = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 231: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); - } - grammarID = 232; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 232: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - if ( dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); - } - grammarID = 233; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); - } - grammarID = 234; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 233: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); - } - grammarID = 234; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 234: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); - } - grammarID = 235; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 235: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); - } - grammarID = 236; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); - } - grammarID = 237; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 238; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 237: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 238; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 238: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ - if ( dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ -static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { - int grammarID = 239; - int done = 0; - - unsigned int dinSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 239: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - if ( dinSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval ); - } - grammarID = 240; - } else if ( dinSalesTariffEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval ); - } - grammarID = 240; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 240: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffEntryType->EPriceLevel - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 241; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 241: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (dinSalesTariffEntryType_ConsumptionCost_currArrayIndex < dinSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array [dinSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 241; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { - int grammarID = 242; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 242: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinPaymentDetailsReqType->ContractID.characters, dinPaymentDetailsReqType->ContractID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 243; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 243: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { - int grammarID = 244; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 244: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupReqType->EVCCID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSessionSetupReqType->EVCCID.bytes, dinSessionSetupReqType->EVCCID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { - int grammarID = 245; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 245: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - if ( dinSignaturePropertyType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignaturePropertyType->Id.characters, dinSignaturePropertyType->Id.charactersLen); - } - } - grammarID = 246; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 247; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 246: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 247; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 247: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 248; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 248: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 248; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { - int grammarID = 249; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 249: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateResType->Id.characters, dinCertificateUpdateResType->Id.charactersLen); - } - } - grammarID = 250; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 250: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateUpdateResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 251; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 251: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain ); - } - grammarID = 252; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 252: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 253; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 253: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateUpdateResType->DHParams.bytes, dinCertificateUpdateResType->DHParams.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 254; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 254: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateResType->ContractID.characters, dinCertificateUpdateResType->ContractID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 255; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 255: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinCertificateUpdateResType->RetryCounter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { - int grammarID = 256; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 256: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDetailResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 257; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 257: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinServiceDetailResType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 258; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 258: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ - if ( dinServiceDetailResType->ServiceParameterList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType) { - int grammarID = 259; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 259: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( dinDSAKeyValueType->P_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->P.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->P.bytes, dinDSAKeyValueType->P.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 260; - } else if ( dinDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->G.bytes, dinDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 261; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 262; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 260: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - if ( dinDSAKeyValueType->Q_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Q.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->Q.bytes, dinDSAKeyValueType->Q.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 263; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 263: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( dinDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->G.bytes, dinDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 261; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 262; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 261: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 262; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 262: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( dinDSAKeyValueType->J_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->J.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->J.bytes, dinDSAKeyValueType->J.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 264; - } else if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->Seed.bytes, dinDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 265; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 264: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->Seed.bytes, dinDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 265; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 265: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - if ( dinDSAKeyValueType->PgenCounter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->PgenCounter.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinDSAKeyValueType->PgenCounter.bytes, dinDSAKeyValueType->PgenCounter.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ -static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { - int grammarID = 266; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 266: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus ); - } - grammarID = 267; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 267: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage ); - } - grammarID = 268; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 268: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent ); - } - grammarID = 269; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 269: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { - int grammarID = 270; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 270: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinObjectType->Encoding_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Encoding.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->Encoding.characters, dinObjectType->Encoding.charactersLen); - } - } - grammarID = 271; - } else if ( dinObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); - } - } - grammarID = 272; - } else if ( dinObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); - } - } - grammarID = 139; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 271: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); - } - } - grammarID = 272; - } else if ( dinObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); - } - } - grammarID = 139; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 272: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); - } - } - grammarID = 139; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 139: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 45: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int encode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { - int grammarID = 273; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 273: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); - } - grammarID = 274; - } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); - } - grammarID = 274; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 274; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 275; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 274: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 274; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 275: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); - } - grammarID = 274; - } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); - } - grammarID = 274; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 274; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 275; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { - int grammarID = 9; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 9: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9264,13 +1404,13 @@ static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct di /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) { - int grammarID = 138; + int grammarID = 12; int done = 0; while(!done) { switch(grammarID) { - case 138: + case 12: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9281,43 +1421,43 @@ static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMetho errn = encodeCharacters(stream, dinDigestMethodType->Algorithm.characters, dinDigestMethodType->Algorithm.charactersLen); } } - grammarID = 139; + grammarID = 13; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 139: + case 13: /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 45: + case 14: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 45; + grammarID = 14; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9333,286 +1473,127 @@ static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMetho return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { - int grammarID = 276; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { + int grammarID = 49; int done = 0; + unsigned int dinSalesTariffType_SalesTariffEntry_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 276: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( dinCertificateUpdateReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + case 49: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->Id.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateReqType->Id.characters, dinCertificateUpdateReqType->Id.charactersLen); + errn = encodeCharacters(stream, dinSalesTariffType->Id.characters, dinSalesTariffType->Id.charactersLen); } } - grammarID = 277; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); - } - grammarID = 278; + grammarID = 50; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 277: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + case 50: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinSalesTariffType->SalesTariffID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 278; + grammarID = 51; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 278: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); + case 51: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ + if ( dinSalesTariffType->SalesTariffDescription_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[STRING]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateReqType->ContractID.characters, dinCertificateUpdateReqType->ContractID.charactersLen); + errn = encodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.characters, dinSalesTariffType->SalesTariffDescription.charactersLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs ); - } - grammarID = 42; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytes, dinCertificateUpdateReqType->DHParams.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { - int grammarID = 279; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 279: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ - if ( dinMeteringReceiptReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinMeteringReceiptReqType->Id.characters, dinMeteringReceiptReqType->Id.charactersLen); - } - } - grammarID = 280; + grammarID = 52; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); - } + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 281; + grammarID = 53; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 280: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + case 52: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); - } + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 281; + grammarID = 53; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 281: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ - if ( dinMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ + if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 54; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 54: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinMeteringReceiptReqType->SAScheduleTupleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); } - grammarID = 282; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 282: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { - int grammarID = 283; - int done = 0; - - unsigned int dinConsumptionCostType_Cost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 283: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinConsumptionCostType->startValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 284; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 284: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ - if (dinConsumptionCostType_Cost_currArrayIndex < dinConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinCostType(stream, &dinConsumptionCostType->Cost.array [dinConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 284; + grammarID = 54; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9628,15 +1609,15 @@ static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumpt return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType) { - int grammarID = 50; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { + int grammarID = 55; int done = 0; while(!done) { switch(grammarID) { - case 50: + case 55: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9644,24 +1625,211 @@ static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionSt /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinSessionStopResType->ResponseCode); + errn = encodeNBitUnsignedInteger(stream, 5, dinServicePaymentSelectionResType->ResponseCode); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 10; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { + int grammarID = 56; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 56: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus ); + } + grammarID = 57; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 57: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage ); + } + grammarID = 58; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple{1-UNBOUNDED})', derivedBy='EXTENSION'. */ +static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) { + int grammarID = 59; + int done = 0; + + unsigned int dinSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 59: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ + if (dinSAScheduleListType_SAScheduleTuple_currArrayIndex < dinSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array [dinSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 60; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 60: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ + if (dinSAScheduleListType_SAScheduleTuple_currArrayIndex < dinSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array [dinSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 60; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { + int grammarID = 61; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 61: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateChainType->Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateChainType->Certificate.bytes, dinCertificateChainType->Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 62; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 62: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ + if ( dinCertificateChainType->SubCertificates_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9679,14 +1847,14 @@ static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionSt /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) { - int grammarID = 285; + int grammarID = 63; int done = 0; unsigned int dinSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 285: + case 63: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ if ( dinSignaturePropertiesType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -9697,43 +1865,271 @@ static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign errn = encodeCharacters(stream, dinSignaturePropertiesType->Id.characters, dinSignaturePropertiesType->Id.charactersLen); } } - grammarID = 286; + grammarID = 64; } else if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); } - grammarID = 287; + grammarID = 65; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 286: + case 64: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); } - grammarID = 287; + grammarID = 65; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 287: + case 65: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); } - grammarID = 287; + grammarID = 65; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { + int grammarID = 66; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 66: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMessageHeaderType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMessageHeaderType->SessionID.bytes, dinMessageHeaderType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 67; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 67: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( dinMessageHeaderType->Notification_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinNotificationType(stream, &dinMessageHeaderType->Notification ); + } + grammarID = 68; + } else if ( dinMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 68: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( dinMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { + int grammarID = 69; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 69: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinPreChargeResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 70; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus ); + } + grammarID = 71; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 71: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { + int grammarID = 72; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 72: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinMeteringReceiptResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 73; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9751,13 +2147,13 @@ static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) { - int grammarID = 288; + int grammarID = 74; int done = 0; while(!done) { switch(grammarID) { - case 288: + case 74: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9770,12 +2166,12 @@ static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificatio errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 289; + grammarID = 75; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 289: + case 75: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ if ( dinNotificationType->FaultMsg_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -9792,25 +2188,7629 @@ static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificatio errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 10; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 10: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { + int grammarID = 76; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 76: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + if ( dinContractAuthenticationReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinContractAuthenticationReqType->Id.characters, dinContractAuthenticationReqType->Id.charactersLen); + } + } + grammarID = 77; + } else if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 77: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) { + int grammarID = 78; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 78: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(dinPhysicalValueType->Multiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 79; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 79: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + if ( dinPhysicalValueType->Unit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinPhysicalValueType->Unit); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 80; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinPhysicalValueType->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 80: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinPhysicalValueType->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { + int grammarID = 81; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 81: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinChargingStatusResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 82; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 82: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinChargingStatusResType->EVSEID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinChargingStatusResType->EVSEID.bytes, dinChargingStatusResType->EVSEID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 83; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinChargingStatusResType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 84; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 84: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + if ( dinChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent ); + } + grammarID = 85; + } else if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); + } + grammarID = 86; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 73; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 85: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); + } + grammarID = 86; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 73; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 86: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 73; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { + int grammarID = 87; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 87: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ + if ( dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSEIsolationStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 88; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 18; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 88: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 18; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinDC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ +static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { + int grammarID = 89; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 89: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinProfileEntryType->ChargingProfileEntryStart); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 90; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 90: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinProfileEntryType->ChargingProfileEntryMaxPower); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ +static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { + int grammarID = 91; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 91: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus ); + } + grammarID = 92; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage ); + } + grammarID = 93; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 93: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent ); + } + grammarID = 94; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { + int grammarID = 95; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 96: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions ); + } + grammarID = 97; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 97: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService ); + } + grammarID = 98; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 98: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ + if ( dinServiceDiscoveryResType->ServiceList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { + int grammarID = 99; + int done = 0; + + unsigned int dinSignatureType_Object_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 99: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( dinSignatureType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignatureType->Id.characters, dinSignatureType->Id.charactersLen); + } + } + grammarID = 100; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); + } + grammarID = 101; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 100: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); + } + grammarID = 101; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 101: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue ); + } + grammarID = 102; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 102: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if ( dinSignatureType->KeyInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo ); + } + grammarID = 103; + } else if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); + } + grammarID = 103; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 103: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); + } + grammarID = 103; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { + int grammarID = 104; + int done = 0; + + unsigned int dinPaymentOptionsType_PaymentOption_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 104: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ + if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 105; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 105: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ + if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 105; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { + int grammarID = 106; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 106: + /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinParameterType->Name.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinParameterType->Name.characters, dinParameterType->Name.charactersLen); + } + } + grammarID = 107; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 107: + /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, dinParameterType->ValueType); + } + grammarID = 108; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 108: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ + if ( dinParameterType->boolValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinParameterType->boolValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if ( dinParameterType->byteValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinParameterType->byteValue + 128)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if ( dinParameterType->shortValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinParameterType->shortValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if ( dinParameterType->intValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger32(stream, dinParameterType->intValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if ( dinParameterType->physicalValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinParameterType->physicalValue ); + } + grammarID = 10; + } else if ( dinParameterType->stringValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 5); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinParameterType->stringValue.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinParameterType->stringValue.characters, dinParameterType->stringValue.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { + int grammarID = 109; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 109: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + if ( dinSignaturePropertyType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignaturePropertyType->Id.characters, dinSignaturePropertyType->Id.charactersLen); + } + } + grammarID = 110; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 111; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 110: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 111; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 111: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 112; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 112: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 112; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { + int grammarID = 48; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 48: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType) { + int grammarID = 113; + int done = 0; + + unsigned int dinTransformsType_Transform_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 113: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + if (dinTransformsType_Transform_currArrayIndex < dinTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinTransformType(stream, &dinTransformsType->Transform.array [dinTransformsType_Transform_currArrayIndex++]); + } + grammarID = 114; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 114: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + if (dinTransformsType_Transform_currArrayIndex < dinTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinTransformType(stream, &dinTransformsType->Transform.array [dinTransformsType_Transform_currArrayIndex++]); + } + grammarID = 114; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { + int grammarID = 115; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 115: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinServiceTagType(stream, &dinServiceType->ServiceTag ); + } + grammarID = 116; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 116: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":BodyElement{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType) { + int grammarID = 117; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 117: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + if ( dinBodyType->BodyElement_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 0); + if(errn == 0) { + errn = encode_dinBodyBaseType(stream, &dinBodyType->BodyElement ); + } + grammarID = 10; + } else if ( dinBodyType->CableCheckReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 1); + if(errn == 0) { + errn = encode_dinCableCheckReqType(stream, &dinBodyType->CableCheckReq ); + } + grammarID = 10; + } else if ( dinBodyType->CableCheckRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 2); + if(errn == 0) { + errn = encode_dinCableCheckResType(stream, &dinBodyType->CableCheckRes ); + } + grammarID = 10; + } else if ( dinBodyType->CertificateInstallationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 3); + if(errn == 0) { + errn = encode_dinCertificateInstallationReqType(stream, &dinBodyType->CertificateInstallationReq ); + } + grammarID = 10; + } else if ( dinBodyType->CertificateInstallationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 4); + if(errn == 0) { + errn = encode_dinCertificateInstallationResType(stream, &dinBodyType->CertificateInstallationRes ); + } + grammarID = 10; + } else if ( dinBodyType->CertificateUpdateReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 5); + if(errn == 0) { + errn = encode_dinCertificateUpdateReqType(stream, &dinBodyType->CertificateUpdateReq ); + } + grammarID = 10; + } else if ( dinBodyType->CertificateUpdateRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 6); + if(errn == 0) { + errn = encode_dinCertificateUpdateResType(stream, &dinBodyType->CertificateUpdateRes ); + } + grammarID = 10; + } else if ( dinBodyType->ChargeParameterDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 7); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryReqType(stream, &dinBodyType->ChargeParameterDiscoveryReq ); + } + grammarID = 10; + } else if ( dinBodyType->ChargeParameterDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 8); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryResType(stream, &dinBodyType->ChargeParameterDiscoveryRes ); + } + grammarID = 10; + } else if ( dinBodyType->ChargingStatusReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 9); + if(errn == 0) { + errn = encode_dinChargingStatusReqType(stream, &dinBodyType->ChargingStatusReq ); + } + grammarID = 10; + } else if ( dinBodyType->ChargingStatusRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 10); + if(errn == 0) { + errn = encode_dinChargingStatusResType(stream, &dinBodyType->ChargingStatusRes ); + } + grammarID = 10; + } else if ( dinBodyType->ContractAuthenticationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 11); + if(errn == 0) { + errn = encode_dinContractAuthenticationReqType(stream, &dinBodyType->ContractAuthenticationReq ); + } + grammarID = 10; + } else if ( dinBodyType->ContractAuthenticationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 12); + if(errn == 0) { + errn = encode_dinContractAuthenticationResType(stream, &dinBodyType->ContractAuthenticationRes ); + } + grammarID = 10; + } else if ( dinBodyType->CurrentDemandReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 13); + if(errn == 0) { + errn = encode_dinCurrentDemandReqType(stream, &dinBodyType->CurrentDemandReq ); + } + grammarID = 10; + } else if ( dinBodyType->CurrentDemandRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 14); + if(errn == 0) { + errn = encode_dinCurrentDemandResType(stream, &dinBodyType->CurrentDemandRes ); + } + grammarID = 10; + } else if ( dinBodyType->MeteringReceiptReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 15); + if(errn == 0) { + errn = encode_dinMeteringReceiptReqType(stream, &dinBodyType->MeteringReceiptReq ); + } + grammarID = 10; + } else if ( dinBodyType->MeteringReceiptRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 16); + if(errn == 0) { + errn = encode_dinMeteringReceiptResType(stream, &dinBodyType->MeteringReceiptRes ); + } + grammarID = 10; + } else if ( dinBodyType->PaymentDetailsReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 17); + if(errn == 0) { + errn = encode_dinPaymentDetailsReqType(stream, &dinBodyType->PaymentDetailsReq ); + } + grammarID = 10; + } else if ( dinBodyType->PaymentDetailsRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 18); + if(errn == 0) { + errn = encode_dinPaymentDetailsResType(stream, &dinBodyType->PaymentDetailsRes ); + } + grammarID = 10; + } else if ( dinBodyType->PowerDeliveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 19); + if(errn == 0) { + errn = encode_dinPowerDeliveryReqType(stream, &dinBodyType->PowerDeliveryReq ); + } + grammarID = 10; + } else if ( dinBodyType->PowerDeliveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 20); + if(errn == 0) { + errn = encode_dinPowerDeliveryResType(stream, &dinBodyType->PowerDeliveryRes ); + } + grammarID = 10; + } else if ( dinBodyType->PreChargeReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 21); + if(errn == 0) { + errn = encode_dinPreChargeReqType(stream, &dinBodyType->PreChargeReq ); + } + grammarID = 10; + } else if ( dinBodyType->PreChargeRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 22); + if(errn == 0) { + errn = encode_dinPreChargeResType(stream, &dinBodyType->PreChargeRes ); + } + grammarID = 10; + } else if ( dinBodyType->ServiceDetailReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 23); + if(errn == 0) { + errn = encode_dinServiceDetailReqType(stream, &dinBodyType->ServiceDetailReq ); + } + grammarID = 10; + } else if ( dinBodyType->ServiceDetailRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 24); + if(errn == 0) { + errn = encode_dinServiceDetailResType(stream, &dinBodyType->ServiceDetailRes ); + } + grammarID = 10; + } else if ( dinBodyType->ServiceDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 25); + if(errn == 0) { + errn = encode_dinServiceDiscoveryReqType(stream, &dinBodyType->ServiceDiscoveryReq ); + } + grammarID = 10; + } else if ( dinBodyType->ServiceDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 26); + if(errn == 0) { + errn = encode_dinServiceDiscoveryResType(stream, &dinBodyType->ServiceDiscoveryRes ); + } + grammarID = 10; + } else if ( dinBodyType->ServicePaymentSelectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 27); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionReqType(stream, &dinBodyType->ServicePaymentSelectionReq ); + } + grammarID = 10; + } else if ( dinBodyType->ServicePaymentSelectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 28); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionResType(stream, &dinBodyType->ServicePaymentSelectionRes ); + } + grammarID = 10; + } else if ( dinBodyType->SessionSetupReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 29); + if(errn == 0) { + errn = encode_dinSessionSetupReqType(stream, &dinBodyType->SessionSetupReq ); + } + grammarID = 10; + } else if ( dinBodyType->SessionSetupRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 30); + if(errn == 0) { + errn = encode_dinSessionSetupResType(stream, &dinBodyType->SessionSetupRes ); + } + grammarID = 10; + } else if ( dinBodyType->SessionStopReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 31); + if(errn == 0) { + errn = encode_dinSessionStopType(stream, &dinBodyType->SessionStopReq ); + } + grammarID = 10; + } else if ( dinBodyType->SessionStopRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 32); + if(errn == 0) { + errn = encode_dinSessionStopResType(stream, &dinBodyType->SessionStopRes ); + } + grammarID = 10; + } else if ( dinBodyType->WeldingDetectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 33); + if(errn == 0) { + errn = encode_dinWeldingDetectionReqType(stream, &dinBodyType->WeldingDetectionReq ); + } + grammarID = 10; + } else if ( dinBodyType->WeldingDetectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 34); + if(errn == 0) { + errn = encode_dinWeldingDetectionResType(stream, &dinBodyType->WeldingDetectionRes ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 6, 35); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { + int grammarID = 118; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 118: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVStatusType->EVReady); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 119; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + if ( dinDC_EVStatusType->EVCabinConditioning_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVStatusType->EVCabinConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 120; + } else if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 121; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 122; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 120: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 121; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 122; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 121: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 122; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 122: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVStatusType->EVRESSSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { + int grammarID = 123; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 123: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + if ( dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval ); + } + grammarID = 124; + } else if ( dinPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval ); + } + grammarID = 124; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 124: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinPMaxScheduleEntryType->PMax); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) { + int grammarID = 125; + int done = 0; + + unsigned int dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 125: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinPMaxScheduleType->PMaxScheduleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 126; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 126: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ + if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 127: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 127; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { + int grammarID = 128; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 128: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, dinSelectedServiceType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 129; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 129: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ + if ( dinSelectedServiceType->ParameterSetID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinSelectedServiceType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { + int grammarID = 130; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 130: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + if ( dinCertificateInstallationReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateInstallationReqType->Id.characters, dinCertificateInstallationReqType->Id.charactersLen); + } + } + grammarID = 131; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 132; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 131: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 132; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 132: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs ); + } + grammarID = 133; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 133: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytes, dinCertificateInstallationReqType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) { + int grammarID = 134; + int done = 0; + + unsigned int dinTransformType_XPath_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 134: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinTransformType->Algorithm.characters, dinTransformType->Algorithm.charactersLen); + } + } + grammarID = 135; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 135: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); + dinTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 136; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 136; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 136; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 136: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); + dinTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 136; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 136; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 136; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int encode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { + int grammarID = 137; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 137: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); + } + grammarID = 138; + } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); + } + grammarID = 138; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 138; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 139; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 138: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 138; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 139: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); + } + grammarID = 138; + } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); + } + grammarID = 138; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 138; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 139; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { + int grammarID = 140; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 140: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( dinRetrievalMethodType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinRetrievalMethodType->Type.characters, dinRetrievalMethodType->Type.charactersLen); + } + } + grammarID = 141; + } else if ( dinRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 142; + } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 141: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( dinRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 142; + } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 142: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ +static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { + int grammarID = 143; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 143: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag ); + } + grammarID = 144; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 144: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinServiceChargeType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 145: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinServiceChargeType->EnergyTransferType); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { + int grammarID = 146; + int done = 0; + + unsigned int dinParameterSetType_Parameter_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 146: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinParameterSetType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 147; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 147: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ + if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 148; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 148: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ + if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 148; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) { + int grammarID = 149; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 149: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->Id.characters, dinReferenceType->Id.charactersLen); + } + } + grammarID = 150; + } else if ( dinReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); + } + } + grammarID = 151; + } else if ( dinReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); + } + } + grammarID = 152; + } else if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 153; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 154; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 150: + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); + } + } + grammarID = 151; + } else if ( dinReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); + } + } + grammarID = 152; + } else if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 153; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 154; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 151: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); + } + } + grammarID = 152; + } else if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 153; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 154; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 152: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 153; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 154; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 153: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 154; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 154: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinReferenceType->DigestValue.bytes, dinReferenceType->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType) { + int grammarID = 55; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 55: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinSessionStopResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { + int grammarID = 155; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 155: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinObjectType->Encoding_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Encoding.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->Encoding.characters, dinObjectType->Encoding.charactersLen); + } + } + grammarID = 156; + } else if ( dinObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); + } + } + grammarID = 157; + } else if ( dinObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); + } + } + grammarID = 13; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 156: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); + } + } + grammarID = 157; + } else if ( dinObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); + } + } + grammarID = 13; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 157: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); + } + } + grammarID = 13; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 13: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { + int grammarID = 158; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 158: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + if ( dinSignatureValueType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignatureValueType->Id.characters, dinSignatureValueType->Id.charactersLen); + } + } + grammarID = 159; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 159: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { + int grammarID = 160; + int done = 0; + + unsigned int dinSelectedServiceListType_SelectedService_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 160: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ + if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 161; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 161: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ + if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 161; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ +static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { + int grammarID = 162; + int done = 0; + + unsigned int dinSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 162: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + if ( dinSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval ); + } + grammarID = 163; + } else if ( dinSalesTariffEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval ); + } + grammarID = 163; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 163: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffEntryType->EPriceLevel - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 164; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 164: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (dinSalesTariffEntryType_ConsumptionCost_currArrayIndex < dinSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array [dinSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 164; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { + int grammarID = 165; + int done = 0; + + unsigned int dinConsumptionCostType_Cost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 165: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinConsumptionCostType->startValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 166; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 166: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ + if (dinConsumptionCostType_Cost_currArrayIndex < dinConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinCostType(stream, &dinConsumptionCostType->Cost.array [dinConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 166; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { + int grammarID = 167; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 167: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinRSAKeyValueType->Modulus.bytes, dinRSAKeyValueType->Modulus.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 168; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 168: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinRSAKeyValueType->Exponent.bytes, dinRSAKeyValueType->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { + int grammarID = 169; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 169: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + if ( dinMeteringReceiptReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinMeteringReceiptReqType->Id.characters, dinMeteringReceiptReqType->Id.charactersLen); + } + } + grammarID = 170; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 171; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 170: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 171; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 171: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + if ( dinMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeteringReceiptReqType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 172; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 172: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { + int grammarID = 173; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 173: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinSAScheduleTupleType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 174; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 174: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule ); + } + grammarID = 175; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 175: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ + if ( dinSAScheduleTupleType->SalesTariff_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { + int grammarID = 176; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 176: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->start); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 177; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 177: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */ + if ( dinRelativeTimeIntervalType->duration_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->duration); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { + int grammarID = 178; + int done = 0; + + unsigned int dinChargingProfileType_ProfileEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 178: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinChargingProfileType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 179; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 179: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ + if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 180; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 180: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 180; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { + int grammarID = 181; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 181: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus ); + } + grammarID = 182; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 182: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent ); + } + grammarID = 183; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 183: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit ); + } + grammarID = 184; + } else if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 185; + } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 186; + } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 188; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 184: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 185; + } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 186; + } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 188; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 185: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 186; + } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 188; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 186: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 188; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 187: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 188; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 188: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC ); + } + grammarID = 189; + } else if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 190; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 189: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 190; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 190: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) { + int grammarID = 191; + int done = 0; + + unsigned int dinKeyInfoType_KeyName_currArrayIndex = 0; + unsigned int dinKeyInfoType_KeyValue_currArrayIndex = 0; + unsigned int dinKeyInfoType_RetrievalMethod_currArrayIndex = 0; + unsigned int dinKeyInfoType_X509Data_currArrayIndex = 0; + unsigned int dinKeyInfoType_PGPData_currArrayIndex = 0; + unsigned int dinKeyInfoType_SPKIData_currArrayIndex = 0; + unsigned int dinKeyInfoType_MgmtData_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 191: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( dinKeyInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->Id.characters, dinKeyInfoType->Id.charactersLen); + } + } + grammarID = 192; + } else if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 7); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 194; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 192: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 194; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 193: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 4, 8); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 194: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 193; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 193; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 194; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { + int grammarID = 195; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 195: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinServicePaymentSelectionReqType->SelectedPaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 196; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 196: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType) { + int grammarID = 197; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 197: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinContractAuthenticationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 31; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 31: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinContractAuthenticationResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ +static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType) { + int grammarID = 198; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 198: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinPaymentDetailsResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 199; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 199: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPaymentDetailsResType->GenChallenge.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinPaymentDetailsResType->GenChallenge.characters, dinPaymentDetailsResType->GenChallenge.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 200; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 200: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinPaymentDetailsResType->DateTimeNow); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { + int grammarID = 201; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 201: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinPaymentDetailsReqType->ContractID.characters, dinPaymentDetailsReqType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 202; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 202: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) { + int grammarID = 203; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 203: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, dinServiceTagType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 204; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 204: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ + if ( dinServiceTagType->ServiceName_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceTagType->ServiceName.characters, dinServiceTagType->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 205; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 206; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 205: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 206; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 206: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */ + if ( dinServiceTagType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceTagType->ServiceScope.characters, dinServiceTagType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { + int grammarID = 207; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 207: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 208; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 208: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ + if ( dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter ); + } + grammarID = 10; + } else if ( dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter ); + } + grammarID = 10; + } else if ( dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { + int grammarID = 209; + int done = 0; + + unsigned int dinServiceParameterListType_ParameterSet_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 209: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ + if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 210; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 210: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ + if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 210; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { + int grammarID = 211; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 211: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( dinServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.characters, dinServiceDiscoveryReqType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 212; + } else if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 212: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) { + int grammarID = 69; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 69: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinWeldingDetectionResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 70; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus ); + } + grammarID = 71; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 71: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { + int grammarID = 213; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 213: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( dinCertificateUpdateReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateReqType->Id.characters, dinCertificateUpdateReqType->Id.charactersLen); + } + } + grammarID = 214; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); + } + grammarID = 215; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 214: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); + } + grammarID = 215; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 215: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateReqType->ContractID.characters, dinCertificateUpdateReqType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 132; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 132: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs ); + } + grammarID = 133; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 133: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytes, dinCertificateUpdateReqType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType) { + int grammarID = 216; + int done = 0; + + unsigned int dinServiceTagListType_Service_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 216: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ + if (dinServiceTagListType_Service_currArrayIndex < dinServiceTagListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinServiceType(stream, &dinServiceTagListType->Service.array [dinServiceTagListType_Service_currArrayIndex++]); + } + grammarID = 217; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */ + if (dinServiceTagListType_Service_currArrayIndex < dinServiceTagListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinServiceType(stream, &dinServiceTagListType->Service.array [dinServiceTagListType_Service_currArrayIndex++]); + } + grammarID = 217; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { + int grammarID = 218; + int done = 0; + + unsigned int dinSignedInfoType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 218: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( dinSignedInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignedInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignedInfoType->Id.characters, dinSignedInfoType->Id.charactersLen); + } + } + grammarID = 219; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); + } + grammarID = 220; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 219: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); + } + grammarID = 220; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 220: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod ); + } + grammarID = 221; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 221: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 38: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 38; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { + int grammarID = 222; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 222: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinPowerDeliveryReqType->ReadyToChargeState); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 223; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( dinPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile ); + } + grammarID = 224; + } else if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 10; + } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 224: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 10; + } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType) { + int grammarID = 225; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 225: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinCostType->costKind); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 226; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 226: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinCostType->amount); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 227; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 227: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + if ( dinCostType->amountMultiplier_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(dinCostType->amountMultiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { + int grammarID = 228; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 228: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus ); + } + grammarID = 229; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 229: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit ); + } + grammarID = 230; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 230: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ + if ( dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit ); + } + grammarID = 231; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); + } + grammarID = 232; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); + } + grammarID = 232; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 232: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity ); + } + grammarID = 233; + } else if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 234; + } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 235; + } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 233: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 234; + } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 235; + } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 234: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 235; + } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 235: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { + int grammarID = 236; + int done = 0; + + unsigned int dinSubCertificatesType_Certificate_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 236: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ + if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); + dinSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 237; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 237: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ + if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); + dinSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 237; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { + int grammarID = 238; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 238: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupReqType->EVCCID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSessionSetupReqType->EVCCID.bytes, dinSessionSetupReqType->EVCCID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ +static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { + int grammarID = 239; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 239: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header ); + } + grammarID = 240; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 240: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinBodyType(stream, &dinAnonType_V2G_Message->Body ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { + int grammarID = 241; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 241: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->MeterID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinMeterInfoType->MeterID.characters, dinMeterInfoType->MeterID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 242; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 242: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->MeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading ); + } + grammarID = 243; + } else if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 244; + } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 245; + } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 243: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 244; + } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 245; + } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 244: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 245; + } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 245: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { + int grammarID = 246; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 246: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateInstallationResType->Id.characters, dinCertificateInstallationResType->Id.charactersLen); + } + } + grammarID = 247; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 247: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateInstallationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 248; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 248: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain ); + } + grammarID = 249; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 249: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 250; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 250: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationResType->DHParams.bytes, dinCertificateInstallationResType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 251; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 251: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateInstallationResType->ContractID.characters, dinCertificateInstallationResType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { + int grammarID = 252; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 252: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDetailResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 253; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 253: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, dinServiceDetailResType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 254; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 254: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ + if ( dinServiceDetailResType->ServiceParameterList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { + int grammarID = 255; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 255: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.characters, dinX509IssuerSerialType->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 256; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 256: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinX509IssuerSerialType->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { + int grammarID = 257; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 257: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus ); + } + grammarID = 258; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 258: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); + } + grammarID = 259; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 259: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + if ( dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); + } + grammarID = 260; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); + } + grammarID = 261; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 260: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); + } + grammarID = 261; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 261: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); + } + grammarID = 262; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 262: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); + } + grammarID = 263; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 263: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); + } + grammarID = 264; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 265; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 264: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 265; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 265: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + if ( dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { + int grammarID = 266; + int done = 0; + + unsigned int dinX509DataType_X509IssuerSerial_currArrayIndex = 0; + unsigned int dinX509DataType_X509SKI_currArrayIndex = 0; + unsigned int dinX509DataType_X509SubjectName_currArrayIndex = 0; + unsigned int dinX509DataType_X509Certificate_currArrayIndex = 0; + unsigned int dinX509DataType_X509CRL_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 266: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 267; + } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); + dinX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); + dinX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); + dinX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); + dinX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 267; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 267: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 267; + } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); + dinX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); + dinX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); + dinX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); + dinX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 267; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 6); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { + int grammarID = 268; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 268: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinPowerDeliveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 269; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 269: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ + if ( dinPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus ); + } + grammarID = 10; + } else if ( dinPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus ); + } + grammarID = 10; + } else if ( dinPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType) { + int grammarID = 270; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 270: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( dinDSAKeyValueType->P_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->P.bytes, dinDSAKeyValueType->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 271; + } else if ( dinDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->G.bytes, dinDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 272; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 273; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 271: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + if ( dinDSAKeyValueType->Q_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Q.bytes, dinDSAKeyValueType->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 274; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 274: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( dinDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->G.bytes, dinDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 272; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 273; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 272: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 273; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 273: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( dinDSAKeyValueType->J_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->J.bytes, dinDSAKeyValueType->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 275; + } else if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Seed.bytes, dinDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 276; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 275: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Seed.bytes, dinDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 276; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 276: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + if ( dinDSAKeyValueType->PgenCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->PgenCounter.bytes, dinDSAKeyValueType->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { + int grammarID = 277; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 277: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateResType->Id.characters, dinCertificateUpdateResType->Id.charactersLen); + } + } + grammarID = 278; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 278: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateUpdateResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 279; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 279: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain ); + } + grammarID = 280; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 280: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 281; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 281: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateUpdateResType->DHParams.bytes, dinCertificateUpdateResType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 282; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 282: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateResType->ContractID.characters, dinCertificateUpdateResType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 283; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 283: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinCertificateUpdateResType->RetryCounter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { + int grammarID = 44; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 44: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { + int grammarID = 284; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 284: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + if ( dinEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval ); + } + grammarID = 10; + } else if ( dinEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &dinEntryType->TimeInterval ); + } + grammarID = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { + int grammarID = 285; + int done = 0; + + unsigned int dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 285: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ + if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); + dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 286; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 286: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ + if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); + dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 286; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { + int grammarID = 287; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 287: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignatureMethodType->Algorithm.characters, dinSignatureMethodType->Algorithm.charactersLen); + } + } + grammarID = 288; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 288: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 14; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 289; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 14: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 289: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 14; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 14; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 11; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 289; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10361,6 +10361,1902 @@ int encode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { return errn; } + +#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES +int encode_dinExiFragment(bitstream_t* stream, struct dinEXIFragment* exiFrag) { + errn = writeEXIHeader(stream); + + if(errn == 0) { + /* FragmentContent[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier), START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID), START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue), START_ELEMENT_GENERIC, END_DOCUMENT] */ + if ( exiFrag->AC_EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 0); + if(errn == 0) { + errn = encode_dinAC_EVChargeParameterType(stream, &exiFrag->AC_EVChargeParameter ); + } + } else if ( exiFrag->AC_EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 1); + if(errn == 0) { + errn = encode_dinAC_EVSEChargeParameterType(stream, &exiFrag->AC_EVSEChargeParameter ); + } + } else if ( exiFrag->AC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + } else if ( exiFrag->AC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name AC_EVSEStatus */ + } else if ( exiFrag->Body_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body) */ + errn = encodeNBitUnsignedInteger(stream, 8, 4); + if(errn == 0) { + errn = encode_dinBodyType(stream, &exiFrag->Body ); + } + } else if ( exiFrag->BodyElement_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement) */ + errn = encodeNBitUnsignedInteger(stream, 8, 5); + if(errn == 0) { + errn = encode_dinBodyBaseType(stream, &exiFrag->BodyElement ); + } + } else if ( exiFrag->BulkChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + } else if ( exiFrag->BulkChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name BulkChargingComplete */ + } else if ( exiFrag->BulkSOC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 8); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(exiFrag->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->CableCheckReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 9); + if(errn == 0) { + errn = encode_dinCableCheckReqType(stream, &exiFrag->CableCheckReq ); + } + } else if ( exiFrag->CableCheckRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 10); + if(errn == 0) { + errn = encode_dinCableCheckResType(stream, &exiFrag->CableCheckRes ); + } + } else if ( exiFrag->CanonicalizationMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 11); + if(errn == 0) { + errn = encode_dinCanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod ); + } + } else if ( exiFrag->Certificate_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name Certificate */ + } else if ( exiFrag->CertificateInstallationReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 13); + if(errn == 0) { + errn = encode_dinCertificateInstallationReqType(stream, &exiFrag->CertificateInstallationReq ); + } + } else if ( exiFrag->CertificateInstallationRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 14); + if(errn == 0) { + errn = encode_dinCertificateInstallationResType(stream, &exiFrag->CertificateInstallationRes ); + } + } else if ( exiFrag->CertificateUpdateReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 15); + if(errn == 0) { + errn = encode_dinCertificateUpdateReqType(stream, &exiFrag->CertificateUpdateReq ); + } + } else if ( exiFrag->CertificateUpdateRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 16); + if(errn == 0) { + errn = encode_dinCertificateUpdateResType(stream, &exiFrag->CertificateUpdateRes ); + } + } else if ( exiFrag->ChargeParameterDiscoveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 17); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryReqType(stream, &exiFrag->ChargeParameterDiscoveryReq ); + } + } else if ( exiFrag->ChargeParameterDiscoveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 18); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryResType(stream, &exiFrag->ChargeParameterDiscoveryRes ); + } + } else if ( exiFrag->ChargeService_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService) */ + errn = encodeNBitUnsignedInteger(stream, 8, 19); + if(errn == 0) { + errn = encode_dinServiceChargeType(stream, &exiFrag->ChargeService ); + } + } else if ( exiFrag->ChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + } else if ( exiFrag->ChargingComplete_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ChargingComplete */ + } else if ( exiFrag->ChargingProfile_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile) */ + errn = encodeNBitUnsignedInteger(stream, 8, 22); + if(errn == 0) { + errn = encode_dinChargingProfileType(stream, &exiFrag->ChargingProfile ); + } + } else if ( exiFrag->ChargingProfileEntryMaxPower_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) */ + errn = encodeNBitUnsignedInteger(stream, 8, 23); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->ChargingProfileEntryMaxPower); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ChargingProfileEntryStart_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) */ + errn = encodeNBitUnsignedInteger(stream, 8, 24); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->ChargingProfileEntryStart); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ChargingStatusReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 25); + if(errn == 0) { + errn = encode_dinChargingStatusReqType(stream, &exiFrag->ChargingStatusReq ); + } + } else if ( exiFrag->ChargingStatusRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 26); + if(errn == 0) { + errn = encode_dinChargingStatusResType(stream, &exiFrag->ChargingStatusRes ); + } + } else if ( exiFrag->ConsumptionCost_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost) */ + errn = encodeNBitUnsignedInteger(stream, 8, 27); + if(errn == 0) { + errn = encode_dinConsumptionCostType(stream, &exiFrag->ConsumptionCost ); + } + } else if ( exiFrag->ContractAuthenticationReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 28); + if(errn == 0) { + errn = encode_dinContractAuthenticationReqType(stream, &exiFrag->ContractAuthenticationReq ); + } + } else if ( exiFrag->ContractAuthenticationRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 29); + if(errn == 0) { + errn = encode_dinContractAuthenticationResType(stream, &exiFrag->ContractAuthenticationRes ); + } + } else if ( exiFrag->ContractID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractID */ + } else if ( exiFrag->ContractSignatureCertChain_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureCertChain */ + } else if ( exiFrag->ContractSignatureEncryptedPrivateKey_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ContractSignatureEncryptedPrivateKey */ + } else if ( exiFrag->Cost_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost) */ + errn = encodeNBitUnsignedInteger(stream, 8, 33); + if(errn == 0) { + errn = encode_dinCostType(stream, &exiFrag->Cost ); + } + } else if ( exiFrag->CurrentDemandReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 34); + if(errn == 0) { + errn = encode_dinCurrentDemandReqType(stream, &exiFrag->CurrentDemandReq ); + } + } else if ( exiFrag->CurrentDemandRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 35); + if(errn == 0) { + errn = encode_dinCurrentDemandResType(stream, &exiFrag->CurrentDemandRes ); + } + } else if ( exiFrag->DC_EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 36); + if(errn == 0) { + errn = encode_dinDC_EVChargeParameterType(stream, &exiFrag->DC_EVChargeParameter ); + } + } else if ( exiFrag->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 37); + if(errn == 0) { + errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &exiFrag->DC_EVPowerDeliveryParameter ); + } + } else if ( exiFrag->DC_EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 38); + if(errn == 0) { + errn = encode_dinDC_EVSEChargeParameterType(stream, &exiFrag->DC_EVSEChargeParameter ); + } + } else if ( exiFrag->DC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + } else if ( exiFrag->DC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVSEStatus */ + } else if ( exiFrag->DC_EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + } else if ( exiFrag->DC_EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DC_EVStatus */ + } else if ( exiFrag->DHParams_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DHParams */ + } else if ( exiFrag->DSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 44); + if(errn == 0) { + errn = encode_dinDSAKeyValueType(stream, &exiFrag->DSAKeyValue ); + } + } else if ( exiFrag->DateTimeNow_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name DateTimeNow */ + } else if ( exiFrag->DepartureTime_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime) */ + errn = encodeNBitUnsignedInteger(stream, 8, 46); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->DigestMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 47); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &exiFrag->DigestMethod ); + } + } else if ( exiFrag->DigestValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 48); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->DigestValue.bytes, exiFrag->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EAmount_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount) */ + errn = encodeNBitUnsignedInteger(stream, 8, 49); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EAmount ); + } + } else if ( exiFrag->EPriceLevel_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) */ + errn = encodeNBitUnsignedInteger(stream, 8, 50); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(exiFrag->EPriceLevel - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVCCID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 51); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->EVCCID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->EVCCID.bytes, exiFrag->EVCCID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVCabinConditioning_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) */ + errn = encodeNBitUnsignedInteger(stream, 8, 52); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVCabinConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 53); + if(errn == 0) { + errn = encode_dinEVChargeParameterType(stream, &exiFrag->EVChargeParameter ); + } + } else if ( exiFrag->EVEnergyCapacity_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity) */ + errn = encodeNBitUnsignedInteger(stream, 8, 54); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVEnergyCapacity ); + } + } else if ( exiFrag->EVEnergyRequest_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest) */ + errn = encodeNBitUnsignedInteger(stream, 8, 55); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVEnergyRequest ); + } + } else if ( exiFrag->EVErrorCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 56); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, exiFrag->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVMaxCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 57); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVMaxCurrent ); + } + } else if ( exiFrag->EVMaxVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage) */ + errn = encodeNBitUnsignedInteger(stream, 8, 58); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVMaxVoltage ); + } + } else if ( exiFrag->EVMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + } else if ( exiFrag->EVMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumCurrentLimit */ + } else if ( exiFrag->EVMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + } else if ( exiFrag->EVMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumPowerLimit */ + } else if ( exiFrag->EVMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + } else if ( exiFrag->EVMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVMaximumVoltageLimit */ + } else if ( exiFrag->EVMinCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 65); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVMinCurrent ); + } + } else if ( exiFrag->EVPowerDeliveryParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 66); + if(errn == 0) { + errn = encode_dinEVPowerDeliveryParameterType(stream, &exiFrag->EVPowerDeliveryParameter ); + } + } else if ( exiFrag->EVRESSConditioning_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) */ + errn = encodeNBitUnsignedInteger(stream, 8, 67); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVRESSConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVRESSSOC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 68); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(exiFrag->EVRESSSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVReady_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) */ + errn = encodeNBitUnsignedInteger(stream, 8, 69); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVReady); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVRequestedEnergyTransferType_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) */ + errn = encodeNBitUnsignedInteger(stream, 8, 70); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, exiFrag->EVRequestedEnergyTransferType); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 71); + if(errn == 0) { + errn = encode_dinEVSEChargeParameterType(stream, &exiFrag->EVSEChargeParameter ); + } + } else if ( exiFrag->EVSECurrentLimitAchieved_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) */ + errn = encodeNBitUnsignedInteger(stream, 8, 72); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVSECurrentLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSECurrentRegulationTolerance_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance) */ + errn = encodeNBitUnsignedInteger(stream, 8, 73); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSECurrentRegulationTolerance ); + } + } else if ( exiFrag->EVSEEnergyToBeDelivered_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered) */ + errn = encodeNBitUnsignedInteger(stream, 8, 74); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSEEnergyToBeDelivered ); + } + } else if ( exiFrag->EVSEID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEID */ + } else if ( exiFrag->EVSEIsolationStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 76); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, exiFrag->EVSEIsolationStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEMaxCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + } else if ( exiFrag->EVSEMaxCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaxCurrent */ + } else if ( exiFrag->EVSEMaxVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage) */ + errn = encodeNBitUnsignedInteger(stream, 8, 79); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSEMaxVoltage ); + } + } else if ( exiFrag->EVSEMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + } else if ( exiFrag->EVSEMaximumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumCurrentLimit */ + } else if ( exiFrag->EVSEMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + } else if ( exiFrag->EVSEMaximumPowerLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumPowerLimit */ + } else if ( exiFrag->EVSEMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + } else if ( exiFrag->EVSEMaximumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEMaximumVoltageLimit */ + } else if ( exiFrag->EVSEMinCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 86); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSEMinCurrent ); + } + } else if ( exiFrag->EVSEMinimumCurrentLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit) */ + errn = encodeNBitUnsignedInteger(stream, 8, 87); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSEMinimumCurrentLimit ); + } + } else if ( exiFrag->EVSEMinimumVoltageLimit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit) */ + errn = encodeNBitUnsignedInteger(stream, 8, 88); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSEMinimumVoltageLimit ); + } + } else if ( exiFrag->EVSENotification_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSENotification */ + } else if ( exiFrag->EVSEPeakCurrentRipple_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple) */ + errn = encodeNBitUnsignedInteger(stream, 8, 90); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSEPeakCurrentRipple ); + } + } else if ( exiFrag->EVSEPowerLimitAchieved_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) */ + errn = encodeNBitUnsignedInteger(stream, 8, 91); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVSEPowerLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEPresentCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 92); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->EVSEPresentCurrent ); + } + } else if ( exiFrag->EVSEPresentVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEPresentVoltage */ + } else if ( exiFrag->EVSEProcessing_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVSEProcessing */ + } else if ( exiFrag->EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 95); + if(errn == 0) { + errn = encode_dinEVSEStatusType(stream, &exiFrag->EVSEStatus ); + } + } else if ( exiFrag->EVSEStatusCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 96); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, exiFrag->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVSEVoltageLimitAchieved_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) */ + errn = encodeNBitUnsignedInteger(stream, 8, 97); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->EVSEVoltageLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 98); + if(errn == 0) { + errn = encode_dinEVStatusType(stream, &exiFrag->EVStatus ); + } + } else if ( exiFrag->EVTargetCurrent_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetCurrent */ + } else if ( exiFrag->EVTargetVoltage_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name EVTargetVoltage */ + } else if ( exiFrag->EnergyTransferType_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) */ + errn = encodeNBitUnsignedInteger(stream, 8, 101); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, exiFrag->EnergyTransferType); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Entry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 102); + if(errn == 0) { + errn = encode_dinEntryType(stream, &exiFrag->Entry ); + } + } else if ( exiFrag->Exponent_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) */ + errn = encodeNBitUnsignedInteger(stream, 8, 103); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Exponent.bytes, exiFrag->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FaultCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) */ + errn = encodeNBitUnsignedInteger(stream, 8, 104); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, exiFrag->FaultCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FaultMsg_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) */ + errn = encodeNBitUnsignedInteger(stream, 8, 105); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->FaultMsg.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->FaultMsg.characters, exiFrag->FaultMsg.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FreeService_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) */ + errn = encodeNBitUnsignedInteger(stream, 8, 106); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->FullSOC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 107); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(exiFrag->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->G_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) */ + errn = encodeNBitUnsignedInteger(stream, 8, 108); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->G.bytes, exiFrag->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->GenChallenge_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name GenChallenge */ + } else if ( exiFrag->HMACOutputLength_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) */ + errn = encodeNBitUnsignedInteger(stream, 8, 110); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Header_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header) */ + errn = encodeNBitUnsignedInteger(stream, 8, 111); + if(errn == 0) { + errn = encode_dinMessageHeaderType(stream, &exiFrag->Header ); + } + } else if ( exiFrag->J_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) */ + errn = encodeNBitUnsignedInteger(stream, 8, 112); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->J.bytes, exiFrag->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->KeyInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = encodeNBitUnsignedInteger(stream, 8, 113); + if(errn == 0) { + errn = encode_dinKeyInfoType(stream, &exiFrag->KeyInfo ); + } + } else if ( exiFrag->KeyName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 114); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->KeyName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->KeyName.characters, exiFrag->KeyName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->KeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 115); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &exiFrag->KeyValue ); + } + } else if ( exiFrag->ListOfRootCertificateIDs_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ListOfRootCertificateIDs */ + } else if ( exiFrag->Manifest_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = encodeNBitUnsignedInteger(stream, 8, 117); + if(errn == 0) { + errn = encode_dinManifestType(stream, &exiFrag->Manifest ); + } + } else if ( exiFrag->MeterID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 118); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->MeterID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->MeterID.characters, exiFrag->MeterID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->MeterInfo_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name MeterInfo */ + } else if ( exiFrag->MeterReading_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading) */ + errn = encodeNBitUnsignedInteger(stream, 8, 120); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->MeterReading ); + } + } else if ( exiFrag->MeterStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 121); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->MeteringReceiptReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 122); + if(errn == 0) { + errn = encode_dinMeteringReceiptReqType(stream, &exiFrag->MeteringReceiptReq ); + } + } else if ( exiFrag->MeteringReceiptRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 123); + if(errn == 0) { + errn = encode_dinMeteringReceiptResType(stream, &exiFrag->MeteringReceiptRes ); + } + } else if ( exiFrag->MgmtData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + errn = encodeNBitUnsignedInteger(stream, 8, 124); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->MgmtData.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->MgmtData.characters, exiFrag->MgmtData.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Modulus_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) */ + errn = encodeNBitUnsignedInteger(stream, 8, 125); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Modulus.bytes, exiFrag->Modulus.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Multiplier_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) */ + errn = encodeNBitUnsignedInteger(stream, 8, 126); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(exiFrag->Multiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Notification_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification) */ + errn = encodeNBitUnsignedInteger(stream, 8, 127); + if(errn == 0) { + errn = encode_dinNotificationType(stream, &exiFrag->Notification ); + } + } else if ( exiFrag->NotificationMaxDelay_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name NotificationMaxDelay */ + } else if ( exiFrag->NumEPriceLevels_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) */ + errn = encodeNBitUnsignedInteger(stream, 8, 129); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(exiFrag->NumEPriceLevels - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->OEMProvisioningCert_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) */ + errn = encodeNBitUnsignedInteger(stream, 8, 130); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->OEMProvisioningCert.bytes, exiFrag->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Object_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = encodeNBitUnsignedInteger(stream, 8, 131); + if(errn == 0) { + errn = encode_dinObjectType(stream, &exiFrag->Object ); + } + } else if ( exiFrag->P_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) */ + errn = encodeNBitUnsignedInteger(stream, 8, 132); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->P.bytes, exiFrag->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PGPData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = encodeNBitUnsignedInteger(stream, 8, 133); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &exiFrag->PGPData ); + } + } else if ( exiFrag->PGPKeyID_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 134); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->PGPKeyID.bytes, exiFrag->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PGPKeyPacket_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name PGPKeyPacket */ + } else if ( exiFrag->PMax_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax) */ + errn = encodeNBitUnsignedInteger(stream, 8, 136); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->PMax); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PMaxSchedule_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule) */ + errn = encodeNBitUnsignedInteger(stream, 8, 137); + if(errn == 0) { + errn = encode_dinPMaxScheduleType(stream, &exiFrag->PMaxSchedule ); + } + } else if ( exiFrag->PMaxScheduleEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 138); + if(errn == 0) { + errn = encode_dinPMaxScheduleEntryType(stream, &exiFrag->PMaxScheduleEntry ); + } + } else if ( exiFrag->PMaxScheduleID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 139); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->PMaxScheduleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Parameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 140); + if(errn == 0) { + errn = encode_dinParameterType(stream, &exiFrag->Parameter ); + } + } else if ( exiFrag->ParameterSet_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet) */ + errn = encodeNBitUnsignedInteger(stream, 8, 141); + if(errn == 0) { + errn = encode_dinParameterSetType(stream, &exiFrag->ParameterSet ); + } + } else if ( exiFrag->ParameterSetID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ParameterSetID */ + } else if ( exiFrag->PaymentDetailsReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 143); + if(errn == 0) { + errn = encode_dinPaymentDetailsReqType(stream, &exiFrag->PaymentDetailsReq ); + } + } else if ( exiFrag->PaymentDetailsRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 144); + if(errn == 0) { + errn = encode_dinPaymentDetailsResType(stream, &exiFrag->PaymentDetailsRes ); + } + } else if ( exiFrag->PaymentOption_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) */ + errn = encodeNBitUnsignedInteger(stream, 8, 145); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, exiFrag->PaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PaymentOptions_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions) */ + errn = encodeNBitUnsignedInteger(stream, 8, 146); + if(errn == 0) { + errn = encode_dinPaymentOptionsType(stream, &exiFrag->PaymentOptions ); + } + } else if ( exiFrag->PgenCounter_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 147); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->PgenCounter.bytes, exiFrag->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PowerDeliveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 148); + if(errn == 0) { + errn = encode_dinPowerDeliveryReqType(stream, &exiFrag->PowerDeliveryReq ); + } + } else if ( exiFrag->PowerDeliveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 149); + if(errn == 0) { + errn = encode_dinPowerDeliveryResType(stream, &exiFrag->PowerDeliveryRes ); + } + } else if ( exiFrag->PowerSwitchClosed_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) */ + errn = encodeNBitUnsignedInteger(stream, 8, 150); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->PowerSwitchClosed); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PreChargeReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 151); + if(errn == 0) { + errn = encode_dinPreChargeReqType(stream, &exiFrag->PreChargeReq ); + } + } else if ( exiFrag->PreChargeRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 152); + if(errn == 0) { + errn = encode_dinPreChargeResType(stream, &exiFrag->PreChargeRes ); + } + } else if ( exiFrag->ProfileEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 153); + if(errn == 0) { + errn = encode_dinProfileEntryType(stream, &exiFrag->ProfileEntry ); + } + } else if ( exiFrag->Q_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) */ + errn = encodeNBitUnsignedInteger(stream, 8, 154); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Q.bytes, exiFrag->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->RCD_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) */ + errn = encodeNBitUnsignedInteger(stream, 8, 155); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->RCD); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->RSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 156); + if(errn == 0) { + errn = encode_dinRSAKeyValueType(stream, &exiFrag->RSAKeyValue ); + } + } else if ( exiFrag->ReadyToChargeState_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) */ + errn = encodeNBitUnsignedInteger(stream, 8, 157); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->ReadyToChargeState); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ReceiptRequired_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) */ + errn = encodeNBitUnsignedInteger(stream, 8, 158); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Reference_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = encodeNBitUnsignedInteger(stream, 8, 159); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &exiFrag->Reference ); + } + } else if ( exiFrag->RelativeTimeInterval_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval) */ + errn = encodeNBitUnsignedInteger(stream, 8, 160); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &exiFrag->RelativeTimeInterval ); + } + } else if ( exiFrag->RemainingTimeToBulkSoC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 161); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->RemainingTimeToBulkSoC ); + } + } else if ( exiFrag->RemainingTimeToFullSoC_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC) */ + errn = encodeNBitUnsignedInteger(stream, 8, 162); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->RemainingTimeToFullSoC ); + } + } else if ( exiFrag->ResponseCode_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ResponseCode */ + } else if ( exiFrag->RetrievalMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 164); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &exiFrag->RetrievalMethod ); + } + } else if ( exiFrag->RetryCounter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 165); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->RetryCounter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->RootCertificateID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 166); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->RootCertificateID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->RootCertificateID.characters, exiFrag->RootCertificateID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SAScheduleList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 167); + if(errn == 0) { + errn = encode_dinSAScheduleListType(stream, &exiFrag->SAScheduleList ); + } + } else if ( exiFrag->SAScheduleTuple_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple) */ + errn = encodeNBitUnsignedInteger(stream, 8, 168); + if(errn == 0) { + errn = encode_dinSAScheduleTupleType(stream, &exiFrag->SAScheduleTuple ); + } + } else if ( exiFrag->SAScheduleTupleID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + } else if ( exiFrag->SAScheduleTupleID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SAScheduleTupleID */ + } else if ( exiFrag->SASchedules_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules) */ + errn = encodeNBitUnsignedInteger(stream, 8, 171); + if(errn == 0) { + errn = encode_dinSASchedulesType(stream, &exiFrag->SASchedules ); + } + } else if ( exiFrag->SPKIData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = encodeNBitUnsignedInteger(stream, 8, 172); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &exiFrag->SPKIData ); + } + } else if ( exiFrag->SPKISexp_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) */ + errn = encodeNBitUnsignedInteger(stream, 8, 173); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->SPKISexp.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->SPKISexp.bytes, exiFrag->SPKISexp.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SalesTariff_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff) */ + errn = encodeNBitUnsignedInteger(stream, 8, 174); + if(errn == 0) { + errn = encode_dinSalesTariffType(stream, &exiFrag->SalesTariff ); + } + } else if ( exiFrag->SalesTariffDescription_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription) */ + errn = encodeNBitUnsignedInteger(stream, 8, 175); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->SalesTariffDescription.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->SalesTariffDescription.characters, exiFrag->SalesTariffDescription.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SalesTariffEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry) */ + errn = encodeNBitUnsignedInteger(stream, 8, 176); + if(errn == 0) { + errn = encode_dinSalesTariffEntryType(stream, &exiFrag->SalesTariffEntry ); + } + } else if ( exiFrag->SalesTariffID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) */ + errn = encodeNBitUnsignedInteger(stream, 8, 177); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->SalesTariffID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Seed_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) */ + errn = encodeNBitUnsignedInteger(stream, 8, 178); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Seed.bytes, exiFrag->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SelectedPaymentOption_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) */ + errn = encodeNBitUnsignedInteger(stream, 8, 179); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, exiFrag->SelectedPaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->SelectedService_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService) */ + errn = encodeNBitUnsignedInteger(stream, 8, 180); + if(errn == 0) { + errn = encode_dinSelectedServiceType(stream, &exiFrag->SelectedService ); + } + } else if ( exiFrag->SelectedServiceList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 181); + if(errn == 0) { + errn = encode_dinSelectedServiceListType(stream, &exiFrag->SelectedServiceList ); + } + } else if ( exiFrag->Service_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service) */ + errn = encodeNBitUnsignedInteger(stream, 8, 182); + if(errn == 0) { + errn = encode_dinServiceType(stream, &exiFrag->Service ); + } + } else if ( exiFrag->ServiceCategory_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + } else if ( exiFrag->ServiceCategory_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceCategory */ + } else if ( exiFrag->ServiceCharge_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge) */ + errn = encodeNBitUnsignedInteger(stream, 8, 185); + if(errn == 0) { + errn = encode_dinServiceChargeType(stream, &exiFrag->ServiceCharge ); + } + } else if ( exiFrag->ServiceDetailReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 186); + if(errn == 0) { + errn = encode_dinServiceDetailReqType(stream, &exiFrag->ServiceDetailReq ); + } + } else if ( exiFrag->ServiceDetailRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 187); + if(errn == 0) { + errn = encode_dinServiceDetailResType(stream, &exiFrag->ServiceDetailRes ); + } + } else if ( exiFrag->ServiceDiscoveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 188); + if(errn == 0) { + errn = encode_dinServiceDiscoveryReqType(stream, &exiFrag->ServiceDiscoveryReq ); + } + } else if ( exiFrag->ServiceDiscoveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 189); + if(errn == 0) { + errn = encode_dinServiceDiscoveryResType(stream, &exiFrag->ServiceDiscoveryRes ); + } + } else if ( exiFrag->ServiceID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + } else if ( exiFrag->ServiceID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceID */ + } else if ( exiFrag->ServiceList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 192); + if(errn == 0) { + errn = encode_dinServiceTagListType(stream, &exiFrag->ServiceList ); + } + } else if ( exiFrag->ServiceName_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 193); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->ServiceName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->ServiceName.characters, exiFrag->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->ServiceParameterList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList) */ + errn = encodeNBitUnsignedInteger(stream, 8, 194); + if(errn == 0) { + errn = encode_dinServiceParameterListType(stream, &exiFrag->ServiceParameterList ); + } + } else if ( exiFrag->ServicePaymentSelectionReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 195); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionReqType(stream, &exiFrag->ServicePaymentSelectionReq ); + } + } else if ( exiFrag->ServicePaymentSelectionRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 196); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionResType(stream, &exiFrag->ServicePaymentSelectionRes ); + } + } else if ( exiFrag->ServiceScope_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + } else if ( exiFrag->ServiceScope_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name ServiceScope */ + } else if ( exiFrag->ServiceTag_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag) */ + errn = encodeNBitUnsignedInteger(stream, 8, 199); + if(errn == 0) { + errn = encode_dinServiceTagType(stream, &exiFrag->ServiceTag ); + } + } else if ( exiFrag->SessionID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + } else if ( exiFrag->SessionID_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name SessionID */ + } else if ( exiFrag->SessionSetupReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 202); + if(errn == 0) { + errn = encode_dinSessionSetupReqType(stream, &exiFrag->SessionSetupReq ); + } + } else if ( exiFrag->SessionSetupRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 203); + if(errn == 0) { + errn = encode_dinSessionSetupResType(stream, &exiFrag->SessionSetupRes ); + } + } else if ( exiFrag->SessionStopReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 204); + if(errn == 0) { + errn = encode_dinSessionStopType(stream, &exiFrag->SessionStopReq ); + } + } else if ( exiFrag->SessionStopRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 205); + if(errn == 0) { + errn = encode_dinSessionStopResType(stream, &exiFrag->SessionStopRes ); + } + } else if ( exiFrag->SigMeterReading_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) */ + errn = encodeNBitUnsignedInteger(stream, 8, 206); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->SigMeterReading.bytes, exiFrag->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Signature_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = encodeNBitUnsignedInteger(stream, 8, 207); + if(errn == 0) { + errn = encode_dinSignatureType(stream, &exiFrag->Signature ); + } + } else if ( exiFrag->SignatureMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = encodeNBitUnsignedInteger(stream, 8, 208); + if(errn == 0) { + errn = encode_dinSignatureMethodType(stream, &exiFrag->SignatureMethod ); + } + } else if ( exiFrag->SignatureProperties_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = encodeNBitUnsignedInteger(stream, 8, 209); + if(errn == 0) { + errn = encode_dinSignaturePropertiesType(stream, &exiFrag->SignatureProperties ); + } + } else if ( exiFrag->SignatureProperty_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = encodeNBitUnsignedInteger(stream, 8, 210); + if(errn == 0) { + errn = encode_dinSignaturePropertyType(stream, &exiFrag->SignatureProperty ); + } + } else if ( exiFrag->SignatureValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 211); + if(errn == 0) { + errn = encode_dinSignatureValueType(stream, &exiFrag->SignatureValue ); + } + } else if ( exiFrag->SignedInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = encodeNBitUnsignedInteger(stream, 8, 212); + if(errn == 0) { + errn = encode_dinSignedInfoType(stream, &exiFrag->SignedInfo ); + } + } else if ( exiFrag->SubCertificates_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates) */ + errn = encodeNBitUnsignedInteger(stream, 8, 213); + if(errn == 0) { + errn = encode_dinSubCertificatesType(stream, &exiFrag->SubCertificates ); + } + } else if ( exiFrag->TMeter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) */ + errn = encodeNBitUnsignedInteger(stream, 8, 214); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->TimeInterval_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval) */ + errn = encodeNBitUnsignedInteger(stream, 8, 215); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &exiFrag->TimeInterval ); + } + } else if ( exiFrag->Transform_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = encodeNBitUnsignedInteger(stream, 8, 216); + if(errn == 0) { + errn = encode_dinTransformType(stream, &exiFrag->Transform ); + } + } else if ( exiFrag->Transforms_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = encodeNBitUnsignedInteger(stream, 8, 217); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &exiFrag->Transforms ); + } + } else if ( exiFrag->Unit_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) */ + errn = encodeNBitUnsignedInteger(stream, 8, 218); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, exiFrag->Unit); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->V2G_Message_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message) */ + errn = encodeNBitUnsignedInteger(stream, 8, 219); + if(errn == 0) { + errn = encode_dinAnonType_V2G_Message(stream, &exiFrag->V2G_Message ); + } + } else if ( exiFrag->Value_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) */ + errn = encodeNBitUnsignedInteger(stream, 8, 220); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->WeldingDetectionReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq) */ + errn = encodeNBitUnsignedInteger(stream, 8, 221); + if(errn == 0) { + errn = encode_dinWeldingDetectionReqType(stream, &exiFrag->WeldingDetectionReq ); + } + } else if ( exiFrag->WeldingDetectionRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes) */ + errn = encodeNBitUnsignedInteger(stream, 8, 222); + if(errn == 0) { + errn = encode_dinWeldingDetectionResType(stream, &exiFrag->WeldingDetectionRes ); + } + } else if ( exiFrag->X509CRL_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) */ + errn = encodeNBitUnsignedInteger(stream, 8, 223); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509CRL.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509CRL.bytes, exiFrag->X509CRL.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509Certificate_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) */ + errn = encodeNBitUnsignedInteger(stream, 8, 224); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509Certificate.bytes, exiFrag->X509Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509Data_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = encodeNBitUnsignedInteger(stream, 8, 225); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &exiFrag->X509Data ); + } + } else if ( exiFrag->X509IssuerName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 226); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->X509IssuerName.characters, exiFrag->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509IssuerSerial_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial) */ + errn = encodeNBitUnsignedInteger(stream, 8, 227); + if(errn == 0) { + errn = encode_dinX509IssuerSerialType(stream, &exiFrag->X509IssuerSerial ); + } + } else if ( exiFrag->X509SKI_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) */ + errn = encodeNBitUnsignedInteger(stream, 8, 228); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509SKI.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509SKI.bytes, exiFrag->X509SKI.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509SerialNumber_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) */ + errn = encodeNBitUnsignedInteger(stream, 8, 229); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509SubjectName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) */ + errn = encodeNBitUnsignedInteger(stream, 8, 230); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509SubjectName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->X509SubjectName.characters, exiFrag->X509SubjectName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->XPath_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) */ + errn = encodeNBitUnsignedInteger(stream, 8, 231); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->XPath.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->XPath.characters, exiFrag->XPath.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Y_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) */ + errn = encodeNBitUnsignedInteger(stream, 8, 232); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Y.bytes, exiFrag->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->amount_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) */ + errn = encodeNBitUnsignedInteger(stream, 8, 233); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->amount); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->amountMultiplier_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier) */ + errn = encodeNBitUnsignedInteger(stream, 8, 234); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(exiFrag->amountMultiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->boolValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 235); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, exiFrag->boolValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->byteValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 236); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(exiFrag->byteValue + 128)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->costKind_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) */ + errn = encodeNBitUnsignedInteger(stream, 8, 237); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, exiFrag->costKind); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->duration_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) */ + errn = encodeNBitUnsignedInteger(stream, 8, 238); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->duration); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->intValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 239); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger32(stream, exiFrag->intValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->physicalValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 240); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &exiFrag->physicalValue ); + } + } else if ( exiFrag->shortValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 241); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, exiFrag->shortValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->start_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) */ + errn = encodeNBitUnsignedInteger(stream, 8, 242); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->start); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->startValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 243); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, exiFrag->startValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->stringValue_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue) */ + errn = encodeNBitUnsignedInteger(stream, 8, 244); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->stringValue.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->stringValue.characters, exiFrag->stringValue.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + } + if(errn == 0) { + /* EndDocument */ + errn = encodeNBitUnsignedInteger(stream, 8, 246); + } + + + if(errn == 0) { + /* flush any pending bits */ + errn = encodeFinish(stream); + } + + return errn; +} +#endif /* DEPLOY_DIN_CODEC_FRAGMENT */ #endif /* DEPLOY_DIN_CODEC */ diff --git a/src/din/dinEXIDatatypesEncoder.h b/src/din/dinEXIDatatypesEncoder.h index 75df579..ab6f43e 100644 --- a/src/din/dinEXIDatatypesEncoder.h +++ b/src/din/dinEXIDatatypesEncoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer @@ -51,6 +51,11 @@ extern "C" { int encode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc); + +#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES +int encode_dinExiFragment(bitstream_t* stream, struct dinEXIFragment* exiFrag); +#endif /* DEPLOY_DIN_CODEC_FRAGMENT */ + #endif /* DEPLOY_DIN_CODEC */ diff --git a/src/test/main.c b/src/test/main.c index 1d49d1c..99b19ea 100644 --- a/src/test/main.c +++ b/src/test/main.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Siemens AG + * 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 @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Switch for sample programs: EXI codec only or for entire V2G example diff --git a/src/test/main.h b/src/test/main.h index 4bd6874..8e749a5 100644 --- a/src/test/main.h +++ b/src/test/main.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Siemens AG + * 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 @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * diff --git a/src/test/main_databinder.c b/src/test/main_databinder.c index f6871d2..b84aa14 100644 --- a/src/test/main_databinder.c +++ b/src/test/main_databinder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * Code generated by EXIdizer diff --git a/src/test/main_example.c b/src/test/main_example.c index b263f9f..0491147 100644 --- a/src/test/main_example.c +++ b/src/test/main_example.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2014 Siemens AG + * 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 @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 0.9.2 + * @version 0.9.3 * @contact Joerg.Heuer@siemens.com * * @@ -31,18 +31,30 @@ #include #include +#include + #include "EXITypes.h" #include "appHandEXIDatatypes.h" #include "appHandEXIDatatypesEncoder.h" #include "appHandEXIDatatypesDecoder.h" -#if DEPLOY_DIN_CODEC == SUPPORT_YES +/* Activate support for DIN */ #include "dinEXIDatatypes.h" +#if DEPLOY_DIN_CODEC == SUPPORT_YES #include "dinEXIDatatypesEncoder.h" #include "dinEXIDatatypesDecoder.h" #endif /* DEPLOY_DIN_CODEC == SUPPORT_YES */ +/* Activate support for XMLDSIG */ +#include "xmldsigEXIDatatypes.h" +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES +#include "xmldsigEXIDatatypesEncoder.h" +#include "xmldsigEXIDatatypesDecoder.h" +#endif /* DEPLOY_XMLDSIG_CODEC == SUPPORT_YES */ + + + #include "v2gEXIDatatypes.h" #include "v2gEXIDatatypesEncoder.h" #include "v2gEXIDatatypesDecoder.h" @@ -2318,7 +2330,6 @@ static int dc_charging() { #if DEPLOY_DIN_CODEC == SUPPORT_YES - static int din_test() { int errn = 0; @@ -2404,6 +2415,40 @@ static int din_test() { } + /* sessionStopReq */ + pos2 = 0; /* reset position */ + + /* V: 0x80, 0x9a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x91, 0xf0 */ + buffer2[0] = 0x80; + buffer2[1] = 0x9a; + buffer2[2] = 0x02; + buffer2[3] = 0x00; + buffer2[4] = 0x00; + buffer2[5] = 0x00; + buffer2[6] = 0x00; + buffer2[7] = 0x00; + buffer2[8] = 0x00; + buffer2[9] = 0x00; + buffer2[10] = 0x03; + buffer2[11] = 0x91; + buffer2[12] = 0xf0; + + errn = decode_dinExiDocument(&stream2, &exiDin2); + + if(errn != 0) { + printf("\n\nDIN test error %d!\n", errn); + return errn; + } else if (pos2 != 13) { + printf("\n\nDIN warning. not all bytes read!\n"); + errn = -1; + return errn; + } else if(exiDin2.V2G_Message_isUsed == 0 || exiDin2.V2G_Message.Body.SessionStopReq_isUsed == 0) { + printf("\n\nDIN warning. no sessionStopReq message!\n"); + errn = -1; + return errn; + } + + if(errn == 0) { printf("DIN test passed\n"); } else { @@ -2415,6 +2460,177 @@ static int din_test() { #endif /* DEPLOY_DIN_CODEC == SUPPORT_YES */ + +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES +#if DEPLOY_ISO_CODEC_FRAGMENT == SUPPORT_YES +static int xmldsig_test() { + int errn = 0, i; + + bitstream_t stream1; + uint16_t pos1 = 0; + stream1.size = BUFFER_SIZE; + stream1.data = buffer1; + stream1.pos = &pos1; + + bitstream_t stream2; + uint16_t pos2 = 0; + stream2.size = BUFFER_SIZE; + stream2.data = buffer2; + stream2.pos = &pos2; + + struct v2gEXIFragment exiV2G_AR; + struct xmldsigEXIFragment exiXMLDSIG_SI; + + int sizeIsoStream1 = 25; + int isoStream1[] = {0x80, 0x04, 0x01, 0x52, 0x51, 0x0C, 0x40, 0x82, 0x9B, 0x7B, 0x6B, 0x29, 0x02, 0x93, 0x0B, 0x73, 0x23, 0x7B, 0x69, 0x02, 0x23, 0x0B, 0xA3, 0x09, 0xE8}; + + int sizeIsoStream2 = 209; + int isoStream2[] = {0x80, 0x81, 0x12, 0xB4, 0x3A, 0x3A, 0x38, 0x1D, 0x17, 0x97, 0xBB, 0xBB, 0xBB, 0x97, 0x3B, 0x99, 0x97, 0x37, 0xB9, 0x33, 0x97, 0xAA, 0x29, 0x17, 0xB1, 0xB0, 0xB7, 0x37, 0xB7, 0x34, 0xB1, 0xB0, 0xB6, 0x16, 0xB2, 0xBC, 0x34, 0x97, 0xA1, 0xAB, 0x43, 0xA3, 0xA3, 0x81, 0xD1, 0x79, 0x7B, 0xBB, 0xBB, 0xB9, 0x73, 0xB9, 0x99, 0x73, 0x7B, 0x93, 0x39, 0x79, 0x91, 0x81, 0x81, 0x89, 0x79, 0x81, 0xA1, 0x7B, 0xC3, 0x6B, 0x63, 0x23, 0x9B, 0x4B, 0x39, 0x6B, 0x6B, 0x7B, 0x93, 0x29, 0x1B, 0x2B, 0x1B, 0x23, 0x9B, 0x09, 0x6B, 0x9B, 0x43, 0x09, 0x91, 0xA9, 0xB2, 0x20, 0x62, 0x34, 0x94, 0x43, 0x10, 0x25, 0x68, 0x74, 0x74, 0x70, 0x3A, 0x2F, 0x2F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x33, 0x2E, 0x6F, 0x72, 0x67, 0x2F, 0x54, 0x52, 0x2F, 0x63, 0x61, 0x6E, 0x6F, 0x6E, 0x69, 0x63, 0x61, 0x6C, 0x2D, 0x65, 0x78, 0x69, 0x2F, 0x48, 0x52, 0xD0, 0xE8, 0xE8, 0xE0, 0x74, 0x5E, 0x5E, 0xEE, 0xEE, 0xEE, 0x5C, 0xEE, 0x66, 0x5C, 0xDE, 0xE4, 0xCE, 0x5E, 0x64, 0x60, 0x60, 0x62, 0x5E, 0x60, 0x68, 0x5E, 0xF0, 0xDA, 0xD8, 0xCA, 0xDC, 0xC6, 0x46, 0xE6, 0xD0, 0xC2, 0x64, 0x6A, 0x6C, 0x84, 0x1A, 0x36, 0xBC, 0x07, 0xA0, 0x0C, 0xB7, 0xDC, 0xAD, 0x66, 0x2F, 0x30, 0x88, 0xA6, 0x0A, 0x3D, 0x6A, 0x99, 0x43, 0x1F, 0x81, 0xC1, 0x22, 0xC2, 0xE9, 0xF1, 0x67, 0x8E, 0xF5, 0x31, 0xE9, 0x55, 0x23, 0x70}; + + + uint8_t digestValue[] = {0xD1, 0xB5, 0xE0, 0x3D, 0x00, 0x65, 0xBE, 0xE5, 0x6B, 0x31, 0x79, 0x84, 0x45, 0x30, 0x51, 0xEB, 0x54, 0xCA, 0x18, 0xFC, 0x0E, 0x09, 0x16, 0x17, 0x4F, 0x8B, 0x3C, 0x77, 0xA9, 0x8F, 0x4A, 0xA9}; /* 32 Bytes */ + + + /* + + U29tZSBSYW5kb20gRGF0YQ== + + */ + + init_v2gEXIFragment(&exiV2G_AR); + exiV2G_AR.AuthorizationReq_isUsed = 1u; + init_v2gAuthorizationReqType(&exiV2G_AR.AuthorizationReq); + exiV2G_AR.AuthorizationReq.Id_isUsed = 1; + exiV2G_AR.AuthorizationReq.Id.charactersLen = 3; + exiV2G_AR.AuthorizationReq.Id.characters[0] = 'I'; + exiV2G_AR.AuthorizationReq.Id.characters[1] = 'D'; + exiV2G_AR.AuthorizationReq.Id.characters[2] = '1'; + exiV2G_AR.AuthorizationReq.GenChallenge_isUsed = 1; + /* base64 U29tZSBSYW5kb20gRGF0YQ== */ + exiV2G_AR.AuthorizationReq.GenChallenge.bytesLen = 16; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[0] = 0x53; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[1] = 0x6F; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[2] = 0x6D; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[3] = 0x65; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[4] = 0x20; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[5] = 0x52; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[6] = 0x61; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[7] = 0x6E; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[8] = 0x64; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[9] = 0x6F; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[10] = 0x6D; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[11] = 0x20; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[12] = 0x44; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[13] = 0x61; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[14] = 0x74; + exiV2G_AR.AuthorizationReq.GenChallenge.bytes[15] = 0x61; + + /* encode fragment with ISO schema */ + errn = encode_v2gExiFragment(&stream1, &exiV2G_AR); + + if((*stream1.pos) != sizeIsoStream1) { + errn = -1; + printf("EXI1 stream length does not match !\n"); + return errn; + } else { + for(i=0; i + + + + + + + + 0bXgPQBlvuVrMXmERTBR61TK + GPwOCRYXT4s8d6mPSqk= + + + */ + + /* encode SignedInfo element with xmldsig schema */ + + char arrayCanonicalEXI[35] = {"http://www.w3.org/TR/canonical-exi/"}; + char arrayxmldsigSHA256[51] = {"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"}; + char arrayxmlencSHA256[39] = {"http://www.w3.org/2001/04/xmlenc#sha256"}; + + init_xmldsigEXIFragment(&exiXMLDSIG_SI); + exiXMLDSIG_SI.SignedInfo_isUsed = 1; + init_xmldsigSignedInfoType(&exiXMLDSIG_SI.SignedInfo); + { + init_xmldsigCanonicalizationMethodType(&exiXMLDSIG_SI.SignedInfo.CanonicalizationMethod); + exiXMLDSIG_SI.SignedInfo.CanonicalizationMethod.Algorithm.charactersLen = 35; + strncpy(exiXMLDSIG_SI.SignedInfo.CanonicalizationMethod.Algorithm.characters, arrayCanonicalEXI, 35); + + exiXMLDSIG_SI.SignedInfo.SignatureMethod.HMACOutputLength_isUsed = 0; + exiXMLDSIG_SI.SignedInfo.SignatureMethod.Algorithm.charactersLen = 51; + strncpy(exiXMLDSIG_SI.SignedInfo.SignatureMethod.Algorithm.characters, arrayxmldsigSHA256, 51); + + exiXMLDSIG_SI.SignedInfo.Reference.arrayLen = 1; + /* "#ID1" */ + exiXMLDSIG_SI.SignedInfo.Reference.array[0].URI_isUsed = 1; + exiXMLDSIG_SI.SignedInfo.Reference.array[0].URI.charactersLen = 4; + exiXMLDSIG_SI.SignedInfo.Reference.array[0].URI.characters[0] = '#'; + exiXMLDSIG_SI.SignedInfo.Reference.array[0].URI.characters[1] = 'I'; + exiXMLDSIG_SI.SignedInfo.Reference.array[0].URI.characters[2] = 'D'; + exiXMLDSIG_SI.SignedInfo.Reference.array[0].URI.characters[3] = '1'; + /* "http://www.w3.org/TR/canonical-exi/" */ + exiXMLDSIG_SI.SignedInfo.Reference.array[0].Transforms_isUsed = 1; + exiXMLDSIG_SI.SignedInfo.Reference.array[0].Transforms.Transform.arrayLen = 1; + exiXMLDSIG_SI.SignedInfo.Reference.array[0].Transforms.Transform.array[0].Algorithm.charactersLen = 35; + strncpy(exiXMLDSIG_SI.SignedInfo.Reference.array[0].Transforms.Transform.array[0].Algorithm.characters, arrayCanonicalEXI, 35); /* Will copy 35 characters from arrayCanonicalEXI to characters */ + exiXMLDSIG_SI.SignedInfo.Reference.array[0].Transforms.Transform.array[0].XPath.arrayLen = 0; + + exiXMLDSIG_SI.SignedInfo.Reference.array[0].DigestMethod.Algorithm.charactersLen = 39; + strncpy(exiXMLDSIG_SI.SignedInfo.Reference.array[0].DigestMethod.Algorithm.characters, arrayxmlencSHA256, 39); + + /* "0bXgPQBlvuVrMXmERTBR61TKGPwOCRYXT4s8d6mPSqk=" --> 16 Bytes 536F6D652052616E646F6D2044617461 */ + exiXMLDSIG_SI.SignedInfo.Reference.array[0].DigestValue.bytesLen = 32; + memcpy(exiXMLDSIG_SI.SignedInfo.Reference.array[0].DigestValue.bytes, digestValue, 32); + } + + errn = encode_xmldsigExiFragment(&stream2, &exiXMLDSIG_SI); + + if((*stream2.pos) != sizeIsoStream2) { + errn = -1; + printf("EXI2 stream length does not match !\n"); + return errn; + } else { + for(i=0; i. + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.3 + * @contact Joerg.Heuer@siemens.com + * + * Code generated by EXIdizer + * Schema: xmldsig-core-schema.xsd + * + * + ********************************************************************/ + + + +#include + +#include "xmldsigEXIDatatypes.h" +#include "EXITypes.h" + + +#ifndef EXI_xmldsig_DATATYPES_C +#define EXI_xmldsig_DATATYPES_C + +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES + + +void init_xmldsigEXIDocument(struct xmldsigEXIDocument* exiDoc) { + exiDoc->SignatureProperty_isUsed = 0u; + exiDoc->DSAKeyValue_isUsed = 0u; + exiDoc->SignatureProperties_isUsed = 0u; + exiDoc->KeyValue_isUsed = 0u; + exiDoc->Transforms_isUsed = 0u; + exiDoc->DigestMethod_isUsed = 0u; + exiDoc->Signature_isUsed = 0u; + exiDoc->RetrievalMethod_isUsed = 0u; + exiDoc->Manifest_isUsed = 0u; + exiDoc->Reference_isUsed = 0u; + exiDoc->CanonicalizationMethod_isUsed = 0u; + exiDoc->RSAKeyValue_isUsed = 0u; + exiDoc->Transform_isUsed = 0u; + exiDoc->PGPData_isUsed = 0u; + exiDoc->MgmtData_isUsed = 0u; + exiDoc->SignatureMethod_isUsed = 0u; + exiDoc->KeyInfo_isUsed = 0u; + exiDoc->SPKIData_isUsed = 0u; + exiDoc->X509Data_isUsed = 0u; + exiDoc->SignatureValue_isUsed = 0u; + exiDoc->KeyName_isUsed = 0u; + exiDoc->DigestValue_isUsed = 0u; + exiDoc->SignedInfo_isUsed = 0u; + exiDoc->Object_isUsed = 0u; +} + +#if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES +void init_xmldsigEXIFragment(struct xmldsigEXIFragment* exiFrag) { + exiFrag->RSAKeyValue_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->PGPKeyPacket_isUsed = 0u; + exiFrag->X509Data_isUsed = 0u; + exiFrag->PgenCounter_isUsed = 0u; + exiFrag->X509Certificate_isUsed = 0u; + exiFrag->Seed_isUsed = 0u; + exiFrag->Modulus_isUsed = 0u; + exiFrag->X509SKI_isUsed = 0u; + exiFrag->SPKISexp_isUsed = 0u; + exiFrag->CanonicalizationMethod_isUsed = 0u; + exiFrag->X509SerialNumber_isUsed = 0u; + exiFrag->SignatureProperties_isUsed = 0u; + exiFrag->Reference_isUsed = 0u; + exiFrag->KeyName_isUsed = 0u; + exiFrag->P_isUsed = 0u; + exiFrag->SignatureValue_isUsed = 0u; + exiFrag->SignedInfo_isUsed = 0u; + exiFrag->KeyInfo_isUsed = 0u; + exiFrag->DigestMethod_isUsed = 0u; + exiFrag->SPKIData_isUsed = 0u; + exiFrag->Object_isUsed = 0u; + exiFrag->Exponent_isUsed = 0u; + exiFrag->X509IssuerName_isUsed = 0u; + exiFrag->X509SubjectName_isUsed = 0u; + exiFrag->PGPData_isUsed = 0u; + exiFrag->HMACOutputLength_isUsed = 0u; + exiFrag->DigestValue_isUsed = 0u; + exiFrag->MgmtData_isUsed = 0u; + exiFrag->KeyValue_isUsed = 0u; + exiFrag->SignatureProperty_isUsed = 0u; + exiFrag->DSAKeyValue_isUsed = 0u; + exiFrag->X509IssuerSerial_isUsed = 0u; + exiFrag->Y_isUsed = 0u; + exiFrag->J_isUsed = 0u; + exiFrag->Signature_isUsed = 0u; + exiFrag->Transform_isUsed = 0u; + exiFrag->PGPKeyID_isUsed = 0u; + exiFrag->Transforms_isUsed = 0u; + exiFrag->G_isUsed = 0u; + exiFrag->X509CRL_isUsed = 0u; + exiFrag->Q_isUsed = 0u; + exiFrag->XPath_isUsed = 0u; + exiFrag->SignatureMethod_isUsed = 0u; + exiFrag->RetrievalMethod_isUsed = 0u; + exiFrag->Manifest_isUsed = 0u; +} +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + +void init_xmldsigKeyValueType(struct xmldsigKeyValueType* xmldsigKeyValueType) { + xmldsigKeyValueType->DSAKeyValue_isUsed = 0u; + xmldsigKeyValueType->RSAKeyValue_isUsed = 0u; +} + +void init_xmldsigDSAKeyValueType(struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType) { + xmldsigDSAKeyValueType->P_isUsed = 0u; + xmldsigDSAKeyValueType->Q_isUsed = 0u; + xmldsigDSAKeyValueType->G_isUsed = 0u; + xmldsigDSAKeyValueType->J_isUsed = 0u; + xmldsigDSAKeyValueType->Seed_isUsed = 0u; + xmldsigDSAKeyValueType->PgenCounter_isUsed = 0u; +} + +void init_xmldsigRSAKeyValueType(struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType) { +} + +void init_xmldsigSignaturePropertiesType(struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType) { + xmldsigSignaturePropertiesType->Id_isUsed = 0u; + xmldsigSignaturePropertiesType->SignatureProperty.arrayLen = 0u; +} + +void init_xmldsigCanonicalizationMethodType(struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { +} + +void init_xmldsigObjectType(struct xmldsigObjectType* xmldsigObjectType) { + xmldsigObjectType->Id_isUsed = 0u; + xmldsigObjectType->MimeType_isUsed = 0u; + xmldsigObjectType->Encoding_isUsed = 0u; +} + +void init_xmldsigTransformsType(struct xmldsigTransformsType* xmldsigTransformsType) { + xmldsigTransformsType->Transform.arrayLen = 0u; +} + +void init_xmldsigTransformType(struct xmldsigTransformType* xmldsigTransformType) { + xmldsigTransformType->XPath.arrayLen = 0u; +} + +void init_xmldsigDigestMethodType(struct xmldsigDigestMethodType* xmldsigDigestMethodType) { +} + +void init_xmldsigSignatureType(struct xmldsigSignatureType* xmldsigSignatureType) { + xmldsigSignatureType->Id_isUsed = 0u; + xmldsigSignatureType->KeyInfo_isUsed = 0u; + xmldsigSignatureType->Object.arrayLen = 0u; +} + +void init_xmldsigReferenceType(struct xmldsigReferenceType* xmldsigReferenceType) { + xmldsigReferenceType->Id_isUsed = 0u; + xmldsigReferenceType->URI_isUsed = 0u; + xmldsigReferenceType->Type_isUsed = 0u; + xmldsigReferenceType->Transforms_isUsed = 0u; +} + +void init_xmldsigSPKIDataType(struct xmldsigSPKIDataType* xmldsigSPKIDataType) { + xmldsigSPKIDataType->SPKISexp.arrayLen = 0u; +} + +void init_xmldsigPGPDataType(struct xmldsigPGPDataType* xmldsigPGPDataType) { + xmldsigPGPDataType->PGPKeyID_isUsed = 0u; + xmldsigPGPDataType->PGPKeyPacket_isUsed = 0u; +} + +void init_xmldsigX509IssuerSerialType(struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType) { +} + +void init_xmldsigSignatureMethodType(struct xmldsigSignatureMethodType* xmldsigSignatureMethodType) { + xmldsigSignatureMethodType->HMACOutputLength_isUsed = 0u; +} + +void init_xmldsigRetrievalMethodType(struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType) { + xmldsigRetrievalMethodType->URI_isUsed = 0u; + xmldsigRetrievalMethodType->Type_isUsed = 0u; + xmldsigRetrievalMethodType->Transforms_isUsed = 0u; +} + +void init_xmldsigSignaturePropertyType(struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType) { + xmldsigSignaturePropertyType->Id_isUsed = 0u; +} + +void init_xmldsigSignedInfoType(struct xmldsigSignedInfoType* xmldsigSignedInfoType) { + xmldsigSignedInfoType->Id_isUsed = 0u; + xmldsigSignedInfoType->Reference.arrayLen = 0u; +} + +void init_xmldsigKeyInfoType(struct xmldsigKeyInfoType* xmldsigKeyInfoType) { + xmldsigKeyInfoType->Id_isUsed = 0u; + xmldsigKeyInfoType->KeyName.arrayLen = 0u; + xmldsigKeyInfoType->KeyValue.arrayLen = 0u; + xmldsigKeyInfoType->RetrievalMethod.arrayLen = 0u; + xmldsigKeyInfoType->X509Data.arrayLen = 0u; + xmldsigKeyInfoType->PGPData.arrayLen = 0u; + xmldsigKeyInfoType->SPKIData.arrayLen = 0u; + xmldsigKeyInfoType->MgmtData.arrayLen = 0u; +} + +void init_xmldsigManifestType(struct xmldsigManifestType* xmldsigManifestType) { + xmldsigManifestType->Id_isUsed = 0u; + xmldsigManifestType->Reference.arrayLen = 0u; +} + +void init_xmldsigSignatureValueType(struct xmldsigSignatureValueType* xmldsigSignatureValueType) { + xmldsigSignatureValueType->Id_isUsed = 0u; +} + +void init_xmldsigX509DataType(struct xmldsigX509DataType* xmldsigX509DataType) { + xmldsigX509DataType->X509IssuerSerial.arrayLen = 0u; + xmldsigX509DataType->X509SKI.arrayLen = 0u; + xmldsigX509DataType->X509SubjectName.arrayLen = 0u; + xmldsigX509DataType->X509Certificate.arrayLen = 0u; + xmldsigX509DataType->X509CRL.arrayLen = 0u; +} + + + +#endif /* DEPLOY_XMLDSIG_CODEC */ + +#endif + diff --git a/src/xmldsig/xmldsigEXIDatatypes.h b/src/xmldsig/xmldsigEXIDatatypes.h new file mode 100644 index 0000000..93f41fe --- /dev/null +++ b/src/xmldsig/xmldsigEXIDatatypes.h @@ -0,0 +1,856 @@ +/* + * 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 . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.3 + * @contact Joerg.Heuer@siemens.com + * + * Code generated by EXIdizer + * Schema: xmldsig-core-schema.xsd + * + * + ********************************************************************/ + + + +/** + * \file EXIDatatypes.h + * \brief Datatype definitions and structs for given XML Schema definitions and initialization methods + * + */ + +#ifndef EXI_xmldsig_DATATYPES_H +#define EXI_xmldsig_DATATYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define SUPPORT_YES 1 +#define SUPPORT_NO 2 +#define DEPLOY_XMLDSIG_CODEC SUPPORT_NO +#define DEPLOY_XMLDSIG_CODEC_FRAGMENT SUPPORT_NO + +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES + +#include + +#include "EXITypes.h" + + +/* Datatype definitions and structs for given XML Schema definitions */ + +#define UNION_YES 1 +#define UNION_NO 2 +#define SAVE_MEMORY_WITH_UNNAMED_UNION UNION_YES + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigObjectType_Id_CHARACTERS_SIZE 50 +#define xmldsigObjectType_MimeType_CHARACTERS_SIZE 50 +#define xmldsigObjectType_Encoding_CHARACTERS_SIZE 50 +struct xmldsigObjectType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigObjectType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ + struct { + exi_string_character_t characters[xmldsigObjectType_MimeType_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MimeType ; + unsigned int MimeType_isUsed:1; + /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigObjectType_Encoding_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Encoding ; + unsigned int Encoding_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigTransformType_Algorithm_CHARACTERS_SIZE 65 +#define xmldsigTransformType_XPath_CHARACTERS_SIZE 50 +#define xmldsigTransformType_XPath_ARRAY_SIZE 1 +struct xmldsigTransformType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigTransformType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":XPath, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[xmldsigTransformType_XPath_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[xmldsigTransformType_XPath_ARRAY_SIZE]; + uint16_t arrayLen; + } XPath; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigDigestMethodType_Algorithm_CHARACTERS_SIZE 65 +struct xmldsigDigestMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigDigestMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +#define xmldsigPGPDataType_PGPKeyID_BYTES_SIZE 350 +#define xmldsigPGPDataType_PGPKeyPacket_BYTES_SIZE 350 +struct xmldsigPGPDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[xmldsigPGPDataType_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + unsigned int PGPKeyID_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[xmldsigPGPDataType_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + unsigned int PGPKeyPacket_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +#define xmldsigDSAKeyValueType_P_BYTES_SIZE 350 +#define xmldsigDSAKeyValueType_Q_BYTES_SIZE 350 +#define xmldsigDSAKeyValueType_G_BYTES_SIZE 350 +#define xmldsigDSAKeyValueType_Y_BYTES_SIZE 350 +#define xmldsigDSAKeyValueType_J_BYTES_SIZE 350 +#define xmldsigDSAKeyValueType_Seed_BYTES_SIZE 350 +#define xmldsigDSAKeyValueType_PgenCounter_BYTES_SIZE 350 +struct xmldsigDSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":P, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigDSAKeyValueType_P_BYTES_SIZE]; + uint16_t bytesLen; + } P ; + unsigned int P_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Q, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigDSAKeyValueType_Q_BYTES_SIZE]; + uint16_t bytesLen; + } Q ; + unsigned int Q_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":G, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigDSAKeyValueType_G_BYTES_SIZE]; + uint16_t bytesLen; + } G ; + unsigned int G_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Y, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigDSAKeyValueType_Y_BYTES_SIZE]; + uint16_t bytesLen; + } Y ; + /* element: "http://www.w3.org/2000/09/xmldsig#":J, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigDSAKeyValueType_J_BYTES_SIZE]; + uint16_t bytesLen; + } J ; + unsigned int J_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Seed, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigDSAKeyValueType_Seed_BYTES_SIZE]; + uint16_t bytesLen; + } Seed ; + unsigned int Seed_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PgenCounter, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigDSAKeyValueType_PgenCounter_BYTES_SIZE]; + uint16_t bytesLen; + } PgenCounter ; + unsigned int PgenCounter_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define xmldsigSignatureValueType_Id_CHARACTERS_SIZE 50 +#define xmldsigSignatureValueType_CONTENT_BYTES_SIZE 350 +struct xmldsigSignatureValueType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignatureValueType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[xmldsigSignatureValueType_CONTENT_BYTES_SIZE]; + uint16_t bytesLen; + } CONTENT ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +#define xmldsigX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 +struct xmldsigX509IssuerSerialType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[xmldsigX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ + int64_t X509SerialNumber ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +#define xmldsigRSAKeyValueType_Modulus_BYTES_SIZE 350 +#define xmldsigRSAKeyValueType_Exponent_BYTES_SIZE 350 +struct xmldsigRSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigRSAKeyValueType_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[xmldsigRSAKeyValueType_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509SKI_BYTES_SIZE 350 +#define xmldsigX509DataType_X509SKI_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE 50 +#define xmldsigX509DataType_X509SubjectName_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509Certificate_BYTES_SIZE 350 +#define xmldsigX509DataType_X509Certificate_ARRAY_SIZE 1 +#define xmldsigX509DataType_X509CRL_BYTES_SIZE 350 +#define xmldsigX509DataType_X509CRL_ARRAY_SIZE 1 +struct xmldsigX509DataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigX509IssuerSerialType array[xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE]; + uint16_t arrayLen; + } X509IssuerSerial; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SKI, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigX509DataType_X509SKI_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigX509DataType_X509SKI_ARRAY_SIZE]; + uint16_t arrayLen; + } X509SKI; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SubjectName, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[xmldsigX509DataType_X509SubjectName_ARRAY_SIZE]; + uint16_t arrayLen; + } X509SubjectName; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509Certificate, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigX509DataType_X509Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigX509DataType_X509Certificate_ARRAY_SIZE]; + uint16_t arrayLen; + } X509Certificate; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509CRL, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigX509DataType_X509CRL_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigX509DataType_X509CRL_ARRAY_SIZE]; + uint16_t arrayLen; + } X509CRL; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigSignatureMethodType_Algorithm_CHARACTERS_SIZE 65 +struct xmldsigSignatureMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigSignatureMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ + int64_t HMACOutputLength ; + unsigned int HMACOutputLength_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigSPKIDataType_SPKISexp_BYTES_SIZE 350 +#define xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE 1 +struct xmldsigSPKIDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[xmldsigSPKIDataType_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } array[xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE]; + uint16_t arrayLen; + } SPKISexp; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE 50 +#define xmldsigSignaturePropertyType_Id_CHARACTERS_SIZE 50 +struct xmldsigSignaturePropertyType { + /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Target ; + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignaturePropertyType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 65 +struct xmldsigCanonicalizationMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigTransformsType_Transform_ARRAY_SIZE 1 +struct xmldsigTransformsType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigTransformType array[xmldsigTransformsType_Transform_ARRAY_SIZE]; + uint16_t arrayLen; + } Transform; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +struct xmldsigKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ + struct xmldsigDSAKeyValueType DSAKeyValue ; + unsigned int DSAKeyValue_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ + struct xmldsigRSAKeyValueType RSAKeyValue ; + unsigned int RSAKeyValue_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +#define xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE 50 +#define xmldsigRetrievalMethodType_Type_CHARACTERS_SIZE 50 +struct xmldsigRetrievalMethodType { + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigRetrievalMethodType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct xmldsigTransformsType Transforms ; + unsigned int Transforms_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigSignaturePropertiesType_Id_CHARACTERS_SIZE 50 +#define xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 1 +struct xmldsigSignaturePropertiesType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignaturePropertiesType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigSignaturePropertyType array[xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; + uint16_t arrayLen; + } SignatureProperty; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +#define xmldsigReferenceType_Id_CHARACTERS_SIZE 50 +#define xmldsigReferenceType_URI_CHARACTERS_SIZE 50 +#define xmldsigReferenceType_Type_CHARACTERS_SIZE 50 +#define xmldsigReferenceType_DigestValue_BYTES_SIZE 350 +struct xmldsigReferenceType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigReferenceType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigReferenceType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[xmldsigReferenceType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct xmldsigTransformsType Transforms ; + unsigned int Transforms_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct xmldsigDigestMethodType DigestMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestValue, http://www.w3.org/2000/09/xmldsig#,DigestValueType */ + struct { + uint8_t bytes[xmldsigReferenceType_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigSignedInfoType_Id_CHARACTERS_SIZE 50 +#define xmldsigSignedInfoType_Reference_ARRAY_SIZE 1 +struct xmldsigSignedInfoType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignedInfoType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct xmldsigCanonicalizationMethodType CanonicalizationMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct xmldsigSignatureMethodType SignatureMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigReferenceType array[xmldsigSignedInfoType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define xmldsigKeyInfoType_Id_CHARACTERS_SIZE 50 +#define xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE 50 +#define xmldsigKeyInfoType_KeyName_ARRAY_SIZE 1 +#define xmldsigKeyInfoType_KeyValue_ARRAY_SIZE 1 +#define xmldsigKeyInfoType_RetrievalMethod_ARRAY_SIZE 1 +#define xmldsigKeyInfoType_X509Data_ARRAY_SIZE 1 +#define xmldsigKeyInfoType_PGPData_ARRAY_SIZE 1 +#define xmldsigKeyInfoType_SPKIData_ARRAY_SIZE 1 +#define xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE 50 +#define xmldsigKeyInfoType_MgmtData_ARRAY_SIZE 1 +struct xmldsigKeyInfoType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigKeyInfoType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyName, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[xmldsigKeyInfoType_KeyName_ARRAY_SIZE]; + uint16_t arrayLen; + } KeyName; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigKeyValueType array[xmldsigKeyInfoType_KeyValue_ARRAY_SIZE]; + uint16_t arrayLen; + } KeyValue; + /* element: "http://www.w3.org/2000/09/xmldsig#":RetrievalMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigRetrievalMethodType array[xmldsigKeyInfoType_RetrievalMethod_ARRAY_SIZE]; + uint16_t arrayLen; + } RetrievalMethod; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509Data, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigX509DataType array[xmldsigKeyInfoType_X509Data_ARRAY_SIZE]; + uint16_t arrayLen; + } X509Data; + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPData, Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigPGPDataType array[xmldsigKeyInfoType_PGPData_ARRAY_SIZE]; + uint16_t arrayLen; + } PGPData; + /* element: "http://www.w3.org/2000/09/xmldsig#":SPKIData, Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigSPKIDataType array[xmldsigKeyInfoType_SPKIData_ARRAY_SIZE]; + uint16_t arrayLen; + } SPKIData; + /* element: "http://www.w3.org/2000/09/xmldsig#":MgmtData, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[xmldsigKeyInfoType_MgmtData_ARRAY_SIZE]; + uint16_t arrayLen; + } MgmtData; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigManifestType_Id_CHARACTERS_SIZE 50 +#define xmldsigManifestType_Reference_ARRAY_SIZE 1 +struct xmldsigManifestType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigManifestType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigReferenceType array[xmldsigManifestType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define xmldsigSignatureType_Id_CHARACTERS_SIZE 50 +#define xmldsigSignatureType_Object_ARRAY_SIZE 1 +struct xmldsigSignatureType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[xmldsigSignatureType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignedInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct xmldsigSignedInfoType SignedInfo ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct xmldsigSignatureValueType SignatureValue ; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct xmldsigKeyInfoType KeyInfo ; + unsigned int KeyInfo_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Object, Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct xmldsigObjectType array[xmldsigSignatureType_Object_ARRAY_SIZE]; + uint16_t arrayLen; + } Object; +}; + + + +#define EXIDocument_MgmtData_CHARACTERS_SIZE 50 +#define EXIDocument_KeyName_CHARACTERS_SIZE 50 +#define EXIDocument_DigestValue_BYTES_SIZE 350 +#define EXIFragment_PGPKeyPacket_BYTES_SIZE 350 +#define EXIFragment_PgenCounter_BYTES_SIZE 350 +#define EXIFragment_X509Certificate_BYTES_SIZE 350 +#define EXIFragment_Seed_BYTES_SIZE 350 +#define EXIFragment_Modulus_BYTES_SIZE 350 +#define EXIFragment_X509SKI_BYTES_SIZE 350 +#define EXIFragment_SPKISexp_BYTES_SIZE 350 +#define EXIFragment_KeyName_CHARACTERS_SIZE 50 +#define EXIFragment_P_BYTES_SIZE 350 +#define EXIFragment_Exponent_BYTES_SIZE 350 +#define EXIFragment_X509IssuerName_CHARACTERS_SIZE 50 +#define EXIFragment_X509SubjectName_CHARACTERS_SIZE 50 +#define EXIFragment_DigestValue_BYTES_SIZE 350 +#define EXIFragment_MgmtData_CHARACTERS_SIZE 50 +#define EXIFragment_Y_BYTES_SIZE 350 +#define EXIFragment_J_BYTES_SIZE 350 +#define EXIFragment_PGPKeyID_BYTES_SIZE 350 +#define EXIFragment_G_BYTES_SIZE 350 +#define EXIFragment_X509CRL_BYTES_SIZE 350 +#define EXIFragment_Q_BYTES_SIZE 350 +#define EXIFragment_XPath_CHARACTERS_SIZE 50 + + +/* Global elements of EXI Document */ +struct xmldsigEXIDocument { +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + union { +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + struct xmldsigSignaturePropertyType SignatureProperty ; + struct xmldsigDSAKeyValueType DSAKeyValue ; + struct xmldsigSignaturePropertiesType SignatureProperties ; + struct xmldsigKeyValueType KeyValue ; + struct xmldsigTransformsType Transforms ; + struct xmldsigDigestMethodType DigestMethod ; + struct xmldsigSignatureType Signature ; + struct xmldsigRetrievalMethodType RetrievalMethod ; + struct xmldsigManifestType Manifest ; + struct xmldsigReferenceType Reference ; + struct xmldsigCanonicalizationMethodType CanonicalizationMethod ; + struct xmldsigRSAKeyValueType RSAKeyValue ; + struct xmldsigTransformType Transform ; + struct xmldsigPGPDataType PGPData ; + struct { + exi_string_character_t characters[EXIDocument_MgmtData_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MgmtData ; + struct xmldsigSignatureMethodType SignatureMethod ; + struct xmldsigKeyInfoType KeyInfo ; + struct xmldsigSPKIDataType SPKIData ; + struct xmldsigX509DataType X509Data ; + struct xmldsigSignatureValueType SignatureValue ; + struct { + exi_string_character_t characters[EXIDocument_KeyName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } KeyName ; + struct { + uint8_t bytes[EXIDocument_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; + struct xmldsigSignedInfoType SignedInfo ; + struct xmldsigObjectType Object ; +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + }; +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + unsigned int SignatureProperty_isUsed:1; + unsigned int DSAKeyValue_isUsed:1; + unsigned int SignatureProperties_isUsed:1; + unsigned int KeyValue_isUsed:1; + unsigned int Transforms_isUsed:1; + unsigned int DigestMethod_isUsed:1; + unsigned int Signature_isUsed:1; + unsigned int RetrievalMethod_isUsed:1; + unsigned int Manifest_isUsed:1; + unsigned int Reference_isUsed:1; + unsigned int CanonicalizationMethod_isUsed:1; + unsigned int RSAKeyValue_isUsed:1; + unsigned int Transform_isUsed:1; + unsigned int PGPData_isUsed:1; + unsigned int MgmtData_isUsed:1; + unsigned int SignatureMethod_isUsed:1; + unsigned int KeyInfo_isUsed:1; + unsigned int SPKIData_isUsed:1; + unsigned int X509Data_isUsed:1; + unsigned int SignatureValue_isUsed:1; + unsigned int KeyName_isUsed:1; + unsigned int DigestValue_isUsed:1; + unsigned int SignedInfo_isUsed:1; + unsigned int Object_isUsed:1; + + + int _warning_; +}; + +#if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES +/* Possible elements of EXI Fragment */ +struct xmldsigEXIFragment { +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + union { +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + struct xmldsigRSAKeyValueType RSAKeyValue ; + struct { + uint8_t bytes[EXIFragment_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + struct xmldsigX509DataType X509Data ; + struct { + uint8_t bytes[EXIFragment_PgenCounter_BYTES_SIZE]; + uint16_t bytesLen; + } PgenCounter ; + struct { + uint8_t bytes[EXIFragment_X509Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } X509Certificate ; + struct { + uint8_t bytes[EXIFragment_Seed_BYTES_SIZE]; + uint16_t bytesLen; + } Seed ; + struct { + uint8_t bytes[EXIFragment_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + struct { + uint8_t bytes[EXIFragment_X509SKI_BYTES_SIZE]; + uint16_t bytesLen; + } X509SKI ; + struct { + uint8_t bytes[EXIFragment_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } SPKISexp ; + struct xmldsigCanonicalizationMethodType CanonicalizationMethod ; + int64_t X509SerialNumber ; + struct xmldsigSignaturePropertiesType SignatureProperties ; + struct xmldsigReferenceType Reference ; + struct { + exi_string_character_t characters[EXIFragment_KeyName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } KeyName ; + struct { + uint8_t bytes[EXIFragment_P_BYTES_SIZE]; + uint16_t bytesLen; + } P ; + struct xmldsigSignatureValueType SignatureValue ; + struct xmldsigSignedInfoType SignedInfo ; + struct xmldsigKeyInfoType KeyInfo ; + struct xmldsigDigestMethodType DigestMethod ; + struct xmldsigSPKIDataType SPKIData ; + struct xmldsigObjectType Object ; + struct { + uint8_t bytes[EXIFragment_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; + struct { + exi_string_character_t characters[EXIFragment_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + struct { + exi_string_character_t characters[EXIFragment_X509SubjectName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509SubjectName ; + struct xmldsigPGPDataType PGPData ; + int64_t HMACOutputLength ; + struct { + uint8_t bytes[EXIFragment_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; + struct { + exi_string_character_t characters[EXIFragment_MgmtData_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MgmtData ; + struct xmldsigKeyValueType KeyValue ; + struct xmldsigSignaturePropertyType SignatureProperty ; + struct xmldsigDSAKeyValueType DSAKeyValue ; + struct xmldsigX509IssuerSerialType X509IssuerSerial ; + struct { + uint8_t bytes[EXIFragment_Y_BYTES_SIZE]; + uint16_t bytesLen; + } Y ; + struct { + uint8_t bytes[EXIFragment_J_BYTES_SIZE]; + uint16_t bytesLen; + } J ; + struct xmldsigSignatureType Signature ; + struct xmldsigTransformType Transform ; + struct { + uint8_t bytes[EXIFragment_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + struct xmldsigTransformsType Transforms ; + struct { + uint8_t bytes[EXIFragment_G_BYTES_SIZE]; + uint16_t bytesLen; + } G ; + struct { + uint8_t bytes[EXIFragment_X509CRL_BYTES_SIZE]; + uint16_t bytesLen; + } X509CRL ; + struct { + uint8_t bytes[EXIFragment_Q_BYTES_SIZE]; + uint16_t bytesLen; + } Q ; + struct { + exi_string_character_t characters[EXIFragment_XPath_CHARACTERS_SIZE]; + uint16_t charactersLen; + } XPath ; + struct xmldsigSignatureMethodType SignatureMethod ; + struct xmldsigRetrievalMethodType RetrievalMethod ; + struct xmldsigManifestType Manifest ; +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES + }; +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ + unsigned int RSAKeyValue_isUsed:1; + unsigned int PGPKeyPacket_isUsed:1; + unsigned int X509Data_isUsed:1; + unsigned int PgenCounter_isUsed:1; + unsigned int X509Certificate_isUsed:1; + unsigned int Seed_isUsed:1; + unsigned int Modulus_isUsed:1; + unsigned int X509SKI_isUsed:1; + unsigned int SPKISexp_isUsed:1; + unsigned int CanonicalizationMethod_isUsed:1; + unsigned int X509SerialNumber_isUsed:1; + unsigned int SignatureProperties_isUsed:1; + unsigned int Reference_isUsed:1; + unsigned int KeyName_isUsed:1; + unsigned int P_isUsed:1; + unsigned int SignatureValue_isUsed:1; + unsigned int SignedInfo_isUsed:1; + unsigned int KeyInfo_isUsed:1; + unsigned int DigestMethod_isUsed:1; + unsigned int SPKIData_isUsed:1; + unsigned int Object_isUsed:1; + unsigned int Exponent_isUsed:1; + unsigned int X509IssuerName_isUsed:1; + unsigned int X509SubjectName_isUsed:1; + unsigned int PGPData_isUsed:1; + unsigned int HMACOutputLength_isUsed:1; + unsigned int DigestValue_isUsed:1; + unsigned int MgmtData_isUsed:1; + unsigned int KeyValue_isUsed:1; + unsigned int SignatureProperty_isUsed:1; + unsigned int DSAKeyValue_isUsed:1; + unsigned int X509IssuerSerial_isUsed:1; + unsigned int Y_isUsed:1; + unsigned int J_isUsed:1; + unsigned int Signature_isUsed:1; + unsigned int Transform_isUsed:1; + unsigned int PGPKeyID_isUsed:1; + unsigned int Transforms_isUsed:1; + unsigned int G_isUsed:1; + unsigned int X509CRL_isUsed:1; + unsigned int Q_isUsed:1; + unsigned int XPath_isUsed:1; + unsigned int SignatureMethod_isUsed:1; + unsigned int RetrievalMethod_isUsed:1; + unsigned int Manifest_isUsed:1; + + + int _warning_; +}; +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + +/* Initialization methods for structs */ + +void init_xmldsigEXIDocument(struct xmldsigEXIDocument* exiDoc); +#if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES +void init_xmldsigEXIFragment(struct xmldsigEXIFragment* exiFrag); +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ +void init_xmldsigKeyValueType(struct xmldsigKeyValueType* xmldsigKeyValueType); +void init_xmldsigDSAKeyValueType(struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); +void init_xmldsigRSAKeyValueType(struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); +void init_xmldsigSignaturePropertiesType(struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); +void init_xmldsigCanonicalizationMethodType(struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType); +void init_xmldsigObjectType(struct xmldsigObjectType* xmldsigObjectType); +void init_xmldsigTransformsType(struct xmldsigTransformsType* xmldsigTransformsType); +void init_xmldsigTransformType(struct xmldsigTransformType* xmldsigTransformType); +void init_xmldsigDigestMethodType(struct xmldsigDigestMethodType* xmldsigDigestMethodType); +void init_xmldsigSignatureType(struct xmldsigSignatureType* xmldsigSignatureType); +void init_xmldsigReferenceType(struct xmldsigReferenceType* xmldsigReferenceType); +void init_xmldsigSPKIDataType(struct xmldsigSPKIDataType* xmldsigSPKIDataType); +void init_xmldsigPGPDataType(struct xmldsigPGPDataType* xmldsigPGPDataType); +void init_xmldsigX509IssuerSerialType(struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); +void init_xmldsigSignatureMethodType(struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); +void init_xmldsigRetrievalMethodType(struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); +void init_xmldsigSignaturePropertyType(struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); +void init_xmldsigSignedInfoType(struct xmldsigSignedInfoType* xmldsigSignedInfoType); +void init_xmldsigKeyInfoType(struct xmldsigKeyInfoType* xmldsigKeyInfoType); +void init_xmldsigManifestType(struct xmldsigManifestType* xmldsigManifestType); +void init_xmldsigSignatureValueType(struct xmldsigSignatureValueType* xmldsigSignatureValueType); +void init_xmldsigX509DataType(struct xmldsigX509DataType* xmldsigX509DataType); + + +#endif /* DEPLOY_XMLDSIG_CODEC */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/xmldsig/xmldsigEXIDatatypesDecoder.c b/src/xmldsig/xmldsigEXIDatatypesDecoder.c new file mode 100644 index 0000000..a66ee00 --- /dev/null +++ b/src/xmldsig/xmldsigEXIDatatypesDecoder.c @@ -0,0 +1,4807 @@ +/* + * 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 . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.3 + * @contact Joerg.Heuer@siemens.com + * + * Code generated by EXIdizer + * Schema: xmldsig-core-schema.xsd + * + * + ********************************************************************/ + + + + +#include "xmldsigEXIDatatypesDecoder.h" + +#include "DecoderChannel.h" +#include "EXIHeaderDecoder.h" + +#include "xmldsigEXIDatatypes.h" +#include "ErrorCodes.h" + +#ifndef EXI_xmldsig_DATATYPES_DECODER_C +#define EXI_xmldsig_DATATYPES_DECODER_C + +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES + +/** event-code */ +static uint32_t eventCode; +static int errn; +static uint32_t uint32; + + +/* Forward Declarations */ +static int decode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType); +static int decode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); +static int decode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); +static int decode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); +static int decode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType); +static int decode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType); +static int decode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType); +static int decode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType); +static int decode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType); +static int decode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignatureType* xmldsigSignatureType); +static int decode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigReferenceType* xmldsigReferenceType); +static int decode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDataType* xmldsigSPKIDataType); +static int decode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType); +static int decode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); +static int decode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); +static int decode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); +static int decode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); +static int decode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType); +static int decode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoType* xmldsigKeyInfoType); +static int decode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType); +static int decode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType); +static int decode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType); + +/* Deviant data decoding (skip functions) */ +static int decodeDeviationsCH(bitstream_t* stream) { + int i=0; + uint16_t uint16; + errn = 0; + + errn = decodeUnsignedInteger16(stream, &uint16); + if (errn == 0) { + for(i=0; iDSAKeyValue); + xmldsigKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 1; + break; + case 1: + errn = decode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue); + xmldsigKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 1; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 1; + break; + case 3: + errn = decodeDeviationsCH(stream); + grammarID = 2; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 1: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 3; + break; + case 1: + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 2: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigDSAKeyValueType(stream, &xmldsigKeyValueType->DSAKeyValue); + xmldsigKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 1; + break; + case 1: + errn = decode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue); + xmldsigKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 1; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 1; + break; + case 3: + grammarID = 2; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType) { + int grammarID = 4; + int done = 0; + + init_xmldsigDSAKeyValueType(xmldsigDSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 4: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->P.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->P.bytesLen) <= xmldsigDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->P.bytesLen, xmldsigDSAKeyValueType->P.bytes); + } + xmldsigDSAKeyValueType->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->G.bytesLen) <= xmldsigDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->G.bytesLen, xmldsigDSAKeyValueType->G.bytes); + } + xmldsigDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 6; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->Y.bytesLen) <= xmldsigDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->Y.bytesLen, xmldsigDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 7; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 5: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->Q.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->Q.bytesLen) <= xmldsigDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->Q.bytesLen, xmldsigDSAKeyValueType->Q.bytes); + } + xmldsigDSAKeyValueType->Q_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 8; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 8: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->G.bytesLen) <= xmldsigDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->G.bytesLen, xmldsigDSAKeyValueType->G.bytes); + } + xmldsigDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 6; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->Y.bytesLen) <= xmldsigDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->Y.bytesLen, xmldsigDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 7; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 6: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->Y.bytesLen) <= xmldsigDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->Y.bytesLen, xmldsigDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 7; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 7: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->J.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->J.bytesLen) <= xmldsigDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->J.bytesLen, xmldsigDSAKeyValueType->J.bytes); + } + xmldsigDSAKeyValueType->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 9; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->Seed.bytesLen) <= xmldsigDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytesLen, xmldsigDSAKeyValueType->Seed.bytes); + } + xmldsigDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 9: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->Seed.bytesLen) <= xmldsigDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytesLen, xmldsigDSAKeyValueType->Seed.bytes); + } + xmldsigDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 10; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 10: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigDSAKeyValueType->PgenCounter.bytesLen); + if (errn == 0) { + errn = (xmldsigDSAKeyValueType->PgenCounter.bytesLen) <= xmldsigDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigDSAKeyValueType->PgenCounter.bytesLen, xmldsigDSAKeyValueType->PgenCounter.bytes); + } + xmldsigDSAKeyValueType->PgenCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 11; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int decode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType) { + int grammarID = 12; + int done = 0; + + init_xmldsigRSAKeyValueType(xmldsigRSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 12: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigRSAKeyValueType->Modulus.bytesLen); + if (errn == 0) { + errn = (xmldsigRSAKeyValueType->Modulus.bytesLen) <= xmldsigRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigRSAKeyValueType->Modulus.bytesLen, xmldsigRSAKeyValueType->Modulus.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 13; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 13: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigRSAKeyValueType->Exponent.bytesLen); + if (errn == 0) { + errn = (xmldsigRSAKeyValueType->Exponent.bytesLen) <= xmldsigRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigRSAKeyValueType->Exponent.bytesLen, xmldsigRSAKeyValueType->Exponent.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 11; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType) { + int grammarID = 14; + int done = 0; + + init_xmldsigSignaturePropertiesType(xmldsigSignaturePropertiesType); + + while(!done) { + switch(grammarID) { + case 14: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignaturePropertiesType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigSignaturePropertiesType->Id.charactersLen - 2) <= xmldsigSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignaturePropertiesType->Id.charactersLen >= 2) { + xmldsigSignaturePropertiesType->Id.charactersLen = (uint16_t)(xmldsigSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignaturePropertiesType->Id.charactersLen, xmldsigSignaturePropertiesType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigSignaturePropertiesType->Id_isUsed = 1u; + grammarID = 15; + break; + case 1: + if (xmldsigSignaturePropertiesType->SignatureProperty.arrayLen < xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array[xmldsigSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 16; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 15: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSignaturePropertiesType->SignatureProperty.arrayLen < xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array[xmldsigSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 16; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 16: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSignaturePropertiesType->SignatureProperty.arrayLen < xmldsigSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array[xmldsigSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 16; + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { + int grammarID = 17; + int done = 0; + + init_xmldsigCanonicalizationMethodType(xmldsigCanonicalizationMethodType); + + while(!done) { + switch(grammarID) { + case 17: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigCanonicalizationMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (xmldsigCanonicalizationMethodType->Algorithm.charactersLen - 2) <= xmldsigCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigCanonicalizationMethodType->Algorithm.charactersLen >= 2) { + xmldsigCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(xmldsigCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigCanonicalizationMethodType->Algorithm.charactersLen, xmldsigCanonicalizationMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 18; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 18: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType) { + int grammarID = 20; + int done = 0; + + init_xmldsigObjectType(xmldsigObjectType); + + while(!done) { + switch(grammarID) { + case 20: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigObjectType->Encoding.charactersLen); + if (errn == 0) { + errn = (xmldsigObjectType->Encoding.charactersLen - 2) <= xmldsigObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigObjectType->Encoding.charactersLen >= 2) { + xmldsigObjectType->Encoding.charactersLen = (uint16_t)(xmldsigObjectType->Encoding.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigObjectType->Encoding.charactersLen, xmldsigObjectType->Encoding.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigObjectType->Encoding_isUsed = 1u; + grammarID = 21; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &xmldsigObjectType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigObjectType->Id.charactersLen - 2) <= xmldsigObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigObjectType->Id.charactersLen >= 2) { + xmldsigObjectType->Id.charactersLen = (uint16_t)(xmldsigObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigObjectType->Id.charactersLen, xmldsigObjectType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigObjectType->Id_isUsed = 1u; + grammarID = 22; + break; + case 2: + errn = decodeUnsignedInteger16(stream, &xmldsigObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (xmldsigObjectType->MimeType.charactersLen - 2) <= xmldsigObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigObjectType->MimeType.charactersLen >= 2) { + xmldsigObjectType->MimeType.charactersLen = (uint16_t)(xmldsigObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigObjectType->MimeType.charactersLen, xmldsigObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigObjectType->MimeType_isUsed = 1u; + grammarID = 18; + break; + case 3: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 4: + done = 1; + grammarID = 3; + break; + case 5: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 21: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigObjectType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigObjectType->Id.charactersLen - 2) <= xmldsigObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigObjectType->Id.charactersLen >= 2) { + xmldsigObjectType->Id.charactersLen = (uint16_t)(xmldsigObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigObjectType->Id.charactersLen, xmldsigObjectType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigObjectType->Id_isUsed = 1u; + grammarID = 22; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &xmldsigObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (xmldsigObjectType->MimeType.charactersLen - 2) <= xmldsigObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigObjectType->MimeType.charactersLen >= 2) { + xmldsigObjectType->MimeType.charactersLen = (uint16_t)(xmldsigObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigObjectType->MimeType.charactersLen, xmldsigObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigObjectType->MimeType_isUsed = 1u; + grammarID = 18; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 3: + done = 1; + grammarID = 3; + break; + case 4: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 22: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (xmldsigObjectType->MimeType.charactersLen - 2) <= xmldsigObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigObjectType->MimeType.charactersLen >= 2) { + xmldsigObjectType->MimeType.charactersLen = (uint16_t)(xmldsigObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigObjectType->MimeType.charactersLen, xmldsigObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigObjectType->MimeType_isUsed = 1u; + grammarID = 18; + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 2: + done = 1; + grammarID = 3; + break; + case 3: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 18: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType) { + int grammarID = 23; + int done = 0; + + init_xmldsigTransformsType(xmldsigTransformsType); + + while(!done) { + switch(grammarID) { + case 23: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigTransformsType->Transform.arrayLen < xmldsigTransformsType_Transform_ARRAY_SIZE) { + errn = decode_xmldsigTransformType(stream, &xmldsigTransformsType->Transform.array[xmldsigTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 24: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigTransformsType->Transform.arrayLen < xmldsigTransformsType_Transform_ARRAY_SIZE) { + errn = decode_xmldsigTransformType(stream, &xmldsigTransformsType->Transform.array[xmldsigTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType) { + int grammarID = 25; + int done = 0; + + init_xmldsigTransformType(xmldsigTransformType); + + while(!done) { + switch(grammarID) { + case 25: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigTransformType->Algorithm.charactersLen); + if (errn == 0) { + errn = (xmldsigTransformType->Algorithm.charactersLen - 2) <= xmldsigTransformType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigTransformType->Algorithm.charactersLen >= 2) { + xmldsigTransformType->Algorithm.charactersLen = (uint16_t)(xmldsigTransformType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigTransformType->Algorithm.charactersLen, xmldsigTransformType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 26; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 26: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigTransformType->XPath.arrayLen < xmldsigTransformType_XPath_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen - 2) <= xmldsigTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen >= 2) { + xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen = (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen, xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigTransformType->XPath.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 27; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 27; + break; + case 2: + done = 1; + grammarID = 3; + break; + case 3: + grammarID = 27; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 27: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigTransformType->XPath.arrayLen < xmldsigTransformType_XPath_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen - 2) <= xmldsigTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen >= 2) { + xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen = (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].charactersLen, xmldsigTransformType->XPath.array[xmldsigTransformType->XPath.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigTransformType->XPath.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 27; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 27; + break; + case 2: + done = 1; + grammarID = 3; + break; + case 3: + grammarID = 27; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType) { + int grammarID = 17; + int done = 0; + + init_xmldsigDigestMethodType(xmldsigDigestMethodType); + + while(!done) { + switch(grammarID) { + case 17: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigDigestMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (xmldsigDigestMethodType->Algorithm.charactersLen - 2) <= xmldsigDigestMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigDigestMethodType->Algorithm.charactersLen >= 2) { + xmldsigDigestMethodType->Algorithm.charactersLen = (uint16_t)(xmldsigDigestMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigDigestMethodType->Algorithm.charactersLen, xmldsigDigestMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 18; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 18: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignatureType* xmldsigSignatureType) { + int grammarID = 28; + int done = 0; + + init_xmldsigSignatureType(xmldsigSignatureType); + + while(!done) { + switch(grammarID) { + case 28: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignatureType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigSignatureType->Id.charactersLen - 2) <= xmldsigSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignatureType->Id.charactersLen >= 2) { + xmldsigSignatureType->Id.charactersLen = (uint16_t)(xmldsigSignatureType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignatureType->Id.charactersLen, xmldsigSignatureType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigSignatureType->Id_isUsed = 1u; + grammarID = 29; + break; + case 1: + errn = decode_xmldsigSignedInfoType(stream, &xmldsigSignatureType->SignedInfo); + grammarID = 30; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 29: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigSignedInfoType(stream, &xmldsigSignatureType->SignedInfo); + grammarID = 30; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 30: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigSignatureValueType(stream, &xmldsigSignatureType->SignatureValue); + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 31: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigKeyInfoType(stream, &xmldsigSignatureType->KeyInfo); + xmldsigSignatureType->KeyInfo_isUsed = 1u; + grammarID = 32; + break; + case 1: + if (xmldsigSignatureType->Object.arrayLen < xmldsigSignatureType_Object_ARRAY_SIZE) { + errn = decode_xmldsigObjectType(stream, &xmldsigSignatureType->Object.array[xmldsigSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 32; + break; + case 2: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 32: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSignatureType->Object.arrayLen < xmldsigSignatureType_Object_ARRAY_SIZE) { + errn = decode_xmldsigObjectType(stream, &xmldsigSignatureType->Object.array[xmldsigSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 32; + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int decode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigReferenceType* xmldsigReferenceType) { + int grammarID = 33; + int done = 0; + + init_xmldsigReferenceType(xmldsigReferenceType); + + while(!done) { + switch(grammarID) { + case 33: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigReferenceType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigReferenceType->Id.charactersLen - 2) <= xmldsigReferenceType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigReferenceType->Id.charactersLen >= 2) { + xmldsigReferenceType->Id.charactersLen = (uint16_t)(xmldsigReferenceType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigReferenceType->Id.charactersLen, xmldsigReferenceType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigReferenceType->Id_isUsed = 1u; + grammarID = 34; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &xmldsigReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (xmldsigReferenceType->Type.charactersLen - 2) <= xmldsigReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigReferenceType->Type.charactersLen >= 2) { + xmldsigReferenceType->Type.charactersLen = (uint16_t)(xmldsigReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigReferenceType->Type.charactersLen, xmldsigReferenceType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigReferenceType->Type_isUsed = 1u; + grammarID = 35; + break; + case 2: + errn = decodeUnsignedInteger16(stream, &xmldsigReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (xmldsigReferenceType->URI.charactersLen - 2) <= xmldsigReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigReferenceType->URI.charactersLen >= 2) { + xmldsigReferenceType->URI.charactersLen = (uint16_t)(xmldsigReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigReferenceType->URI.charactersLen, xmldsigReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigReferenceType->URI_isUsed = 1u; + grammarID = 36; + break; + case 3: + errn = decode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms); + xmldsigReferenceType->Transforms_isUsed = 1u; + grammarID = 37; + break; + case 4: + errn = decode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod); + grammarID = 38; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 34: + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (xmldsigReferenceType->Type.charactersLen - 2) <= xmldsigReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigReferenceType->Type.charactersLen >= 2) { + xmldsigReferenceType->Type.charactersLen = (uint16_t)(xmldsigReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigReferenceType->Type.charactersLen, xmldsigReferenceType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigReferenceType->Type_isUsed = 1u; + grammarID = 35; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &xmldsigReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (xmldsigReferenceType->URI.charactersLen - 2) <= xmldsigReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigReferenceType->URI.charactersLen >= 2) { + xmldsigReferenceType->URI.charactersLen = (uint16_t)(xmldsigReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigReferenceType->URI.charactersLen, xmldsigReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigReferenceType->URI_isUsed = 1u; + grammarID = 36; + break; + case 2: + errn = decode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms); + xmldsigReferenceType->Transforms_isUsed = 1u; + grammarID = 37; + break; + case 3: + errn = decode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod); + grammarID = 38; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 35: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (xmldsigReferenceType->URI.charactersLen - 2) <= xmldsigReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigReferenceType->URI.charactersLen >= 2) { + xmldsigReferenceType->URI.charactersLen = (uint16_t)(xmldsigReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigReferenceType->URI.charactersLen, xmldsigReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigReferenceType->URI_isUsed = 1u; + grammarID = 36; + break; + case 1: + errn = decode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms); + xmldsigReferenceType->Transforms_isUsed = 1u; + grammarID = 37; + break; + case 2: + errn = decode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod); + grammarID = 38; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 36: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms); + xmldsigReferenceType->Transforms_isUsed = 1u; + grammarID = 37; + break; + case 1: + errn = decode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod); + grammarID = 38; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 37: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod); + grammarID = 38; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 38: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigReferenceType->DigestValue.bytesLen); + if (errn == 0) { + errn = (xmldsigReferenceType->DigestValue.bytesLen) <= xmldsigReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigReferenceType->DigestValue.bytesLen, xmldsigReferenceType->DigestValue.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 11; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDataType* xmldsigSPKIDataType) { + int grammarID = 39; + int done = 0; + + init_xmldsigSPKIDataType(xmldsigSPKIDataType); + + while(!done) { + switch(grammarID) { + case 39: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSPKIDataType->SPKISexp.arrayLen < xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen) <= xmldsigSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytes); + } + xmldsigSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 40; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 40: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSPKIDataType->SPKISexp.arrayLen < xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen) <= xmldsigSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytes); + } + xmldsigSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 40; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 41; + break; + case 2: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 41: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSPKIDataType->SPKISexp.arrayLen < xmldsigSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen) <= xmldsigSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytesLen, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType->SPKISexp.arrayLen].bytes); + } + xmldsigSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 40; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int decode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType) { + int grammarID = 42; + int done = 0; + + init_xmldsigPGPDataType(xmldsigPGPDataType); + + while(!done) { + switch(grammarID) { + case 42: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigPGPDataType->PGPKeyID.bytesLen); + if (errn == 0) { + errn = (xmldsigPGPDataType->PGPKeyID.bytesLen) <= xmldsigPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigPGPDataType->PGPKeyID.bytesLen, xmldsigPGPDataType->PGPKeyID.bytes); + } + xmldsigPGPDataType->PGPKeyID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 43; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (xmldsigPGPDataType->PGPKeyPacket.bytesLen) <= xmldsigPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytesLen, xmldsigPGPDataType->PGPKeyPacket.bytes); + } + xmldsigPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 44; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 43: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (xmldsigPGPDataType->PGPKeyPacket.bytesLen) <= xmldsigPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytesLen, xmldsigPGPDataType->PGPKeyPacket.bytes); + } + xmldsigPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 44; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 44; + break; + case 2: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 44: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 44; + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int decode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType) { + int grammarID = 45; + int done = 0; + + init_xmldsigX509IssuerSerialType(xmldsigX509IssuerSerialType); + + while(!done) { + switch(grammarID) { + case 45: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509IssuerSerialType->X509IssuerName.charactersLen); + if (errn == 0) { + errn = (xmldsigX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= xmldsigX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigX509IssuerSerialType->X509IssuerName.charactersLen >= 2) { + xmldsigX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(xmldsigX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigX509IssuerSerialType->X509IssuerName.charactersLen, xmldsigX509IssuerSerialType->X509IssuerName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 46; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 46: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &xmldsigX509IssuerSerialType->X509SerialNumber); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 11; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType) { + int grammarID = 47; + int done = 0; + + init_xmldsigSignatureMethodType(xmldsigSignatureMethodType); + + while(!done) { + switch(grammarID) { + case 47: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignatureMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (xmldsigSignatureMethodType->Algorithm.charactersLen - 2) <= xmldsigSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignatureMethodType->Algorithm.charactersLen >= 2) { + xmldsigSignatureMethodType->Algorithm.charactersLen = (uint16_t)(xmldsigSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignatureMethodType->Algorithm.charactersLen, xmldsigSignatureMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 48; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 48: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &xmldsigSignatureMethodType->HMACOutputLength); + xmldsigSignatureMethodType->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 19; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 2: + done = 1; + grammarID = 3; + break; + case 3: + grammarID = 49; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 49: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &xmldsigSignatureMethodType->HMACOutputLength); + xmldsigSignatureMethodType->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 19; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 2: + done = 1; + grammarID = 3; + break; + case 3: + grammarID = 49; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType) { + int grammarID = 50; + int done = 0; + + init_xmldsigRetrievalMethodType(xmldsigRetrievalMethodType); + + while(!done) { + switch(grammarID) { + case 50: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigRetrievalMethodType->Type.charactersLen); + if (errn == 0) { + errn = (xmldsigRetrievalMethodType->Type.charactersLen - 2) <= xmldsigRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigRetrievalMethodType->Type.charactersLen >= 2) { + xmldsigRetrievalMethodType->Type.charactersLen = (uint16_t)(xmldsigRetrievalMethodType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigRetrievalMethodType->Type.charactersLen, xmldsigRetrievalMethodType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigRetrievalMethodType->Type_isUsed = 1u; + grammarID = 51; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &xmldsigRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (xmldsigRetrievalMethodType->URI.charactersLen - 2) <= xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigRetrievalMethodType->URI.charactersLen >= 2) { + xmldsigRetrievalMethodType->URI.charactersLen = (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigRetrievalMethodType->URI.charactersLen, xmldsigRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigRetrievalMethodType->URI_isUsed = 1u; + grammarID = 52; + break; + case 2: + errn = decode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms); + xmldsigRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 11; + break; + case 3: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 51: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (xmldsigRetrievalMethodType->URI.charactersLen - 2) <= xmldsigRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigRetrievalMethodType->URI.charactersLen >= 2) { + xmldsigRetrievalMethodType->URI.charactersLen = (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigRetrievalMethodType->URI.charactersLen, xmldsigRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigRetrievalMethodType->URI_isUsed = 1u; + grammarID = 52; + break; + case 1: + errn = decode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms); + xmldsigRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 11; + break; + case 2: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 52: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms); + xmldsigRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 11; + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType) { + int grammarID = 53; + int done = 0; + + init_xmldsigSignaturePropertyType(xmldsigSignaturePropertyType); + + while(!done) { + switch(grammarID) { + case 53: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignaturePropertyType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigSignaturePropertyType->Id.charactersLen - 2) <= xmldsigSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignaturePropertyType->Id.charactersLen >= 2) { + xmldsigSignaturePropertyType->Id.charactersLen = (uint16_t)(xmldsigSignaturePropertyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignaturePropertyType->Id.charactersLen, xmldsigSignaturePropertyType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigSignaturePropertyType->Id_isUsed = 1u; + grammarID = 54; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &xmldsigSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (xmldsigSignaturePropertyType->Target.charactersLen - 2) <= xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignaturePropertyType->Target.charactersLen >= 2) { + xmldsigSignaturePropertyType->Target.charactersLen = (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignaturePropertyType->Target.charactersLen, xmldsigSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 55; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 54: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (xmldsigSignaturePropertyType->Target.charactersLen - 2) <= xmldsigSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignaturePropertyType->Target.charactersLen >= 2) { + xmldsigSignaturePropertyType->Target.charactersLen = (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignaturePropertyType->Target.charactersLen, xmldsigSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 55; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 55: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + grammarID = 56; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + done = 1; + grammarID = 3; + break; + case 2: + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 56: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 19; + break; + case 1: + grammarID = 56; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType) { + int grammarID = 57; + int done = 0; + + init_xmldsigSignedInfoType(xmldsigSignedInfoType); + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignedInfoType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigSignedInfoType->Id.charactersLen - 2) <= xmldsigSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignedInfoType->Id.charactersLen >= 2) { + xmldsigSignedInfoType->Id.charactersLen = (uint16_t)(xmldsigSignedInfoType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignedInfoType->Id.charactersLen, xmldsigSignedInfoType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigSignedInfoType->Id_isUsed = 1u; + grammarID = 58; + break; + case 1: + errn = decode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod); + grammarID = 59; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 58: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod); + grammarID = 59; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 59: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_xmldsigSignatureMethodType(stream, &xmldsigSignedInfoType->SignatureMethod); + grammarID = 60; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 60: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSignedInfoType->Reference.arrayLen < xmldsigSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array[xmldsigSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 61; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 61: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigSignedInfoType->Reference.arrayLen < xmldsigSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array[xmldsigSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 61; + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoType* xmldsigKeyInfoType) { + int grammarID = 62; + int done = 0; + + init_xmldsigKeyInfoType(xmldsigKeyInfoType); + + while(!done) { + switch(grammarID) { + case 62: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->Id.charactersLen - 2) <= xmldsigKeyInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->Id.charactersLen >= 2) { + xmldsigKeyInfoType->Id.charactersLen = (uint16_t)(xmldsigKeyInfoType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->Id.charactersLen, xmldsigKeyInfoType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->Id_isUsed = 1u; + grammarID = 63; + break; + case 1: + if (xmldsigKeyInfoType->KeyName.arrayLen < xmldsigKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (xmldsigKeyInfoType->KeyValue.arrayLen < xmldsigKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array[xmldsigKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 3: + if (xmldsigKeyInfoType->RetrievalMethod.arrayLen < xmldsigKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array[xmldsigKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 4: + if (xmldsigKeyInfoType->X509Data.arrayLen < xmldsigKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array[xmldsigKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 5: + if (xmldsigKeyInfoType->PGPData.arrayLen < xmldsigKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array[xmldsigKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 6: + if (xmldsigKeyInfoType->SPKIData.arrayLen < xmldsigKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array[xmldsigKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 7: + if (xmldsigKeyInfoType->MgmtData.arrayLen < xmldsigKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 8: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 64; + break; + case 9: + grammarID = 65; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 63: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigKeyInfoType->KeyName.arrayLen < xmldsigKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (xmldsigKeyInfoType->KeyValue.arrayLen < xmldsigKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array[xmldsigKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 2: + if (xmldsigKeyInfoType->RetrievalMethod.arrayLen < xmldsigKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array[xmldsigKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 3: + if (xmldsigKeyInfoType->X509Data.arrayLen < xmldsigKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array[xmldsigKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 4: + if (xmldsigKeyInfoType->PGPData.arrayLen < xmldsigKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array[xmldsigKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 5: + if (xmldsigKeyInfoType->SPKIData.arrayLen < xmldsigKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array[xmldsigKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 6: + if (xmldsigKeyInfoType->MgmtData.arrayLen < xmldsigKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 7: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 64; + break; + case 8: + grammarID = 65; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 64: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigKeyInfoType->KeyName.arrayLen < xmldsigKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (xmldsigKeyInfoType->KeyValue.arrayLen < xmldsigKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array[xmldsigKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 2: + if (xmldsigKeyInfoType->RetrievalMethod.arrayLen < xmldsigKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array[xmldsigKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 3: + if (xmldsigKeyInfoType->X509Data.arrayLen < xmldsigKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array[xmldsigKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 4: + if (xmldsigKeyInfoType->PGPData.arrayLen < xmldsigKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array[xmldsigKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 5: + if (xmldsigKeyInfoType->SPKIData.arrayLen < xmldsigKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array[xmldsigKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 6: + if (xmldsigKeyInfoType->MgmtData.arrayLen < xmldsigKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 7: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 64; + break; + case 8: + done = 1; + grammarID = 3; + break; + case 9: + grammarID = 64; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 65: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigKeyInfoType->KeyName.arrayLen < xmldsigKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].charactersLen, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->KeyName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (xmldsigKeyInfoType->KeyValue.arrayLen < xmldsigKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array[xmldsigKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 2: + if (xmldsigKeyInfoType->RetrievalMethod.arrayLen < xmldsigKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array[xmldsigKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 3: + if (xmldsigKeyInfoType->X509Data.arrayLen < xmldsigKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array[xmldsigKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 4: + if (xmldsigKeyInfoType->PGPData.arrayLen < xmldsigKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array[xmldsigKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 5: + if (xmldsigKeyInfoType->SPKIData.arrayLen < xmldsigKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array[xmldsigKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 64; + break; + case 6: + if (xmldsigKeyInfoType->MgmtData.arrayLen < xmldsigKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= xmldsigKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].charactersLen, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigKeyInfoType->MgmtData.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 7: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 64; + break; + case 8: + grammarID = 65; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType) { + int grammarID = 66; + int done = 0; + + init_xmldsigManifestType(xmldsigManifestType); + + while(!done) { + switch(grammarID) { + case 66: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigManifestType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigManifestType->Id.charactersLen - 2) <= xmldsigManifestType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigManifestType->Id.charactersLen >= 2) { + xmldsigManifestType->Id.charactersLen = (uint16_t)(xmldsigManifestType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigManifestType->Id.charactersLen, xmldsigManifestType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigManifestType->Id_isUsed = 1u; + grammarID = 67; + break; + case 1: + if (xmldsigManifestType->Reference.arrayLen < xmldsigManifestType_Reference_ARRAY_SIZE) { + errn = decode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array[xmldsigManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 61; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 67: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigManifestType->Reference.arrayLen < xmldsigManifestType_Reference_ARRAY_SIZE) { + errn = decode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array[xmldsigManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 61; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 61: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigManifestType->Reference.arrayLen < xmldsigManifestType_Reference_ARRAY_SIZE) { + errn = decode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array[xmldsigManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 61; + break; + case 1: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType) { + int grammarID = 68; + int done = 0; + + init_xmldsigSignatureValueType(xmldsigSignatureValueType); + + while(!done) { + switch(grammarID) { + case 68: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignatureValueType->Id.charactersLen); + if (errn == 0) { + errn = (xmldsigSignatureValueType->Id.charactersLen - 2) <= xmldsigSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigSignatureValueType->Id.charactersLen >= 2) { + xmldsigSignatureValueType->Id.charactersLen = (uint16_t)(xmldsigSignatureValueType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigSignatureValueType->Id.charactersLen, xmldsigSignatureValueType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigSignatureValueType->Id_isUsed = 1u; + grammarID = 69; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &xmldsigSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (xmldsigSignatureValueType->CONTENT.bytesLen) <= xmldsigSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytesLen, xmldsigSignatureValueType->CONTENT.bytes); + } + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 69: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &xmldsigSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (xmldsigSignatureValueType->CONTENT.bytesLen) <= xmldsigSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytesLen, xmldsigSignatureValueType->CONTENT.bytes); + } + grammarID = 11; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType) { + int grammarID = 70; + int done = 0; + + init_xmldsigX509DataType(xmldsigX509DataType); + + while(!done) { + switch(grammarID) { + case 70: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigX509DataType->X509IssuerSerial.arrayLen < xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array[xmldsigX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 71; + break; + case 1: + if (xmldsigX509DataType->X509SKI.arrayLen < xmldsigX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytesLen) <= xmldsigX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytesLen, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytes); + } + xmldsigX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (xmldsigX509DataType->X509SubjectName.arrayLen < xmldsigX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (xmldsigX509DataType->X509Certificate.arrayLen < xmldsigX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytesLen) <= xmldsigX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytesLen, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytes); + } + xmldsigX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (xmldsigX509DataType->X509CRL.arrayLen < xmldsigX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytesLen) <= xmldsigX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytesLen, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytes); + } + xmldsigX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 71; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 71: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (xmldsigX509DataType->X509IssuerSerial.arrayLen < xmldsigX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array[xmldsigX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 71; + break; + case 1: + if (xmldsigX509DataType->X509SKI.arrayLen < xmldsigX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytesLen) <= xmldsigX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytesLen, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType->X509SKI.arrayLen].bytes); + } + xmldsigX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (xmldsigX509DataType->X509SubjectName.arrayLen < xmldsigX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= xmldsigX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].charactersLen, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + xmldsigX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (xmldsigX509DataType->X509Certificate.arrayLen < xmldsigX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytesLen) <= xmldsigX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytesLen, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType->X509Certificate.arrayLen].bytes); + } + xmldsigX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (xmldsigX509DataType->X509CRL.arrayLen < xmldsigX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytesLen) <= xmldsigX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytesLen, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType->X509CRL.arrayLen].bytes); + } + xmldsigX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 71; + break; + case 6: + done = 1; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + + + + +int decode_xmldsigExiDocument(bitstream_t* stream, struct xmldsigEXIDocument* exiDoc) { + errn = readEXIHeader(stream); + + if(errn == 0) { + /* DocContent[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT_GENERIC] */ + init_xmldsigEXIDocument(exiDoc); + errn = decodeNBitUnsignedInteger(stream, 5, &eventCode); + if(errn == 0) { + switch(eventCode) { + case 0: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = decode_xmldsigCanonicalizationMethodType(stream, &exiDoc->CanonicalizationMethod); + exiDoc->CanonicalizationMethod_isUsed = 1u; + break; + case 1: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = decode_xmldsigDSAKeyValueType(stream, &exiDoc->DSAKeyValue); + exiDoc->DSAKeyValue_isUsed = 1u; + break; + case 2: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = decode_xmldsigDigestMethodType(stream, &exiDoc->DigestMethod); + exiDoc->DigestMethod_isUsed = 1u; + break; + case 3: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiDoc->DigestValue.bytesLen); + if (errn == 0) { + errn = (exiDoc->DigestValue.bytesLen) <= EXIDocument_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiDoc->DigestValue.bytesLen, exiDoc->DigestValue.bytes); + } + exiDoc->DigestValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 4: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = decode_xmldsigKeyInfoType(stream, &exiDoc->KeyInfo); + exiDoc->KeyInfo_isUsed = 1u; + break; + case 5: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiDoc->KeyName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 6: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = decode_xmldsigKeyValueType(stream, &exiDoc->KeyValue); + exiDoc->KeyValue_isUsed = 1u; + break; + case 7: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = decode_xmldsigManifestType(stream, &exiDoc->Manifest); + exiDoc->Manifest_isUsed = 1u; + break; + case 8: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiDoc->MgmtData_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 9: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = decode_xmldsigObjectType(stream, &exiDoc->Object); + exiDoc->Object_isUsed = 1u; + break; + case 10: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = decode_xmldsigPGPDataType(stream, &exiDoc->PGPData); + exiDoc->PGPData_isUsed = 1u; + break; + case 11: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = decode_xmldsigRSAKeyValueType(stream, &exiDoc->RSAKeyValue); + exiDoc->RSAKeyValue_isUsed = 1u; + break; + case 12: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = decode_xmldsigReferenceType(stream, &exiDoc->Reference); + exiDoc->Reference_isUsed = 1u; + break; + case 13: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = decode_xmldsigRetrievalMethodType(stream, &exiDoc->RetrievalMethod); + exiDoc->RetrievalMethod_isUsed = 1u; + break; + case 14: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = decode_xmldsigSPKIDataType(stream, &exiDoc->SPKIData); + exiDoc->SPKIData_isUsed = 1u; + break; + case 15: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = decode_xmldsigSignatureType(stream, &exiDoc->Signature); + exiDoc->Signature_isUsed = 1u; + break; + case 16: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = decode_xmldsigSignatureMethodType(stream, &exiDoc->SignatureMethod); + exiDoc->SignatureMethod_isUsed = 1u; + break; + case 17: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = decode_xmldsigSignaturePropertiesType(stream, &exiDoc->SignatureProperties); + exiDoc->SignatureProperties_isUsed = 1u; + break; + case 18: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = decode_xmldsigSignaturePropertyType(stream, &exiDoc->SignatureProperty); + exiDoc->SignatureProperty_isUsed = 1u; + break; + case 19: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = decode_xmldsigSignatureValueType(stream, &exiDoc->SignatureValue); + exiDoc->SignatureValue_isUsed = 1u; + break; + case 20: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = decode_xmldsigSignedInfoType(stream, &exiDoc->SignedInfo); + exiDoc->SignedInfo_isUsed = 1u; + break; + case 21: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = decode_xmldsigTransformType(stream, &exiDoc->Transform); + exiDoc->Transform_isUsed = 1u; + break; + case 22: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = decode_xmldsigTransformsType(stream, &exiDoc->Transforms); + exiDoc->Transforms_isUsed = 1u; + break; + case 23: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = decode_xmldsigX509DataType(stream, &exiDoc->X509Data); + exiDoc->X509Data_isUsed = 1u; + break; + default: + errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1; + break; + } + } + + } + + return errn; +} + +#if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES +int decode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* exiFrag) { + errn = readEXIHeader(stream); + + if(errn == 0) { + /* FragmentContent[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT_GENERIC, END_DOCUMENT] */ + init_xmldsigEXIFragment(exiFrag); + errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); + if(errn == 0) { + switch(eventCode) { + case 0: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = decode_xmldsigCanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod); + exiFrag->CanonicalizationMethod_isUsed = 1u; + break; + case 1: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = decode_xmldsigDSAKeyValueType(stream, &exiFrag->DSAKeyValue); + exiFrag->DSAKeyValue_isUsed = 1u; + break; + case 2: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = decode_xmldsigDigestMethodType(stream, &exiFrag->DigestMethod); + exiFrag->DigestMethod_isUsed = 1u; + break; + case 3: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->DigestValue.bytesLen); + if (errn == 0) { + errn = (exiFrag->DigestValue.bytesLen) <= EXIFragment_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->DigestValue.bytesLen, exiFrag->DigestValue.bytes); + } + exiFrag->DigestValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 4: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Exponent.bytesLen); + if (errn == 0) { + errn = (exiFrag->Exponent.bytesLen) <= EXIFragment_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Exponent.bytesLen, exiFrag->Exponent.bytes); + } + exiFrag->Exponent_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 5: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->G.bytesLen); + if (errn == 0) { + errn = (exiFrag->G.bytesLen) <= EXIFragment_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->G.bytesLen, exiFrag->G.bytes); + } + exiFrag->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 6: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->HMACOutputLength); + exiFrag->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 7: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->J.bytesLen); + if (errn == 0) { + errn = (exiFrag->J.bytesLen) <= EXIFragment_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->J.bytesLen, exiFrag->J.bytes); + } + exiFrag->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 8: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = decode_xmldsigKeyInfoType(stream, &exiFrag->KeyInfo); + exiFrag->KeyInfo_isUsed = 1u; + break; + case 9: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->KeyName.charactersLen); + if (errn == 0) { + errn = (exiFrag->KeyName.charactersLen - 2) <= EXIFragment_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->KeyName.charactersLen >= 2) { + exiFrag->KeyName.charactersLen = (uint16_t)(exiFrag->KeyName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->KeyName.charactersLen, exiFrag->KeyName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->KeyName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 10: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = decode_xmldsigKeyValueType(stream, &exiFrag->KeyValue); + exiFrag->KeyValue_isUsed = 1u; + break; + case 11: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = decode_xmldsigManifestType(stream, &exiFrag->Manifest); + exiFrag->Manifest_isUsed = 1u; + break; + case 12: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->MgmtData.charactersLen); + if (errn == 0) { + errn = (exiFrag->MgmtData.charactersLen - 2) <= EXIFragment_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->MgmtData.charactersLen >= 2) { + exiFrag->MgmtData.charactersLen = (uint16_t)(exiFrag->MgmtData.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->MgmtData.charactersLen, exiFrag->MgmtData.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->MgmtData_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 13: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Modulus.bytesLen); + if (errn == 0) { + errn = (exiFrag->Modulus.bytesLen) <= EXIFragment_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Modulus.bytesLen, exiFrag->Modulus.bytes); + } + exiFrag->Modulus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 14: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = decode_xmldsigObjectType(stream, &exiFrag->Object); + exiFrag->Object_isUsed = 1u; + break; + case 15: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->P.bytesLen); + if (errn == 0) { + errn = (exiFrag->P.bytesLen) <= EXIFragment_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->P.bytesLen, exiFrag->P.bytes); + } + exiFrag->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 16: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = decode_xmldsigPGPDataType(stream, &exiFrag->PGPData); + exiFrag->PGPData_isUsed = 1u; + break; + case 17: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->PGPKeyID.bytesLen); + if (errn == 0) { + errn = (exiFrag->PGPKeyID.bytesLen) <= EXIFragment_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->PGPKeyID.bytesLen, exiFrag->PGPKeyID.bytes); + } + exiFrag->PGPKeyID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 18: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name PGPKeyPacket */ + break; + case 19: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->PgenCounter.bytesLen); + if (errn == 0) { + errn = (exiFrag->PgenCounter.bytesLen) <= EXIFragment_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->PgenCounter.bytesLen, exiFrag->PgenCounter.bytes); + } + exiFrag->PgenCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 20: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Q.bytesLen); + if (errn == 0) { + errn = (exiFrag->Q.bytesLen) <= EXIFragment_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Q.bytesLen, exiFrag->Q.bytes); + } + exiFrag->Q_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 21: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = decode_xmldsigRSAKeyValueType(stream, &exiFrag->RSAKeyValue); + exiFrag->RSAKeyValue_isUsed = 1u; + break; + case 22: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = decode_xmldsigReferenceType(stream, &exiFrag->Reference); + exiFrag->Reference_isUsed = 1u; + break; + case 23: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = decode_xmldsigRetrievalMethodType(stream, &exiFrag->RetrievalMethod); + exiFrag->RetrievalMethod_isUsed = 1u; + break; + case 24: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = decode_xmldsigSPKIDataType(stream, &exiFrag->SPKIData); + exiFrag->SPKIData_isUsed = 1u; + break; + case 25: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->SPKISexp.bytesLen); + if (errn == 0) { + errn = (exiFrag->SPKISexp.bytesLen) <= EXIFragment_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->SPKISexp.bytesLen, exiFrag->SPKISexp.bytes); + } + exiFrag->SPKISexp_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 26: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Seed.bytesLen); + if (errn == 0) { + errn = (exiFrag->Seed.bytesLen) <= EXIFragment_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Seed.bytesLen, exiFrag->Seed.bytes); + } + exiFrag->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 27: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = decode_xmldsigSignatureType(stream, &exiFrag->Signature); + exiFrag->Signature_isUsed = 1u; + break; + case 28: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = decode_xmldsigSignatureMethodType(stream, &exiFrag->SignatureMethod); + exiFrag->SignatureMethod_isUsed = 1u; + break; + case 29: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = decode_xmldsigSignaturePropertiesType(stream, &exiFrag->SignatureProperties); + exiFrag->SignatureProperties_isUsed = 1u; + break; + case 30: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = decode_xmldsigSignaturePropertyType(stream, &exiFrag->SignatureProperty); + exiFrag->SignatureProperty_isUsed = 1u; + break; + case 31: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = decode_xmldsigSignatureValueType(stream, &exiFrag->SignatureValue); + exiFrag->SignatureValue_isUsed = 1u; + break; + case 32: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = decode_xmldsigSignedInfoType(stream, &exiFrag->SignedInfo); + exiFrag->SignedInfo_isUsed = 1u; + break; + case 33: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = decode_xmldsigTransformType(stream, &exiFrag->Transform); + exiFrag->Transform_isUsed = 1u; + break; + case 34: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = decode_xmldsigTransformsType(stream, &exiFrag->Transforms); + exiFrag->Transforms_isUsed = 1u; + break; + case 35: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509CRL.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509CRL.bytesLen) <= EXIFragment_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509CRL.bytesLen, exiFrag->X509CRL.bytes); + } + exiFrag->X509CRL_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 36: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509Certificate.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509Certificate.bytesLen) <= EXIFragment_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509Certificate.bytesLen, exiFrag->X509Certificate.bytes); + } + exiFrag->X509Certificate_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 37: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = decode_xmldsigX509DataType(stream, &exiFrag->X509Data); + exiFrag->X509Data_isUsed = 1u; + break; + case 38: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509IssuerName.charactersLen); + if (errn == 0) { + errn = (exiFrag->X509IssuerName.charactersLen - 2) <= EXIFragment_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->X509IssuerName.charactersLen >= 2) { + exiFrag->X509IssuerName.charactersLen = (uint16_t)(exiFrag->X509IssuerName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->X509IssuerName.charactersLen, exiFrag->X509IssuerName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->X509IssuerName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 39: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial) */ + errn = decode_xmldsigX509IssuerSerialType(stream, &exiFrag->X509IssuerSerial); + exiFrag->X509IssuerSerial_isUsed = 1u; + break; + case 40: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) */ + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509SKI.bytesLen); + if (errn == 0) { + errn = (exiFrag->X509SKI.bytesLen) <= EXIFragment_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->X509SKI.bytesLen, exiFrag->X509SKI.bytes); + } + exiFrag->X509SKI_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 41: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &exiFrag->X509SerialNumber); + exiFrag->X509SerialNumber_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 42: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->X509SubjectName.charactersLen); + if (errn == 0) { + errn = (exiFrag->X509SubjectName.charactersLen - 2) <= EXIFragment_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->X509SubjectName.charactersLen >= 2) { + exiFrag->X509SubjectName.charactersLen = (uint16_t)(exiFrag->X509SubjectName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->X509SubjectName.charactersLen, exiFrag->X509SubjectName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->X509SubjectName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 43: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->XPath.charactersLen); + if (errn == 0) { + errn = (exiFrag->XPath.charactersLen - 2) <= EXIFragment_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiFrag->XPath.charactersLen >= 2) { + exiFrag->XPath.charactersLen = (uint16_t)(exiFrag->XPath.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiFrag->XPath.charactersLen, exiFrag->XPath.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiFrag->XPath_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 44: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiFrag->Y.bytesLen); + if (errn == 0) { + errn = (exiFrag->Y.bytesLen) <= EXIFragment_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiFrag->Y.bytesLen, exiFrag->Y.bytes); + } + exiFrag->Y_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + default: + errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1; + break; + } + } + if(errn == 0) { + /* EndDocument */ + errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); + if (eventCode != 46) { + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; + } + } + + } + + return errn; +} +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + +#endif /* DEPLOY_XMLDSIG_CODEC */ + +#endif + diff --git a/src/xmldsig/xmldsigEXIDatatypesDecoder.h b/src/xmldsig/xmldsigEXIDatatypesDecoder.h new file mode 100644 index 0000000..3843741 --- /dev/null +++ b/src/xmldsig/xmldsigEXIDatatypesDecoder.h @@ -0,0 +1,64 @@ +/* + * 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 . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.3 + * @contact Joerg.Heuer@siemens.com + * + * Code generated by EXIdizer + * Schema: xmldsig-core-schema.xsd + * + * + ********************************************************************/ + + + +/** + * \file EXIDatatypesDecoder.h + * \brief Decoder for datatype definitions + * + */ + +#ifndef EXI_xmldsig_DATATYPES_DECODER_H +#define EXI_xmldsig_DATATYPES_DECODER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES + +#include + +#include "EXITypes.h" +#include "xmldsigEXIDatatypes.h" + +int decode_xmldsigExiDocument(bitstream_t* stream, struct xmldsigEXIDocument* exiDoc); + +#if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES +int decode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* exiFrag); +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + +#endif /* DEPLOY_XMLDSIG_CODEC */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/xmldsig/xmldsigEXIDatatypesEncoder.c b/src/xmldsig/xmldsigEXIDatatypesEncoder.c new file mode 100644 index 0000000..fef80c6 --- /dev/null +++ b/src/xmldsig/xmldsigEXIDatatypesEncoder.c @@ -0,0 +1,3386 @@ +/* + * 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 . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.3 + * @contact Joerg.Heuer@siemens.com + * + * Code generated by EXIdizer + * Schema: xmldsig-core-schema.xsd + * + * + ********************************************************************/ + + + + +#include "xmldsigEXIDatatypesEncoder.h" + +#include "EncoderChannel.h" +#include "EXIHeaderEncoder.h" + +#include "xmldsigEXIDatatypes.h" +#include "ErrorCodes.h" + +#ifndef EXI_xmldsig_DATATYPES_ENCODER_C +#define EXI_xmldsig_DATATYPES_ENCODER_C + +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES + +static int errn; + +/* Forward Declarations */ +static int encode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType); +static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType); +static int encode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType); +static int encode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType); +static int encode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType); +static int encode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType); +static int encode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType); +static int encode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType); +static int encode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType); +static int encode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignatureType* xmldsigSignatureType); +static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigReferenceType* xmldsigReferenceType); +static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDataType* xmldsigSPKIDataType); +static int encode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType); +static int encode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType); +static int encode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType); +static int encode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType); +static int encode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType); +static int encode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType); +static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoType* xmldsigKeyInfoType); +static int encode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType); +static int encode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType); +static int encode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType); + + + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int encode_xmldsigKeyValueType(bitstream_t* stream, struct xmldsigKeyValueType* xmldsigKeyValueType) { + int grammarID = 0; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_xmldsigDSAKeyValueType(stream, &xmldsigKeyValueType->DSAKeyValue ); + } + grammarID = 1; + } else if ( xmldsigKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue ); + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 1: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 2: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_xmldsigDSAKeyValueType(stream, &xmldsigKeyValueType->DSAKeyValue ); + } + grammarID = 1; + } else if ( xmldsigKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_xmldsigRSAKeyValueType(stream, &xmldsigKeyValueType->RSAKeyValue ); + } + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 1; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigDSAKeyValueType(bitstream_t* stream, struct xmldsigDSAKeyValueType* xmldsigDSAKeyValueType) { + int grammarID = 4; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 4: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( xmldsigDSAKeyValueType->P_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->P.bytes, xmldsigDSAKeyValueType->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if ( xmldsigDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->G.bytes, xmldsigDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 6; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 7; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + if ( xmldsigDSAKeyValueType->Q_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Q.bytes, xmldsigDSAKeyValueType->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 8; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 8: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( xmldsigDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->G.bytes, xmldsigDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 6; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 7; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 6: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Y.bytes, xmldsigDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 7; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 7: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( xmldsigDSAKeyValueType->J_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->J.bytes, xmldsigDSAKeyValueType->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 9; + } else if ( xmldsigDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytes, xmldsigDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 9: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( xmldsigDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->Seed.bytes, xmldsigDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + if ( xmldsigDSAKeyValueType->PgenCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDSAKeyValueType->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigDSAKeyValueType->PgenCounter.bytes, xmldsigDSAKeyValueType->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int encode_xmldsigRSAKeyValueType(bitstream_t* stream, struct xmldsigRSAKeyValueType* xmldsigRSAKeyValueType) { + int grammarID = 12; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 12: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRSAKeyValueType->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigRSAKeyValueType->Modulus.bytes, xmldsigRSAKeyValueType->Modulus.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 13; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 13: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRSAKeyValueType->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigRSAKeyValueType->Exponent.bytes, xmldsigRSAKeyValueType->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignaturePropertiesType(bitstream_t* stream, struct xmldsigSignaturePropertiesType* xmldsigSignaturePropertiesType) { + int grammarID = 14; + int done = 0; + + unsigned int xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 14: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if ( xmldsigSignaturePropertiesType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertiesType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertiesType->Id.characters, xmldsigSignaturePropertiesType->Id.charactersLen); + } + } + grammarID = 15; + } else if (xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex < xmldsigSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array [xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 16; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 15: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if (xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex < xmldsigSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array [xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 16; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 16: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + if (xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex < xmldsigSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigSignaturePropertyType(stream, &xmldsigSignaturePropertiesType->SignatureProperty.array [xmldsigSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 16; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigCanonicalizationMethodType(bitstream_t* stream, struct xmldsigCanonicalizationMethodType* xmldsigCanonicalizationMethodType) { + int grammarID = 17; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 17: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigCanonicalizationMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigCanonicalizationMethodType->Algorithm.characters, xmldsigCanonicalizationMethodType->Algorithm.charactersLen); + } + } + grammarID = 18; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigObjectType(bitstream_t* stream, struct xmldsigObjectType* xmldsigObjectType) { + int grammarID = 20; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 20: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigObjectType->Encoding_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Encoding.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->Encoding.characters, xmldsigObjectType->Encoding.charactersLen); + } + } + grammarID = 21; + } else if ( xmldsigObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->Id.characters, xmldsigObjectType->Id.charactersLen); + } + } + grammarID = 22; + } else if ( xmldsigObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); + } + } + grammarID = 18; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 21: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->Id.characters, xmldsigObjectType->Id.charactersLen); + } + } + grammarID = 22; + } else if ( xmldsigObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); + } + } + grammarID = 18; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 22: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigObjectType->MimeType.characters, xmldsigObjectType->MimeType.charactersLen); + } + } + grammarID = 18; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigTransformsType(bitstream_t* stream, struct xmldsigTransformsType* xmldsigTransformsType) { + int grammarID = 23; + int done = 0; + + unsigned int xmldsigTransformsType_Transform_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 23: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + if (xmldsigTransformsType_Transform_currArrayIndex < xmldsigTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigTransformType(stream, &xmldsigTransformsType->Transform.array [xmldsigTransformsType_Transform_currArrayIndex++]); + } + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 24: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + if (xmldsigTransformsType_Transform_currArrayIndex < xmldsigTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigTransformType(stream, &xmldsigTransformsType->Transform.array [xmldsigTransformsType_Transform_currArrayIndex++]); + } + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigTransformType(bitstream_t* stream, struct xmldsigTransformType* xmldsigTransformType) { + int grammarID = 25; + int done = 0; + + unsigned int xmldsigTransformType_XPath_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 25: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->Algorithm.characters, xmldsigTransformType->Algorithm.charactersLen); + } + } + grammarID = 26; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 26: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (xmldsigTransformType_XPath_currArrayIndex < xmldsigTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].characters, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen); + xmldsigTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 27; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 27; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 27; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 27: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (xmldsigTransformType_XPath_currArrayIndex < xmldsigTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].characters, xmldsigTransformType->XPath.array[xmldsigTransformType_XPath_currArrayIndex].charactersLen); + xmldsigTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 27; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 27; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 27; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigDigestMethodType(bitstream_t* stream, struct xmldsigDigestMethodType* xmldsigDigestMethodType) { + int grammarID = 17; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 17: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigDigestMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigDigestMethodType->Algorithm.characters, xmldsigDigestMethodType->Algorithm.charactersLen); + } + } + grammarID = 18; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignatureType(bitstream_t* stream, struct xmldsigSignatureType* xmldsigSignatureType) { + int grammarID = 28; + int done = 0; + + unsigned int xmldsigSignatureType_Object_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 28: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( xmldsigSignatureType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureType->Id.characters, xmldsigSignatureType->Id.charactersLen); + } + } + grammarID = 29; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigSignedInfoType(stream, &xmldsigSignatureType->SignedInfo ); + } + grammarID = 30; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 29: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigSignedInfoType(stream, &xmldsigSignatureType->SignedInfo ); + } + grammarID = 30; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 30: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigSignatureValueType(stream, &xmldsigSignatureType->SignatureValue ); + } + grammarID = 31; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 31: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if ( xmldsigSignatureType->KeyInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigKeyInfoType(stream, &xmldsigSignatureType->KeyInfo ); + } + grammarID = 32; + } else if (xmldsigSignatureType_Object_currArrayIndex < xmldsigSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigObjectType(stream, &xmldsigSignatureType->Object.array [xmldsigSignatureType_Object_currArrayIndex++]); + } + grammarID = 32; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 32: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if (xmldsigSignatureType_Object_currArrayIndex < xmldsigSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigObjectType(stream, &xmldsigSignatureType->Object.array [xmldsigSignatureType_Object_currArrayIndex++]); + } + grammarID = 32; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int encode_xmldsigReferenceType(bitstream_t* stream, struct xmldsigReferenceType* xmldsigReferenceType) { + int grammarID = 33; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 33: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( xmldsigReferenceType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigReferenceType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigReferenceType->Id.characters, xmldsigReferenceType->Id.charactersLen); + } + } + grammarID = 34; + } else if ( xmldsigReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigReferenceType->Type.characters, xmldsigReferenceType->Type.charactersLen); + } + } + grammarID = 35; + } else if ( xmldsigReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigReferenceType->URI.characters, xmldsigReferenceType->URI.charactersLen); + } + } + grammarID = 36; + } else if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); + } + grammarID = 37; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 34: + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( xmldsigReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigReferenceType->Type.characters, xmldsigReferenceType->Type.charactersLen); + } + } + grammarID = 35; + } else if ( xmldsigReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigReferenceType->URI.characters, xmldsigReferenceType->URI.charactersLen); + } + } + grammarID = 36; + } else if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); + } + grammarID = 37; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 35: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( xmldsigReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigReferenceType->URI.characters, xmldsigReferenceType->URI.charactersLen); + } + } + grammarID = 36; + } else if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); + } + grammarID = 37; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 36: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( xmldsigReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigReferenceType->Transforms ); + } + grammarID = 37; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 37: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigDigestMethodType(stream, &xmldsigReferenceType->DigestMethod ); + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 38: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigReferenceType->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigReferenceType->DigestValue.bytes, xmldsigReferenceType->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSPKIDataType(bitstream_t* stream, struct xmldsigSPKIDataType* xmldsigSPKIDataType) { + int grammarID = 39; + int done = 0; + + unsigned int xmldsigSPKIDataType_SPKISexp_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 39: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + if (xmldsigSPKIDataType_SPKISexp_currArrayIndex < xmldsigSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytes, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + xmldsigSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 40; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 40: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (xmldsigSPKIDataType_SPKISexp_currArrayIndex < xmldsigSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytes, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + xmldsigSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 40; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 41; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 41: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + if (xmldsigSPKIDataType_SPKISexp_currArrayIndex < xmldsigSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytes, xmldsigSPKIDataType->SPKISexp.array[xmldsigSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + xmldsigSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 40; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int encode_xmldsigPGPDataType(bitstream_t* stream, struct xmldsigPGPDataType* xmldsigPGPDataType) { + int grammarID = 42; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 42: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + if ( xmldsigPGPDataType->PGPKeyID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyID.bytes, xmldsigPGPDataType->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 43; + } else if ( xmldsigPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytes, xmldsigPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 44; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 43: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + if ( xmldsigPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigPGPDataType->PGPKeyPacket.bytes, xmldsigPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 44; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 44; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 44: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 44; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int encode_xmldsigX509IssuerSerialType(bitstream_t* stream, struct xmldsigX509IssuerSerialType* xmldsigX509IssuerSerialType) { + int grammarID = 45; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 45: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509IssuerSerialType->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigX509IssuerSerialType->X509IssuerName.characters, xmldsigX509IssuerSerialType->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 46; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 46: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, xmldsigX509IssuerSerialType->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignatureMethodType(bitstream_t* stream, struct xmldsigSignatureMethodType* xmldsigSignatureMethodType) { + int grammarID = 47; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 47: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureMethodType->Algorithm.characters, xmldsigSignatureMethodType->Algorithm.charactersLen); + } + } + grammarID = 48; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 48: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, xmldsigSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 19; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 49; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 49: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, xmldsigSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 19; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 49; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigRetrievalMethodType(bitstream_t* stream, struct xmldsigRetrievalMethodType* xmldsigRetrievalMethodType) { + int grammarID = 50; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 50: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( xmldsigRetrievalMethodType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigRetrievalMethodType->Type.characters, xmldsigRetrievalMethodType->Type.charactersLen); + } + } + grammarID = 51; + } else if ( xmldsigRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigRetrievalMethodType->URI.characters, xmldsigRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 52; + } else if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); + } + grammarID = 11; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 51: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( xmldsigRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigRetrievalMethodType->URI.characters, xmldsigRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 52; + } else if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); + } + grammarID = 11; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 52: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( xmldsigRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &xmldsigRetrievalMethodType->Transforms ); + } + grammarID = 11; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignaturePropertyType(bitstream_t* stream, struct xmldsigSignaturePropertyType* xmldsigSignaturePropertyType) { + int grammarID = 53; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 53: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + if ( xmldsigSignaturePropertyType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Id.characters, xmldsigSignaturePropertyType->Id.charactersLen); + } + } + grammarID = 54; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Target.characters, xmldsigSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 55; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 54: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignaturePropertyType->Target.characters, xmldsigSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 55; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 55: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 56; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 56: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 19; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 56; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigSignedInfoType(bitstream_t* stream, struct xmldsigSignedInfoType* xmldsigSignedInfoType) { + int grammarID = 57; + int done = 0; + + unsigned int xmldsigSignedInfoType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( xmldsigSignedInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignedInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignedInfoType->Id.characters, xmldsigSignedInfoType->Id.charactersLen); + } + } + grammarID = 58; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod ); + } + grammarID = 59; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigCanonicalizationMethodType(stream, &xmldsigSignedInfoType->CanonicalizationMethod ); + } + grammarID = 59; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 59: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigSignatureMethodType(stream, &xmldsigSignedInfoType->SignatureMethod ); + } + grammarID = 60; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 60: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (xmldsigSignedInfoType_Reference_currArrayIndex < xmldsigSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array [xmldsigSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 61; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 61: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (xmldsigSignedInfoType_Reference_currArrayIndex < xmldsigSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigSignedInfoType->Reference.array [xmldsigSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 61; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigKeyInfoType(bitstream_t* stream, struct xmldsigKeyInfoType* xmldsigKeyInfoType) { + int grammarID = 62; + int done = 0; + + unsigned int xmldsigKeyInfoType_KeyName_currArrayIndex = 0; + unsigned int xmldsigKeyInfoType_KeyValue_currArrayIndex = 0; + unsigned int xmldsigKeyInfoType_RetrievalMethod_currArrayIndex = 0; + unsigned int xmldsigKeyInfoType_X509Data_currArrayIndex = 0; + unsigned int xmldsigKeyInfoType_PGPData_currArrayIndex = 0; + unsigned int xmldsigKeyInfoType_SPKIData_currArrayIndex = 0; + unsigned int xmldsigKeyInfoType_MgmtData_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 62: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( xmldsigKeyInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->Id.characters, xmldsigKeyInfoType->Id.charactersLen); + } + } + grammarID = 63; + } else if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].characters, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen); + xmldsigKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 7); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].characters, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen); + xmldsigKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 64; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 65; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 63: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].characters, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen); + xmldsigKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].characters, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen); + xmldsigKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 64; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 65; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 64: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].characters, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen); + xmldsigKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].characters, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen); + xmldsigKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 64; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 4, 8); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 64; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 65: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (xmldsigKeyInfoType_KeyName_currArrayIndex < xmldsigKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].characters, xmldsigKeyInfoType->KeyName.array[xmldsigKeyInfoType_KeyName_currArrayIndex].charactersLen); + xmldsigKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (xmldsigKeyInfoType_KeyValue_currArrayIndex < xmldsigKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_xmldsigKeyValueType(stream, &xmldsigKeyInfoType->KeyValue.array [xmldsigKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_RetrievalMethod_currArrayIndex < xmldsigKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_xmldsigRetrievalMethodType(stream, &xmldsigKeyInfoType->RetrievalMethod.array [xmldsigKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_X509Data_currArrayIndex < xmldsigKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_xmldsigX509DataType(stream, &xmldsigKeyInfoType->X509Data.array [xmldsigKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_PGPData_currArrayIndex < xmldsigKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_xmldsigPGPDataType(stream, &xmldsigKeyInfoType->PGPData.array [xmldsigKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_SPKIData_currArrayIndex < xmldsigKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_xmldsigSPKIDataType(stream, &xmldsigKeyInfoType->SPKIData.array [xmldsigKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 64; + } else if (xmldsigKeyInfoType_MgmtData_currArrayIndex < xmldsigKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].characters, xmldsigKeyInfoType->MgmtData.array[xmldsigKeyInfoType_MgmtData_currArrayIndex].charactersLen); + xmldsigKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 64; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 65; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_xmldsigManifestType(bitstream_t* stream, struct xmldsigManifestType* xmldsigManifestType) { + int grammarID = 66; + int done = 0; + + unsigned int xmldsigManifestType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 66: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if ( xmldsigManifestType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigManifestType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigManifestType->Id.characters, xmldsigManifestType->Id.charactersLen); + } + } + grammarID = 67; + } else if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); + } + grammarID = 61; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 67: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); + } + grammarID = 61; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 61: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (xmldsigManifestType_Reference_currArrayIndex < xmldsigManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &xmldsigManifestType->Reference.array [xmldsigManifestType_Reference_currArrayIndex++]); + } + grammarID = 61; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_xmldsigSignatureValueType(bitstream_t* stream, struct xmldsigSignatureValueType* xmldsigSignatureValueType) { + int grammarID = 68; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 68: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + if ( xmldsigSignatureValueType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigSignatureValueType->Id.characters, xmldsigSignatureValueType->Id.charactersLen); + } + } + grammarID = 69; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytes, xmldsigSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 69: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigSignatureValueType->CONTENT.bytes, xmldsigSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_xmldsigX509DataType(bitstream_t* stream, struct xmldsigX509DataType* xmldsigX509DataType) { + int grammarID = 70; + int done = 0; + + unsigned int xmldsigX509DataType_X509IssuerSerial_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509SKI_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509SubjectName_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509Certificate_currArrayIndex = 0; + unsigned int xmldsigX509DataType_X509CRL_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 70: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + if (xmldsigX509DataType_X509IssuerSerial_currArrayIndex < xmldsigX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array [xmldsigX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 71; + } else if (xmldsigX509DataType_X509SKI_currArrayIndex < xmldsigX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytes, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen); + xmldsigX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (xmldsigX509DataType_X509SubjectName_currArrayIndex < xmldsigX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].characters, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen); + xmldsigX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (xmldsigX509DataType_X509Certificate_currArrayIndex < xmldsigX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytes, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen); + xmldsigX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (xmldsigX509DataType_X509CRL_currArrayIndex < xmldsigX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytes, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen); + xmldsigX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 71; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 71: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (xmldsigX509DataType_X509IssuerSerial_currArrayIndex < xmldsigX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_xmldsigX509IssuerSerialType(stream, &xmldsigX509DataType->X509IssuerSerial.array [xmldsigX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 71; + } else if (xmldsigX509DataType_X509SKI_currArrayIndex < xmldsigX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytes, xmldsigX509DataType->X509SKI.array[xmldsigX509DataType_X509SKI_currArrayIndex].bytesLen); + xmldsigX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (xmldsigX509DataType_X509SubjectName_currArrayIndex < xmldsigX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].characters, xmldsigX509DataType->X509SubjectName.array[xmldsigX509DataType_X509SubjectName_currArrayIndex].charactersLen); + xmldsigX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (xmldsigX509DataType_X509Certificate_currArrayIndex < xmldsigX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytes, xmldsigX509DataType->X509Certificate.array[xmldsigX509DataType_X509Certificate_currArrayIndex].bytesLen); + xmldsigX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (xmldsigX509DataType_X509CRL_currArrayIndex < xmldsigX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytes, xmldsigX509DataType->X509CRL.array[xmldsigX509DataType_X509CRL_currArrayIndex].bytesLen); + xmldsigX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 71; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 6); + if(errn == 0) { + done = 1; + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + + + +int encode_xmldsigExiDocument(bitstream_t* stream, struct xmldsigEXIDocument* exiDoc) { + errn = writeEXIHeader(stream); + + if(errn == 0) { + /* DocContent[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT_GENERIC] */ + if ( exiDoc->CanonicalizationMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = encodeNBitUnsignedInteger(stream, 5, 0); + if(errn == 0) { + errn = encode_xmldsigCanonicalizationMethodType(stream, &exiDoc->CanonicalizationMethod ); + } + } else if ( exiDoc->DSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 5, 1); + if(errn == 0) { + errn = encode_xmldsigDSAKeyValueType(stream, &exiDoc->DSAKeyValue ); + } + } else if ( exiDoc->DigestMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = encodeNBitUnsignedInteger(stream, 5, 2); + if(errn == 0) { + errn = encode_xmldsigDigestMethodType(stream, &exiDoc->DigestMethod ); + } + } else if ( exiDoc->DigestValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + errn = encodeNBitUnsignedInteger(stream, 5, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiDoc->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiDoc->DigestValue.bytes, exiDoc->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiDoc->KeyInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = encodeNBitUnsignedInteger(stream, 5, 4); + if(errn == 0) { + errn = encode_xmldsigKeyInfoType(stream, &exiDoc->KeyInfo ); + } + } else if ( exiDoc->KeyName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + errn = encodeNBitUnsignedInteger(stream, 5, 5); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiDoc->KeyName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiDoc->KeyName.characters, exiDoc->KeyName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiDoc->KeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 5, 6); + if(errn == 0) { + errn = encode_xmldsigKeyValueType(stream, &exiDoc->KeyValue ); + } + } else if ( exiDoc->Manifest_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = encodeNBitUnsignedInteger(stream, 5, 7); + if(errn == 0) { + errn = encode_xmldsigManifestType(stream, &exiDoc->Manifest ); + } + } else if ( exiDoc->MgmtData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + errn = encodeNBitUnsignedInteger(stream, 5, 8); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiDoc->MgmtData.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiDoc->MgmtData.characters, exiDoc->MgmtData.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiDoc->Object_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = encodeNBitUnsignedInteger(stream, 5, 9); + if(errn == 0) { + errn = encode_xmldsigObjectType(stream, &exiDoc->Object ); + } + } else if ( exiDoc->PGPData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = encodeNBitUnsignedInteger(stream, 5, 10); + if(errn == 0) { + errn = encode_xmldsigPGPDataType(stream, &exiDoc->PGPData ); + } + } else if ( exiDoc->RSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 5, 11); + if(errn == 0) { + errn = encode_xmldsigRSAKeyValueType(stream, &exiDoc->RSAKeyValue ); + } + } else if ( exiDoc->Reference_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = encodeNBitUnsignedInteger(stream, 5, 12); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &exiDoc->Reference ); + } + } else if ( exiDoc->RetrievalMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = encodeNBitUnsignedInteger(stream, 5, 13); + if(errn == 0) { + errn = encode_xmldsigRetrievalMethodType(stream, &exiDoc->RetrievalMethod ); + } + } else if ( exiDoc->SPKIData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = encodeNBitUnsignedInteger(stream, 5, 14); + if(errn == 0) { + errn = encode_xmldsigSPKIDataType(stream, &exiDoc->SPKIData ); + } + } else if ( exiDoc->Signature_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = encodeNBitUnsignedInteger(stream, 5, 15); + if(errn == 0) { + errn = encode_xmldsigSignatureType(stream, &exiDoc->Signature ); + } + } else if ( exiDoc->SignatureMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = encodeNBitUnsignedInteger(stream, 5, 16); + if(errn == 0) { + errn = encode_xmldsigSignatureMethodType(stream, &exiDoc->SignatureMethod ); + } + } else if ( exiDoc->SignatureProperties_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = encodeNBitUnsignedInteger(stream, 5, 17); + if(errn == 0) { + errn = encode_xmldsigSignaturePropertiesType(stream, &exiDoc->SignatureProperties ); + } + } else if ( exiDoc->SignatureProperty_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = encodeNBitUnsignedInteger(stream, 5, 18); + if(errn == 0) { + errn = encode_xmldsigSignaturePropertyType(stream, &exiDoc->SignatureProperty ); + } + } else if ( exiDoc->SignatureValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = encodeNBitUnsignedInteger(stream, 5, 19); + if(errn == 0) { + errn = encode_xmldsigSignatureValueType(stream, &exiDoc->SignatureValue ); + } + } else if ( exiDoc->SignedInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = encodeNBitUnsignedInteger(stream, 5, 20); + if(errn == 0) { + errn = encode_xmldsigSignedInfoType(stream, &exiDoc->SignedInfo ); + } + } else if ( exiDoc->Transform_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = encodeNBitUnsignedInteger(stream, 5, 21); + if(errn == 0) { + errn = encode_xmldsigTransformType(stream, &exiDoc->Transform ); + } + } else if ( exiDoc->Transforms_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = encodeNBitUnsignedInteger(stream, 5, 22); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &exiDoc->Transforms ); + } + } else if ( exiDoc->X509Data_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = encodeNBitUnsignedInteger(stream, 5, 23); + if(errn == 0) { + errn = encode_xmldsigX509DataType(stream, &exiDoc->X509Data ); + } + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + + } + + if(errn == 0) { + /* flush any pending bits */ + errn = encodeFinish(stream); + } + + return errn; +} + +#if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES +int encode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* exiFrag) { + errn = writeEXIHeader(stream); + + if(errn == 0) { + /* FragmentContent[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT_GENERIC, END_DOCUMENT] */ + if ( exiFrag->CanonicalizationMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = encodeNBitUnsignedInteger(stream, 6, 0); + if(errn == 0) { + errn = encode_xmldsigCanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod ); + } + } else if ( exiFrag->DSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 6, 1); + if(errn == 0) { + errn = encode_xmldsigDSAKeyValueType(stream, &exiFrag->DSAKeyValue ); + } + } else if ( exiFrag->DigestMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = encodeNBitUnsignedInteger(stream, 6, 2); + if(errn == 0) { + errn = encode_xmldsigDigestMethodType(stream, &exiFrag->DigestMethod ); + } + } else if ( exiFrag->DigestValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + errn = encodeNBitUnsignedInteger(stream, 6, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->DigestValue.bytes, exiFrag->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Exponent_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) */ + errn = encodeNBitUnsignedInteger(stream, 6, 4); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Exponent.bytes, exiFrag->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->G_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) */ + errn = encodeNBitUnsignedInteger(stream, 6, 5); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->G.bytes, exiFrag->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->HMACOutputLength_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) */ + errn = encodeNBitUnsignedInteger(stream, 6, 6); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->J_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) */ + errn = encodeNBitUnsignedInteger(stream, 6, 7); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->J.bytes, exiFrag->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->KeyInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = encodeNBitUnsignedInteger(stream, 6, 8); + if(errn == 0) { + errn = encode_xmldsigKeyInfoType(stream, &exiFrag->KeyInfo ); + } + } else if ( exiFrag->KeyName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + errn = encodeNBitUnsignedInteger(stream, 6, 9); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->KeyName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->KeyName.characters, exiFrag->KeyName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->KeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 6, 10); + if(errn == 0) { + errn = encode_xmldsigKeyValueType(stream, &exiFrag->KeyValue ); + } + } else if ( exiFrag->Manifest_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = encodeNBitUnsignedInteger(stream, 6, 11); + if(errn == 0) { + errn = encode_xmldsigManifestType(stream, &exiFrag->Manifest ); + } + } else if ( exiFrag->MgmtData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + errn = encodeNBitUnsignedInteger(stream, 6, 12); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->MgmtData.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->MgmtData.characters, exiFrag->MgmtData.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Modulus_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) */ + errn = encodeNBitUnsignedInteger(stream, 6, 13); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Modulus.bytes, exiFrag->Modulus.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Object_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = encodeNBitUnsignedInteger(stream, 6, 14); + if(errn == 0) { + errn = encode_xmldsigObjectType(stream, &exiFrag->Object ); + } + } else if ( exiFrag->P_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) */ + errn = encodeNBitUnsignedInteger(stream, 6, 15); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->P.bytes, exiFrag->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PGPData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = encodeNBitUnsignedInteger(stream, 6, 16); + if(errn == 0) { + errn = encode_xmldsigPGPDataType(stream, &exiFrag->PGPData ); + } + } else if ( exiFrag->PGPKeyID_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) */ + errn = encodeNBitUnsignedInteger(stream, 6, 17); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->PGPKeyID.bytes, exiFrag->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->PGPKeyPacket_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) */ + errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT; /* overlapping name PGPKeyPacket */ + } else if ( exiFrag->PgenCounter_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) */ + errn = encodeNBitUnsignedInteger(stream, 6, 19); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->PgenCounter.bytes, exiFrag->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Q_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) */ + errn = encodeNBitUnsignedInteger(stream, 6, 20); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Q.bytes, exiFrag->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->RSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 6, 21); + if(errn == 0) { + errn = encode_xmldsigRSAKeyValueType(stream, &exiFrag->RSAKeyValue ); + } + } else if ( exiFrag->Reference_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = encodeNBitUnsignedInteger(stream, 6, 22); + if(errn == 0) { + errn = encode_xmldsigReferenceType(stream, &exiFrag->Reference ); + } + } else if ( exiFrag->RetrievalMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = encodeNBitUnsignedInteger(stream, 6, 23); + if(errn == 0) { + errn = encode_xmldsigRetrievalMethodType(stream, &exiFrag->RetrievalMethod ); + } + } else if ( exiFrag->SPKIData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = encodeNBitUnsignedInteger(stream, 6, 24); + if(errn == 0) { + errn = encode_xmldsigSPKIDataType(stream, &exiFrag->SPKIData ); + } + } else if ( exiFrag->SPKISexp_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) */ + errn = encodeNBitUnsignedInteger(stream, 6, 25); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->SPKISexp.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->SPKISexp.bytes, exiFrag->SPKISexp.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Seed_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) */ + errn = encodeNBitUnsignedInteger(stream, 6, 26); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Seed.bytes, exiFrag->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Signature_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = encodeNBitUnsignedInteger(stream, 6, 27); + if(errn == 0) { + errn = encode_xmldsigSignatureType(stream, &exiFrag->Signature ); + } + } else if ( exiFrag->SignatureMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = encodeNBitUnsignedInteger(stream, 6, 28); + if(errn == 0) { + errn = encode_xmldsigSignatureMethodType(stream, &exiFrag->SignatureMethod ); + } + } else if ( exiFrag->SignatureProperties_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = encodeNBitUnsignedInteger(stream, 6, 29); + if(errn == 0) { + errn = encode_xmldsigSignaturePropertiesType(stream, &exiFrag->SignatureProperties ); + } + } else if ( exiFrag->SignatureProperty_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = encodeNBitUnsignedInteger(stream, 6, 30); + if(errn == 0) { + errn = encode_xmldsigSignaturePropertyType(stream, &exiFrag->SignatureProperty ); + } + } else if ( exiFrag->SignatureValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = encodeNBitUnsignedInteger(stream, 6, 31); + if(errn == 0) { + errn = encode_xmldsigSignatureValueType(stream, &exiFrag->SignatureValue ); + } + } else if ( exiFrag->SignedInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = encodeNBitUnsignedInteger(stream, 6, 32); + if(errn == 0) { + errn = encode_xmldsigSignedInfoType(stream, &exiFrag->SignedInfo ); + } + } else if ( exiFrag->Transform_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = encodeNBitUnsignedInteger(stream, 6, 33); + if(errn == 0) { + errn = encode_xmldsigTransformType(stream, &exiFrag->Transform ); + } + } else if ( exiFrag->Transforms_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = encodeNBitUnsignedInteger(stream, 6, 34); + if(errn == 0) { + errn = encode_xmldsigTransformsType(stream, &exiFrag->Transforms ); + } + } else if ( exiFrag->X509CRL_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) */ + errn = encodeNBitUnsignedInteger(stream, 6, 35); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509CRL.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509CRL.bytes, exiFrag->X509CRL.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509Certificate_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) */ + errn = encodeNBitUnsignedInteger(stream, 6, 36); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509Certificate.bytes, exiFrag->X509Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509Data_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = encodeNBitUnsignedInteger(stream, 6, 37); + if(errn == 0) { + errn = encode_xmldsigX509DataType(stream, &exiFrag->X509Data ); + } + } else if ( exiFrag->X509IssuerName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) */ + errn = encodeNBitUnsignedInteger(stream, 6, 38); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->X509IssuerName.characters, exiFrag->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509IssuerSerial_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial) */ + errn = encodeNBitUnsignedInteger(stream, 6, 39); + if(errn == 0) { + errn = encode_xmldsigX509IssuerSerialType(stream, &exiFrag->X509IssuerSerial ); + } + } else if ( exiFrag->X509SKI_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) */ + errn = encodeNBitUnsignedInteger(stream, 6, 40); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509SKI.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->X509SKI.bytes, exiFrag->X509SKI.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509SerialNumber_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) */ + errn = encodeNBitUnsignedInteger(stream, 6, 41); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, exiFrag->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->X509SubjectName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) */ + errn = encodeNBitUnsignedInteger(stream, 6, 42); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->X509SubjectName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->X509SubjectName.characters, exiFrag->X509SubjectName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->XPath_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) */ + errn = encodeNBitUnsignedInteger(stream, 6, 43); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->XPath.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiFrag->XPath.characters, exiFrag->XPath.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiFrag->Y_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) */ + errn = encodeNBitUnsignedInteger(stream, 6, 44); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiFrag->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiFrag->Y.bytes, exiFrag->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + + } + + if(errn == 0) { + /* EndDocument */ + errn = encodeNBitUnsignedInteger(stream, 6, 46); + } + + if(errn == 0) { + /* flush any pending bits */ + errn = encodeFinish(stream); + } + + return errn; +} +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + +#endif /* DEPLOY_XMLDSIG_CODEC */ + +#endif + diff --git a/src/xmldsig/xmldsigEXIDatatypesEncoder.h b/src/xmldsig/xmldsigEXIDatatypesEncoder.h new file mode 100644 index 0000000..61d57a3 --- /dev/null +++ b/src/xmldsig/xmldsigEXIDatatypesEncoder.h @@ -0,0 +1,65 @@ +/* + * 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 . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.3 + * @contact Joerg.Heuer@siemens.com + * + * Code generated by EXIdizer + * Schema: xmldsig-core-schema.xsd + * + * + ********************************************************************/ + + + +/** + * \file EXIDatatypesEncoder.h + * \brief Encoder for datatype definitions + * + */ + +#ifndef EXI_xmldsig_DATATYPES_ENCODER_H +#define EXI_xmldsig_DATATYPES_ENCODER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if DEPLOY_XMLDSIG_CODEC == SUPPORT_YES + +#include + +#include "EXITypes.h" +#include "xmldsigEXIDatatypes.h" + + +int encode_xmldsigExiDocument(bitstream_t* stream, struct xmldsigEXIDocument* exiDoc); + +#if DEPLOY_XMLDSIG_CODEC_FRAGMENT == SUPPORT_YES +int encode_xmldsigExiFragment(bitstream_t* stream, struct xmldsigEXIFragment* exiFrag); +#endif /* DEPLOY_XMLDSIG_CODEC_FRAGMENT */ + +#endif /* DEPLOY_XMLDSIG_CODEC */ + +#ifdef __cplusplus +} +#endif + +#endif
Code generated by EXIdizer
Switch for sample programs: EXI codec only or for entire V2G example
Schema: xmldsig-core-schema.xsd