/*
 * Copyright (C) 2007-2018 Siemens AG
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/*******************************************************************
 *
 * @author Daniel.Peintner.EXT@siemens.com
 * @version 0.9.4 
 * @contact Richard.Kuntschke@siemens.com
 *
 * <p>Code generated by EXIdizer</p>
 * <p>Schema: V2G_CI_MsgDef.xsd</p>
 *
 *
 ********************************************************************/




#include "iso1EXIDatatypesDecoder.h"

#include "DecoderChannel.h"
#include "EXIHeaderDecoder.h"

#include "iso1EXIDatatypes.h"
#include "ErrorCodes.h"

#ifndef EXI_iso1_DATATYPES_DECODER_C
#define EXI_iso1_DATATYPES_DECODER_C

#if DEPLOY_ISO1_CODEC == SUPPORT_YES

/** event-code */
static uint32_t eventCode;
static int errn;
static uint32_t uint32;

/* Forward Declarations */
static int decode_iso1MessageHeaderType(bitstream_t* stream, struct iso1MessageHeaderType* iso1MessageHeaderType);
static int decode_iso1SignatureType(bitstream_t* stream, struct iso1SignatureType* iso1SignatureType);
static int decode_iso1PowerDeliveryReqType(bitstream_t* stream, struct iso1PowerDeliveryReqType* iso1PowerDeliveryReqType);
static int decode_iso1ParameterType(bitstream_t* stream, struct iso1ParameterType* iso1ParameterType);
static int decode_iso1CertificateInstallationReqType(bitstream_t* stream, struct iso1CertificateInstallationReqType* iso1CertificateInstallationReqType);
static int decode_iso1SessionSetupResType(bitstream_t* stream, struct iso1SessionSetupResType* iso1SessionSetupResType);
static int decode_iso1EVChargeParameterType(bitstream_t* stream, struct iso1EVChargeParameterType* iso1EVChargeParameterType);
static int decode_iso1DiffieHellmanPublickeyType(bitstream_t* stream, struct iso1DiffieHellmanPublickeyType* iso1DiffieHellmanPublickeyType);
static int decode_iso1ServiceDiscoveryResType(bitstream_t* stream, struct iso1ServiceDiscoveryResType* iso1ServiceDiscoveryResType);
static int decode_iso1ServiceParameterListType(bitstream_t* stream, struct iso1ServiceParameterListType* iso1ServiceParameterListType);
static int decode_iso1CertificateChainType(bitstream_t* stream, struct iso1CertificateChainType* iso1CertificateChainType);
static int decode_iso1SASchedulesType(bitstream_t* stream, struct iso1SASchedulesType* iso1SASchedulesType);
static int decode_iso1DC_EVSEStatusType(bitstream_t* stream, struct iso1DC_EVSEStatusType* iso1DC_EVSEStatusType);
static int decode_iso1PreChargeResType(bitstream_t* stream, struct iso1PreChargeResType* iso1PreChargeResType);
static int decode_iso1ParameterSetType(bitstream_t* stream, struct iso1ParameterSetType* iso1ParameterSetType);
static int decode_iso1ServiceDetailReqType(bitstream_t* stream, struct iso1ServiceDetailReqType* iso1ServiceDetailReqType);
static int decode_iso1RelativeTimeIntervalType(bitstream_t* stream, struct iso1RelativeTimeIntervalType* iso1RelativeTimeIntervalType);
static int decode_iso1SignedInfoType(bitstream_t* stream, struct iso1SignedInfoType* iso1SignedInfoType);
static int decode_iso1EMAIDType(bitstream_t* stream, struct iso1EMAIDType* iso1EMAIDType);
static int decode_iso1EVStatusType(bitstream_t* stream, struct iso1EVStatusType* iso1EVStatusType);
static int decode_iso1ServiceListType(bitstream_t* stream, struct iso1ServiceListType* iso1ServiceListType);
static int decode_iso1EVSEChargeParameterType(bitstream_t* stream, struct iso1EVSEChargeParameterType* iso1EVSEChargeParameterType);
static int decode_iso1EVPowerDeliveryParameterType(bitstream_t* stream, struct iso1EVPowerDeliveryParameterType* iso1EVPowerDeliveryParameterType);
static int decode_iso1ProfileEntryType(bitstream_t* stream, struct iso1ProfileEntryType* iso1ProfileEntryType);
static int decode_iso1AuthorizationReqType(bitstream_t* stream, struct iso1AuthorizationReqType* iso1AuthorizationReqType);
static int decode_iso1MeterInfoType(bitstream_t* stream, struct iso1MeterInfoType* iso1MeterInfoType);
static int decode_iso1ManifestType(bitstream_t* stream, struct iso1ManifestType* iso1ManifestType);
static int decode_iso1ChargeParameterDiscoveryResType(bitstream_t* stream, struct iso1ChargeParameterDiscoveryResType* iso1ChargeParameterDiscoveryResType);
static int decode_iso1PowerDeliveryResType(bitstream_t* stream, struct iso1PowerDeliveryResType* iso1PowerDeliveryResType);
static int decode_iso1DC_EVChargeParameterType(bitstream_t* stream, struct iso1DC_EVChargeParameterType* iso1DC_EVChargeParameterType);
static int decode_iso1ConsumptionCostType(bitstream_t* stream, struct iso1ConsumptionCostType* iso1ConsumptionCostType);
static int decode_iso1PMaxScheduleType(bitstream_t* stream, struct iso1PMaxScheduleType* iso1PMaxScheduleType);
static int decode_iso1PaymentOptionListType(bitstream_t* stream, struct iso1PaymentOptionListType* iso1PaymentOptionListType);
static int decode_iso1ObjectType(bitstream_t* stream, struct iso1ObjectType* iso1ObjectType);
static int decode_iso1PhysicalValueType(bitstream_t* stream, struct iso1PhysicalValueType* iso1PhysicalValueType);
static int decode_iso1RSAKeyValueType(bitstream_t* stream, struct iso1RSAKeyValueType* iso1RSAKeyValueType);
static int decode_iso1SessionStopResType(bitstream_t* stream, struct iso1SessionStopResType* iso1SessionStopResType);
static int decode_iso1CertificateUpdateReqType(bitstream_t* stream, struct iso1CertificateUpdateReqType* iso1CertificateUpdateReqType);
static int decode_iso1SignatureValueType(bitstream_t* stream, struct iso1SignatureValueType* iso1SignatureValueType);
static int decode_iso1PaymentDetailsReqType(bitstream_t* stream, struct iso1PaymentDetailsReqType* iso1PaymentDetailsReqType);
static int decode_iso1AuthorizationResType(bitstream_t* stream, struct iso1AuthorizationResType* iso1AuthorizationResType);
static int decode_iso1DC_EVSEChargeParameterType(bitstream_t* stream, struct iso1DC_EVSEChargeParameterType* iso1DC_EVSEChargeParameterType);
static int decode_iso1SubCertificatesType(bitstream_t* stream, struct iso1SubCertificatesType* iso1SubCertificatesType);
static int decode_iso1ChargingStatusResType(bitstream_t* stream, struct iso1ChargingStatusResType* iso1ChargingStatusResType);
static int decode_iso1DSAKeyValueType(bitstream_t* stream, struct iso1DSAKeyValueType* iso1DSAKeyValueType);
static int decode_iso1ListOfRootCertificateIDsType(bitstream_t* stream, struct iso1ListOfRootCertificateIDsType* iso1ListOfRootCertificateIDsType);
static int decode_iso1ChargeServiceType(bitstream_t* stream, struct iso1ChargeServiceType* iso1ChargeServiceType);
static int decode_iso1IntervalType(bitstream_t* stream, struct iso1IntervalType* iso1IntervalType);
static int decode_iso1MeteringReceiptReqType(bitstream_t* stream, struct iso1MeteringReceiptReqType* iso1MeteringReceiptReqType);
static int decode_iso1ServiceDetailResType(bitstream_t* stream, struct iso1ServiceDetailResType* iso1ServiceDetailResType);
static int decode_iso1KeyValueType(bitstream_t* stream, struct iso1KeyValueType* iso1KeyValueType);
static int decode_iso1SelectedServiceListType(bitstream_t* stream, struct iso1SelectedServiceListType* iso1SelectedServiceListType);
static int decode_iso1CableCheckResType(bitstream_t* stream, struct iso1CableCheckResType* iso1CableCheckResType);
static int decode_iso1X509IssuerSerialType(bitstream_t* stream, struct iso1X509IssuerSerialType* iso1X509IssuerSerialType);
static int decode_iso1KeyInfoType(bitstream_t* stream, struct iso1KeyInfoType* iso1KeyInfoType);
static int decode_iso1TransformsType(bitstream_t* stream, struct iso1TransformsType* iso1TransformsType);
static int decode_iso1ChargeParameterDiscoveryReqType(bitstream_t* stream, struct iso1ChargeParameterDiscoveryReqType* iso1ChargeParameterDiscoveryReqType);
static int decode_iso1PreChargeReqType(bitstream_t* stream, struct iso1PreChargeReqType* iso1PreChargeReqType);
static int decode_iso1EVSEStatusType(bitstream_t* stream, struct iso1EVSEStatusType* iso1EVSEStatusType);
static int decode_iso1SignatureMethodType(bitstream_t* stream, struct iso1SignatureMethodType* iso1SignatureMethodType);
static int decode_iso1X509DataType(bitstream_t* stream, struct iso1X509DataType* iso1X509DataType);
static int decode_iso1NotificationType(bitstream_t* stream, struct iso1NotificationType* iso1NotificationType);
static int decode_iso1SAScheduleListType(bitstream_t* stream, struct iso1SAScheduleListType* iso1SAScheduleListType);
static int decode_iso1BodyType(bitstream_t* stream, struct iso1BodyType* iso1BodyType);
static int decode_iso1ChargingProfileType(bitstream_t* stream, struct iso1ChargingProfileType* iso1ChargingProfileType);
static int decode_iso1TransformType(bitstream_t* stream, struct iso1TransformType* iso1TransformType);
static int decode_iso1SAScheduleTupleType(bitstream_t* stream, struct iso1SAScheduleTupleType* iso1SAScheduleTupleType);
static int decode_iso1AC_EVChargeParameterType(bitstream_t* stream, struct iso1AC_EVChargeParameterType* iso1AC_EVChargeParameterType);
static int decode_iso1AnonType_V2G_Message(bitstream_t* stream, struct iso1AnonType_V2G_Message* iso1AnonType_V2G_Message);
static int decode_iso1PaymentDetailsResType(bitstream_t* stream, struct iso1PaymentDetailsResType* iso1PaymentDetailsResType);
static int decode_iso1ContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct iso1ContractSignatureEncryptedPrivateKeyType* iso1ContractSignatureEncryptedPrivateKeyType);
static int decode_iso1PMaxScheduleEntryType(bitstream_t* stream, struct iso1PMaxScheduleEntryType* iso1PMaxScheduleEntryType);
static int decode_iso1SPKIDataType(bitstream_t* stream, struct iso1SPKIDataType* iso1SPKIDataType);
static int decode_iso1MeteringReceiptResType(bitstream_t* stream, struct iso1MeteringReceiptResType* iso1MeteringReceiptResType);
static int decode_iso1SessionStopReqType(bitstream_t* stream, struct iso1SessionStopReqType* iso1SessionStopReqType);
static int decode_iso1WeldingDetectionResType(bitstream_t* stream, struct iso1WeldingDetectionResType* iso1WeldingDetectionResType);
static int decode_iso1ReferenceType(bitstream_t* stream, struct iso1ReferenceType* iso1ReferenceType);
static int decode_iso1CurrentDemandReqType(bitstream_t* stream, struct iso1CurrentDemandReqType* iso1CurrentDemandReqType);
static int decode_iso1SalesTariffEntryType(bitstream_t* stream, struct iso1SalesTariffEntryType* iso1SalesTariffEntryType);
static int decode_iso1EntryType(bitstream_t* stream, struct iso1EntryType* iso1EntryType);
static int decode_iso1SessionSetupReqType(bitstream_t* stream, struct iso1SessionSetupReqType* iso1SessionSetupReqType);
static int decode_iso1CostType(bitstream_t* stream, struct iso1CostType* iso1CostType);
static int decode_iso1DC_EVPowerDeliveryParameterType(bitstream_t* stream, struct iso1DC_EVPowerDeliveryParameterType* iso1DC_EVPowerDeliveryParameterType);
static int decode_iso1RetrievalMethodType(bitstream_t* stream, struct iso1RetrievalMethodType* iso1RetrievalMethodType);
static int decode_iso1CertificateUpdateResType(bitstream_t* stream, struct iso1CertificateUpdateResType* iso1CertificateUpdateResType);
static int decode_iso1CertificateInstallationResType(bitstream_t* stream, struct iso1CertificateInstallationResType* iso1CertificateInstallationResType);
static int decode_iso1CanonicalizationMethodType(bitstream_t* stream, struct iso1CanonicalizationMethodType* iso1CanonicalizationMethodType);
static int decode_iso1WeldingDetectionReqType(bitstream_t* stream, struct iso1WeldingDetectionReqType* iso1WeldingDetectionReqType);
static int decode_iso1DC_EVStatusType(bitstream_t* stream, struct iso1DC_EVStatusType* iso1DC_EVStatusType);
static int decode_iso1CurrentDemandResType(bitstream_t* stream, struct iso1CurrentDemandResType* iso1CurrentDemandResType);
static int decode_iso1ServiceType(bitstream_t* stream, struct iso1ServiceType* iso1ServiceType);
static int decode_iso1ServiceDiscoveryReqType(bitstream_t* stream, struct iso1ServiceDiscoveryReqType* iso1ServiceDiscoveryReqType);
static int decode_iso1AC_EVSEChargeParameterType(bitstream_t* stream, struct iso1AC_EVSEChargeParameterType* iso1AC_EVSEChargeParameterType);
static int decode_iso1CableCheckReqType(bitstream_t* stream, struct iso1CableCheckReqType* iso1CableCheckReqType);
static int decode_iso1SelectedServiceType(bitstream_t* stream, struct iso1SelectedServiceType* iso1SelectedServiceType);
static int decode_iso1AC_EVSEStatusType(bitstream_t* stream, struct iso1AC_EVSEStatusType* iso1AC_EVSEStatusType);
static int decode_iso1SalesTariffType(bitstream_t* stream, struct iso1SalesTariffType* iso1SalesTariffType);
static int decode_iso1PaymentServiceSelectionReqType(bitstream_t* stream, struct iso1PaymentServiceSelectionReqType* iso1PaymentServiceSelectionReqType);
static int decode_iso1SignaturePropertiesType(bitstream_t* stream, struct iso1SignaturePropertiesType* iso1SignaturePropertiesType);
static int decode_iso1BodyBaseType(bitstream_t* stream, struct iso1BodyBaseType* iso1BodyBaseType);
static int decode_iso1SupportedEnergyTransferModeType(bitstream_t* stream, struct iso1SupportedEnergyTransferModeType* iso1SupportedEnergyTransferModeType);
static int decode_iso1ChargingStatusReqType(bitstream_t* stream, struct iso1ChargingStatusReqType* iso1ChargingStatusReqType);
static int decode_iso1PaymentServiceSelectionResType(bitstream_t* stream, struct iso1PaymentServiceSelectionResType* iso1PaymentServiceSelectionResType);
static int decode_iso1DigestMethodType(bitstream_t* stream, struct iso1DigestMethodType* iso1DigestMethodType);
static int decode_iso1SignaturePropertyType(bitstream_t* stream, struct iso1SignaturePropertyType* iso1SignaturePropertyType);
static int decode_iso1PGPDataType(bitstream_t* stream, struct iso1PGPDataType* iso1PGPDataType);

/* Deviant data decoding (skip functions) */



/* 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_iso1MessageHeaderType(bitstream_t* stream, struct iso1MessageHeaderType* iso1MessageHeaderType) {
	int grammarID = 0;
	int done = 0;
	
	init_iso1MessageHeaderType(iso1MessageHeaderType);
	
	while(!done) {
		switch(grammarID) {
		case 0:
			/* 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, &iso1MessageHeaderType->SessionID.bytesLen);
							if (errn == 0) {
								errn =  (iso1MessageHeaderType->SessionID.bytesLen) <= iso1MessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1MessageHeaderType->SessionID.bytesLen, iso1MessageHeaderType->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 = 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: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_iso1NotificationType(stream, &iso1MessageHeaderType->Notification);
					iso1MessageHeaderType->Notification_isUsed = 1u;
					grammarID = 2;
					break;
				case 1:
					errn = decode_iso1SignatureType(stream, &iso1MessageHeaderType->Signature);
					iso1MessageHeaderType->Signature_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 2:
			/* 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_iso1SignatureType(stream, &iso1MessageHeaderType->Signature);
					iso1MessageHeaderType->Signature_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#,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_iso1SignatureType(bitstream_t* stream, struct iso1SignatureType* iso1SignatureType) {
	int grammarID = 5;
	int done = 0;
	
	init_iso1SignatureType(iso1SignatureType);
	
	while(!done) {
		switch(grammarID) {
		case 5:
			/* 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, &iso1SignatureType->Id.charactersLen);
					if (errn == 0) {
						if (iso1SignatureType->Id.charactersLen >= 2) {
							iso1SignatureType->Id.charactersLen = (uint16_t)(iso1SignatureType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignatureType->Id.charactersLen, iso1SignatureType->Id.characters, iso1SignatureType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignatureType->Id_isUsed = 1u;
					grammarID = 6;
					break;
				case 1:
					errn = decode_iso1SignedInfoType(stream, &iso1SignatureType->SignedInfo);
					grammarID = 7;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 6:
			/* 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_iso1SignedInfoType(stream, &iso1SignatureType->SignedInfo);
					grammarID = 7;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 7:
			/* 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_iso1SignatureValueType(stream, &iso1SignatureType->SignatureValue);
					grammarID = 8;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 8:
			/* 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_iso1KeyInfoType(stream, &iso1SignatureType->KeyInfo);
					iso1SignatureType->KeyInfo_isUsed = 1u;
					grammarID = 9;
					break;
				case 1:
					if (iso1SignatureType->Object.arrayLen < iso1SignatureType_Object_ARRAY_SIZE) {
						errn = decode_iso1ObjectType(stream, &iso1SignatureType->Object.array[iso1SignatureType->Object.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 9;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 9:
			/* 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 (iso1SignatureType->Object.arrayLen < iso1SignatureType_Object_ARRAY_SIZE) {
						errn = decode_iso1ObjectType(stream, &iso1SignatureType->Object.array[iso1SignatureType->Object.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 9;
					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,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_iso1PowerDeliveryReqType(bitstream_t* stream, struct iso1PowerDeliveryReqType* iso1PowerDeliveryReqType) {
	int grammarID = 10;
	int done = 0;
	
	init_iso1PowerDeliveryReqType(iso1PowerDeliveryReqType);
	
	while(!done) {
		switch(grammarID) {
		case 10:
			/* 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);
							iso1PowerDeliveryReqType->ChargeProgress = (iso1chargeProgressType) 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 = 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}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));
							iso1PowerDeliveryReqType->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 = 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}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_iso1ChargingProfileType(stream, &iso1PowerDeliveryReqType->ChargingProfile);
					iso1PowerDeliveryReqType->ChargingProfile_isUsed = 1u;
					grammarID = 13;
					break;
				case 1:
					errn = decode_iso1DC_EVPowerDeliveryParameterType(stream, &iso1PowerDeliveryReqType->DC_EVPowerDeliveryParameter);
					iso1PowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					errn = decode_iso1EVPowerDeliveryParameterType(stream, &iso1PowerDeliveryReqType->EVPowerDeliveryParameter);
					iso1PowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 3:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 13:
			/* 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_iso1DC_EVPowerDeliveryParameterType(stream, &iso1PowerDeliveryReqType->DC_EVPowerDeliveryParameter);
					iso1PowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 1:
					errn = decode_iso1EVPowerDeliveryParameterType(stream, &iso1PowerDeliveryReqType->EVPowerDeliveryParameter);
					iso1PowerDeliveryReqType->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,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_iso1ParameterType(bitstream_t* stream, struct iso1ParameterType* iso1ParameterType) {
	int grammarID = 14;
	int done = 0;
	
	init_iso1ParameterType(iso1ParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 14:
			/* 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, &iso1ParameterType->Name.charactersLen);
					if (errn == 0) {
						if (iso1ParameterType->Name.charactersLen >= 2) {
							iso1ParameterType->Name.charactersLen = (uint16_t)(iso1ParameterType->Name.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ParameterType->Name.charactersLen, iso1ParameterType->Name.characters, iso1ParameterType_Name_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 15;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 15:
			/* 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, &iso1ParameterType->boolValue);
							iso1ParameterType->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));
							iso1ParameterType->byteValue = (int8_t)(uint32 -128);
							iso1ParameterType->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, &iso1ParameterType->shortValue);
							iso1ParameterType->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, &iso1ParameterType->intValue);
							iso1ParameterType->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_iso1PhysicalValueType(stream, &iso1ParameterType->physicalValue);
					iso1ParameterType->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, &iso1ParameterType->stringValue.charactersLen);
							if (errn == 0) {
								if (iso1ParameterType->stringValue.charactersLen >= 2) {
									iso1ParameterType->stringValue.charactersLen = (uint16_t)(iso1ParameterType->stringValue.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1ParameterType->stringValue.charactersLen, iso1ParameterType->stringValue.characters, iso1ParameterType_stringValue_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1ParameterType->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: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_iso1CertificateInstallationReqType(bitstream_t* stream, struct iso1CertificateInstallationReqType* iso1CertificateInstallationReqType) {
	int grammarID = 16;
	int done = 0;
	
	init_iso1CertificateInstallationReqType(iso1CertificateInstallationReqType);
	
	while(!done) {
		switch(grammarID) {
		case 16:
			/* 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, &iso1CertificateInstallationReqType->Id.charactersLen);
					if (errn == 0) {
						if (iso1CertificateInstallationReqType->Id.charactersLen >= 2) {
							iso1CertificateInstallationReqType->Id.charactersLen = (uint16_t)(iso1CertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1CertificateInstallationReqType->Id.charactersLen, iso1CertificateInstallationReqType->Id.characters, iso1CertificateInstallationReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 17;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 17:
			/* 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, &iso1CertificateInstallationReqType->OEMProvisioningCert.bytesLen);
							if (errn == 0) {
								errn =  (iso1CertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= iso1CertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1CertificateInstallationReqType->OEMProvisioningCert.bytesLen, iso1CertificateInstallationReqType->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 = 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}ListOfRootCertificateIDs)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1ListOfRootCertificateIDsType(stream, &iso1CertificateInstallationReqType->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: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_iso1SessionSetupResType(bitstream_t* stream, struct iso1SessionSetupResType* iso1SessionSetupResType) {
	int grammarID = 19;
	int done = 0;
	
	init_iso1SessionSetupResType(iso1SessionSetupResType);
	
	while(!done) {
		switch(grammarID) {
		case 19:
			/* 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);
							iso1SessionSetupResType->ResponseCode = (iso1responseCodeType) 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 = 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({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, &iso1SessionSetupResType->EVSEID.charactersLen);
							if (errn == 0) {
								if (iso1SessionSetupResType->EVSEID.charactersLen >= 2) {
									iso1SessionSetupResType->EVSEID.charactersLen = (uint16_t)(iso1SessionSetupResType->EVSEID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1SessionSetupResType->EVSEID.charactersLen, iso1SessionSetupResType->EVSEID.characters, iso1SessionSetupResType_EVSEID_CHARACTERS_SIZE);
								} 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 = 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: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, &iso1SessionSetupResType->EVSETimeStamp);
							iso1SessionSetupResType->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: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_iso1EVChargeParameterType(bitstream_t* stream, struct iso1EVChargeParameterType* iso1EVChargeParameterType) {
	int grammarID = 22;
	int done = 0;
	
	init_iso1EVChargeParameterType(iso1EVChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 22:
			/* 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, &iso1EVChargeParameterType->DepartureTime);
							iso1EVChargeParameterType->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,DiffieHellmanPublickeyType',  base type name='dHpublickeyType',  content type='SIMPLE',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  derivedBy='EXTENSION'.  */
static int decode_iso1DiffieHellmanPublickeyType(bitstream_t* stream, struct iso1DiffieHellmanPublickeyType* iso1DiffieHellmanPublickeyType) {
	int grammarID = 23;
	int done = 0;
	
	init_iso1DiffieHellmanPublickeyType(iso1DiffieHellmanPublickeyType);
	
	while(!done) {
		switch(grammarID) {
		case 23:
			/* 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, &iso1DiffieHellmanPublickeyType->Id.charactersLen);
					if (errn == 0) {
						if (iso1DiffieHellmanPublickeyType->Id.charactersLen >= 2) {
							iso1DiffieHellmanPublickeyType->Id.charactersLen = (uint16_t)(iso1DiffieHellmanPublickeyType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1DiffieHellmanPublickeyType->Id.charactersLen, iso1DiffieHellmanPublickeyType->Id.characters, iso1DiffieHellmanPublickeyType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 24;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 24:
			/* StartTag[CHARACTERS[BINARY_BASE64]] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1DiffieHellmanPublickeyType->CONTENT.bytesLen);
					if (errn == 0) {
						errn =  (iso1DiffieHellmanPublickeyType->CONTENT.bytesLen) <= iso1DiffieHellmanPublickeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
					}
					if (errn == 0) {
						errn = decodeBytes(stream, iso1DiffieHellmanPublickeyType->CONTENT.bytesLen, iso1DiffieHellmanPublickeyType->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,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_iso1ServiceDiscoveryResType(bitstream_t* stream, struct iso1ServiceDiscoveryResType* iso1ServiceDiscoveryResType) {
	int grammarID = 25;
	int done = 0;
	
	init_iso1ServiceDiscoveryResType(iso1ServiceDiscoveryResType);
	
	while(!done) {
		switch(grammarID) {
		case 25:
			/* 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);
							iso1ServiceDiscoveryResType->ResponseCode = (iso1responseCodeType) 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 = 26;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 26:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PaymentOptionListType(stream, &iso1ServiceDiscoveryResType->PaymentOptionList);
					grammarID = 27;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 27:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1ChargeServiceType(stream, &iso1ServiceDiscoveryResType->ChargeService);
					grammarID = 28;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 28:
			/* 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_iso1ServiceListType(stream, &iso1ServiceDiscoveryResType->ServiceList);
					iso1ServiceDiscoveryResType->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: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_iso1ServiceParameterListType(bitstream_t* stream, struct iso1ServiceParameterListType* iso1ServiceParameterListType) {
	int grammarID = 29;
	int done = 0;
	
	init_iso1ServiceParameterListType(iso1ServiceParameterListType);
	
	while(!done) {
		switch(grammarID) {
		case 29:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ServiceParameterListType->ParameterSet.arrayLen < iso1ServiceParameterListType_ParameterSet_ARRAY_SIZE) {
						errn = decode_iso1ParameterSetType(stream, &iso1ServiceParameterListType->ParameterSet.array[iso1ServiceParameterListType->ParameterSet.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 30;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 30:
			/* 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 (iso1ServiceParameterListType->ParameterSet.arrayLen < iso1ServiceParameterListType_ParameterSet_ARRAY_SIZE) {
						errn = decode_iso1ParameterSetType(stream, &iso1ServiceParameterListType->ParameterSet.array[iso1ServiceParameterListType->ParameterSet.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 30;
					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,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_iso1CertificateChainType(bitstream_t* stream, struct iso1CertificateChainType* iso1CertificateChainType) {
	int grammarID = 31;
	int done = 0;
	
	init_iso1CertificateChainType(iso1CertificateChainType);
	
	while(!done) {
		switch(grammarID) {
		case 31:
			/* 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, &iso1CertificateChainType->Id.charactersLen);
					if (errn == 0) {
						if (iso1CertificateChainType->Id.charactersLen >= 2) {
							iso1CertificateChainType->Id.charactersLen = (uint16_t)(iso1CertificateChainType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1CertificateChainType->Id.charactersLen, iso1CertificateChainType->Id.characters, iso1CertificateChainType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1CertificateChainType->Id_isUsed = 1u;
					grammarID = 32;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1CertificateChainType->Certificate.bytesLen);
							if (errn == 0) {
								errn =  (iso1CertificateChainType->Certificate.bytesLen) <= iso1CertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1CertificateChainType->Certificate.bytesLen, iso1CertificateChainType->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 = 33;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 32:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */
			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, &iso1CertificateChainType->Certificate.bytesLen);
							if (errn == 0) {
								errn =  (iso1CertificateChainType->Certificate.bytesLen) <= iso1CertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1CertificateChainType->Certificate.bytesLen, iso1CertificateChainType->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 = 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:2013:MsgDataTypes}SubCertificates), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1SubCertificatesType(stream, &iso1CertificateChainType->SubCertificates);
					iso1CertificateChainType->SubCertificates_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:MsgDataTypes,SASchedulesType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_iso1SASchedulesType(bitstream_t* stream, struct iso1SASchedulesType* iso1SASchedulesType) {
	int grammarID = 34;
	int done = 0;
	
	init_iso1SASchedulesType(iso1SASchedulesType);
	
	while(!done) {
		switch(grammarID) {
		case 34:
			/* 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,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_iso1DC_EVSEStatusType(bitstream_t* stream, struct iso1DC_EVSEStatusType* iso1DC_EVSEStatusType) {
	int grammarID = 35;
	int done = 0;
	
	init_iso1DC_EVSEStatusType(iso1DC_EVSEStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 35:
			/* 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, &iso1DC_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 = 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: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);
							iso1DC_EVSEStatusType->EVSENotification = (iso1EVSENotificationType) 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 = 37;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 37:
			/* 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);
							iso1DC_EVSEStatusType->EVSEIsolationStatus = (iso1isolationLevelType) uint32;
							iso1DC_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 = 38;
						} 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);
							iso1DC_EVSEStatusType->EVSEStatusCode = (iso1DC_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;
				}
			}
			break;
		case 38:
			/* 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);
							iso1DC_EVSEStatusType->EVSEStatusCode = (iso1DC_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;
				}
			}
			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_iso1PreChargeResType(bitstream_t* stream, struct iso1PreChargeResType* iso1PreChargeResType) {
	int grammarID = 39;
	int done = 0;
	
	init_iso1PreChargeResType(iso1PreChargeResType);
	
	while(!done) {
		switch(grammarID) {
		case 39:
			/* 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);
							iso1PreChargeResType->ResponseCode = (iso1responseCodeType) 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 = 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({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1DC_EVSEStatusType(stream, &iso1PreChargeResType->DC_EVSEStatus);
					grammarID = 41;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 41:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1PreChargeResType->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,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-16})',  derivedBy='RESTRICTION'.  */
static int decode_iso1ParameterSetType(bitstream_t* stream, struct iso1ParameterSetType* iso1ParameterSetType) {
	int grammarID = 42;
	int done = 0;
	
	init_iso1ParameterSetType(iso1ParameterSetType);
	
	while(!done) {
		switch(grammarID) {
		case 42:
			/* 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, &iso1ParameterSetType->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 = 43;
						} 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({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 44;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 44:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 45;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 45:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 46;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 46:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 47;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 47:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.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;
		case 48:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 49;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 49:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 50;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 50:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 51;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 51:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 52;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 52:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 53;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 54;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 54:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 55;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 55:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 56;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 56:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 57;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 57:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 58;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 58:
			/* 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 (iso1ParameterSetType->Parameter.arrayLen < iso1ParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_iso1ParameterType(stream, &iso1ParameterSetType->Parameter.array[iso1ParameterSetType->Parameter.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,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_iso1ServiceDetailReqType(bitstream_t* stream, struct iso1ServiceDetailReqType* iso1ServiceDetailReqType) {
	int grammarID = 59;
	int done = 0;
	
	init_iso1ServiceDetailReqType(iso1ServiceDetailReqType);
	
	while(!done) {
		switch(grammarID) {
		case 59:
			/* 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, &iso1ServiceDetailReqType->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='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_iso1RelativeTimeIntervalType(bitstream_t* stream, struct iso1RelativeTimeIntervalType* iso1RelativeTimeIntervalType) {
	int grammarID = 60;
	int done = 0;
	
	init_iso1RelativeTimeIntervalType(iso1RelativeTimeIntervalType);
	
	while(!done) {
		switch(grammarID) {
		case 60:
			/* 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, &iso1RelativeTimeIntervalType->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 = 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: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, &iso1RelativeTimeIntervalType->duration);
							iso1RelativeTimeIntervalType->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#,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_iso1SignedInfoType(bitstream_t* stream, struct iso1SignedInfoType* iso1SignedInfoType) {
	int grammarID = 62;
	int done = 0;
	
	init_iso1SignedInfoType(iso1SignedInfoType);
	
	while(!done) {
		switch(grammarID) {
		case 62:
			/* 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, &iso1SignedInfoType->Id.charactersLen);
					if (errn == 0) {
						if (iso1SignedInfoType->Id.charactersLen >= 2) {
							iso1SignedInfoType->Id.charactersLen = (uint16_t)(iso1SignedInfoType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignedInfoType->Id.charactersLen, iso1SignedInfoType->Id.characters, iso1SignedInfoType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignedInfoType->Id_isUsed = 1u;
					grammarID = 63;
					break;
				case 1:
					errn = decode_iso1CanonicalizationMethodType(stream, &iso1SignedInfoType->CanonicalizationMethod);
					grammarID = 64;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 63:
			/* 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_iso1CanonicalizationMethodType(stream, &iso1SignedInfoType->CanonicalizationMethod);
					grammarID = 64;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 64:
			/* 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_iso1SignatureMethodType(stream, &iso1SignedInfoType->SignatureMethod);
					grammarID = 65;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 65:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SignedInfoType->Reference.arrayLen < iso1SignedInfoType_Reference_ARRAY_SIZE) {
						errn = decode_iso1ReferenceType(stream, &iso1SignedInfoType->Reference.array[iso1SignedInfoType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 66;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 66:
			/* 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 (iso1SignedInfoType->Reference.arrayLen < iso1SignedInfoType_Reference_ARRAY_SIZE) {
						errn = decode_iso1ReferenceType(stream, &iso1SignedInfoType->Reference.array[iso1SignedInfoType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 66;
					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,EMAIDType',  base type name='eMAIDType',  content type='SIMPLE',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  derivedBy='EXTENSION'.  */
static int decode_iso1EMAIDType(bitstream_t* stream, struct iso1EMAIDType* iso1EMAIDType) {
	int grammarID = 67;
	int done = 0;
	
	init_iso1EMAIDType(iso1EMAIDType);
	
	while(!done) {
		switch(grammarID) {
		case 67:
			/* 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, &iso1EMAIDType->Id.charactersLen);
					if (errn == 0) {
						if (iso1EMAIDType->Id.charactersLen >= 2) {
							iso1EMAIDType->Id.charactersLen = (uint16_t)(iso1EMAIDType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1EMAIDType->Id.charactersLen, iso1EMAIDType->Id.characters, iso1EMAIDType_Id_CHARACTERS_SIZE);
						} 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[CHARACTERS[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1EMAIDType->CONTENT.charactersLen);
					if (errn == 0) {
						if (iso1EMAIDType->CONTENT.charactersLen >= 2) {
							iso1EMAIDType->CONTENT.charactersLen = (uint16_t)(iso1EMAIDType->CONTENT.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1EMAIDType->CONTENT.charactersLen, iso1EMAIDType->CONTENT.characters, iso1EMAIDType_CONTENT_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					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,EVStatusType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_iso1EVStatusType(bitstream_t* stream, struct iso1EVStatusType* iso1EVStatusType) {
	int grammarID = 34;
	int done = 0;
	
	init_iso1EVStatusType(iso1EVStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 34:
			/* 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,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_iso1ServiceListType(bitstream_t* stream, struct iso1ServiceListType* iso1ServiceListType) {
	int grammarID = 69;
	int done = 0;
	
	init_iso1ServiceListType(iso1ServiceListType);
	
	while(!done) {
		switch(grammarID) {
		case 69:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 70;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 70:
			/* 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 (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 71;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 71:
			/* 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 (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 72;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 72:
			/* 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 (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 73;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 73:
			/* 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 (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 74;
					break;
				case 1:
					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}Service), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 75;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 75:
			/* 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 (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->Service.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;
		case 76:
			/* 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 (iso1ServiceListType->Service.arrayLen < iso1ServiceListType_Service_ARRAY_SIZE) {
						errn = decode_iso1ServiceType(stream, &iso1ServiceListType->Service.array[iso1ServiceListType->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,EVSEChargeParameterType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_iso1EVSEChargeParameterType(bitstream_t* stream, struct iso1EVSEChargeParameterType* iso1EVSEChargeParameterType) {
	int grammarID = 34;
	int done = 0;
	
	init_iso1EVSEChargeParameterType(iso1EVSEChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 34:
			/* 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,EVPowerDeliveryParameterType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_iso1EVPowerDeliveryParameterType(bitstream_t* stream, struct iso1EVPowerDeliveryParameterType* iso1EVPowerDeliveryParameterType) {
	int grammarID = 34;
	int done = 0;
	
	init_iso1EVPowerDeliveryParameterType(iso1EVPowerDeliveryParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 34:
			/* 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,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_iso1ProfileEntryType(bitstream_t* stream, struct iso1ProfileEntryType* iso1ProfileEntryType) {
	int grammarID = 77;
	int done = 0;
	
	init_iso1ProfileEntryType(iso1ProfileEntryType);
	
	while(!done) {
		switch(grammarID) {
		case 77:
			/* 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, &iso1ProfileEntryType->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 = 78;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 78:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1ProfileEntryType->ChargingProfileEntryMaxPower);
					grammarID = 79;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 79:
			/* 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));
							iso1ProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse = (int8_t)(uint32 + 1);
							iso1ProfileEntryType->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] */
			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,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_iso1AuthorizationReqType(bitstream_t* stream, struct iso1AuthorizationReqType* iso1AuthorizationReqType) {
	int grammarID = 80;
	int done = 0;
	
	init_iso1AuthorizationReqType(iso1AuthorizationReqType);
	
	while(!done) {
		switch(grammarID) {
		case 80:
			/* 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:
					errn = decodeUnsignedInteger16(stream, &iso1AuthorizationReqType->Id.charactersLen);
					if (errn == 0) {
						if (iso1AuthorizationReqType->Id.charactersLen >= 2) {
							iso1AuthorizationReqType->Id.charactersLen = (uint16_t)(iso1AuthorizationReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1AuthorizationReqType->Id.charactersLen, iso1AuthorizationReqType->Id.characters, iso1AuthorizationReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1AuthorizationReqType->Id_isUsed = 1u;
					grammarID = 81;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1AuthorizationReqType->GenChallenge.bytesLen);
							if (errn == 0) {
								errn =  (iso1AuthorizationReqType->GenChallenge.bytesLen) <= iso1AuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1AuthorizationReqType->GenChallenge.bytesLen, iso1AuthorizationReqType->GenChallenge.bytes);
							}
							iso1AuthorizationReqType->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;
				}
			}
			break;
		case 81:
			/* StartTag[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[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1AuthorizationReqType->GenChallenge.bytesLen);
							if (errn == 0) {
								errn =  (iso1AuthorizationReqType->GenChallenge.bytesLen) <= iso1AuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1AuthorizationReqType->GenChallenge.bytesLen, iso1AuthorizationReqType->GenChallenge.bytes);
							}
							iso1AuthorizationReqType->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;
					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,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_iso1MeterInfoType(bitstream_t* stream, struct iso1MeterInfoType* iso1MeterInfoType) {
	int grammarID = 82;
	int done = 0;
	
	init_iso1MeterInfoType(iso1MeterInfoType);
	
	while(!done) {
		switch(grammarID) {
		case 82:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013: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, &iso1MeterInfoType->MeterID.charactersLen);
							if (errn == 0) {
								if (iso1MeterInfoType->MeterID.charactersLen >= 2) {
									iso1MeterInfoType->MeterID.charactersLen = (uint16_t)(iso1MeterInfoType->MeterID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1MeterInfoType->MeterID.charactersLen, iso1MeterInfoType->MeterID.characters, iso1MeterInfoType_MeterID_CHARACTERS_SIZE);
								} 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:MsgDataTypes}MeterID) ? */
						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}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) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger64(stream, &iso1MeterInfoType->MeterReading);
							iso1MeterInfoType->MeterReading_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}MeterReading) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 84;
						} 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, &iso1MeterInfoType->SigMeterReading.bytesLen);
							if (errn == 0) {
								errn =  (iso1MeterInfoType->SigMeterReading.bytesLen) <= iso1MeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1MeterInfoType->SigMeterReading.bytesLen, iso1MeterInfoType->SigMeterReading.bytes);
							}
							iso1MeterInfoType->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:2013:MsgDataTypes}SigMeterReading) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 85;
						} 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, &iso1MeterInfoType->MeterStatus);
							iso1MeterInfoType->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:2013:MsgDataTypes}MeterStatus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 86;
						} 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, &iso1MeterInfoType->TMeter);
							iso1MeterInfoType->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:2013: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 84:
			/* 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) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1MeterInfoType->SigMeterReading.bytesLen);
							if (errn == 0) {
								errn =  (iso1MeterInfoType->SigMeterReading.bytesLen) <= iso1MeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1MeterInfoType->SigMeterReading.bytesLen, iso1MeterInfoType->SigMeterReading.bytes);
							}
							iso1MeterInfoType->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:2013:MsgDataTypes}SigMeterReading) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 85;
						} 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, &iso1MeterInfoType->MeterStatus);
							iso1MeterInfoType->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:2013:MsgDataTypes}MeterStatus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 86;
						} 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, &iso1MeterInfoType->TMeter);
							iso1MeterInfoType->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:2013: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 85:
			/* 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) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &iso1MeterInfoType->MeterStatus);
							iso1MeterInfoType->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:2013:MsgDataTypes}MeterStatus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 86;
						} 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, &iso1MeterInfoType->TMeter);
							iso1MeterInfoType->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:2013: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 86:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013: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, &iso1MeterInfoType->TMeter);
							iso1MeterInfoType->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:2013: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 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#,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_iso1ManifestType(bitstream_t* stream, struct iso1ManifestType* iso1ManifestType) {
	int grammarID = 87;
	int done = 0;
	
	init_iso1ManifestType(iso1ManifestType);
	
	while(!done) {
		switch(grammarID) {
		case 87:
			/* 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, &iso1ManifestType->Id.charactersLen);
					if (errn == 0) {
						if (iso1ManifestType->Id.charactersLen >= 2) {
							iso1ManifestType->Id.charactersLen = (uint16_t)(iso1ManifestType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ManifestType->Id.charactersLen, iso1ManifestType->Id.characters, iso1ManifestType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ManifestType->Id_isUsed = 1u;
					grammarID = 88;
					break;
				case 1:
					if (iso1ManifestType->Reference.arrayLen < iso1ManifestType_Reference_ARRAY_SIZE) {
						errn = decode_iso1ReferenceType(stream, &iso1ManifestType->Reference.array[iso1ManifestType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 66;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 88:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ManifestType->Reference.arrayLen < iso1ManifestType_Reference_ARRAY_SIZE) {
						errn = decode_iso1ReferenceType(stream, &iso1ManifestType->Reference.array[iso1ManifestType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 66;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 66:
			/* 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 (iso1ManifestType->Reference.arrayLen < iso1ManifestType_Reference_ARRAY_SIZE) {
						errn = decode_iso1ReferenceType(stream, &iso1ManifestType->Reference.array[iso1ManifestType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 66;
					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,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_iso1ChargeParameterDiscoveryResType(bitstream_t* stream, struct iso1ChargeParameterDiscoveryResType* iso1ChargeParameterDiscoveryResType) {
	int grammarID = 89;
	int done = 0;
	
	init_iso1ChargeParameterDiscoveryResType(iso1ChargeParameterDiscoveryResType);
	
	while(!done) {
		switch(grammarID) {
		case 89:
			/* 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);
							iso1ChargeParameterDiscoveryResType->ResponseCode = (iso1responseCodeType) 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 = 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: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);
							iso1ChargeParameterDiscoveryResType->EVSEProcessing = (iso1EVSEProcessingType) 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 = 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: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_iso1SAScheduleListType(stream, &iso1ChargeParameterDiscoveryResType->SAScheduleList);
					iso1ChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u;
					grammarID = 92;
					break;
				case 1:
					errn = decode_iso1SASchedulesType(stream, &iso1ChargeParameterDiscoveryResType->SASchedules);
					iso1ChargeParameterDiscoveryResType->SASchedules_isUsed = 1u;
					grammarID = 92;
					break;
				case 2:
					errn = decode_iso1AC_EVSEChargeParameterType(stream, &iso1ChargeParameterDiscoveryResType->AC_EVSEChargeParameter);
					iso1ChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 3:
					errn = decode_iso1DC_EVSEChargeParameterType(stream, &iso1ChargeParameterDiscoveryResType->DC_EVSEChargeParameter);
					iso1ChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 4:
					errn = decode_iso1EVSEChargeParameterType(stream, &iso1ChargeParameterDiscoveryResType->EVSEChargeParameter);
					iso1ChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u;
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 92:
			/* 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_iso1AC_EVSEChargeParameterType(stream, &iso1ChargeParameterDiscoveryResType->AC_EVSEChargeParameter);
					iso1ChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 1:
					errn = decode_iso1DC_EVSEChargeParameterType(stream, &iso1ChargeParameterDiscoveryResType->DC_EVSEChargeParameter);
					iso1ChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					errn = decode_iso1EVSEChargeParameterType(stream, &iso1ChargeParameterDiscoveryResType->EVSEChargeParameter);
					iso1ChargeParameterDiscoveryResType->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='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_iso1PowerDeliveryResType(bitstream_t* stream, struct iso1PowerDeliveryResType* iso1PowerDeliveryResType) {
	int grammarID = 93;
	int done = 0;
	
	init_iso1PowerDeliveryResType(iso1PowerDeliveryResType);
	
	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);
							iso1PowerDeliveryResType->ResponseCode = (iso1responseCodeType) 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: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_iso1AC_EVSEStatusType(stream, &iso1PowerDeliveryResType->AC_EVSEStatus);
					iso1PowerDeliveryResType->AC_EVSEStatus_isUsed = 1u;
					grammarID = 3;
					break;
				case 1:
					errn = decode_iso1DC_EVSEStatusType(stream, &iso1PowerDeliveryResType->DC_EVSEStatus);
					iso1PowerDeliveryResType->DC_EVSEStatus_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					errn = decode_iso1EVSEStatusType(stream, &iso1PowerDeliveryResType->EVSEStatus);
					iso1PowerDeliveryResType->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: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_iso1DC_EVChargeParameterType(bitstream_t* stream, struct iso1DC_EVChargeParameterType* iso1DC_EVChargeParameterType) {
	int grammarID = 95;
	int done = 0;
	
	init_iso1DC_EVChargeParameterType(iso1DC_EVChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 95:
			/* 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, &iso1DC_EVChargeParameterType->DepartureTime);
							iso1DC_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 = 96;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = decode_iso1DC_EVStatusType(stream, &iso1DC_EVChargeParameterType->DC_EVStatus);
					grammarID = 97;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 96:
			/* 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_iso1DC_EVStatusType(stream, &iso1DC_EVChargeParameterType->DC_EVStatus);
					grammarID = 97;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 97:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVChargeParameterType->EVMaximumCurrentLimit);
					grammarID = 98;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 98:
			/* 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_iso1PhysicalValueType(stream, &iso1DC_EVChargeParameterType->EVMaximumPowerLimit);
					iso1DC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 99;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVChargeParameterType->EVMaximumVoltageLimit);
					grammarID = 100;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 99:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVChargeParameterType->EVMaximumVoltageLimit);
					grammarID = 100;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 100:
			/* 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_iso1PhysicalValueType(stream, &iso1DC_EVChargeParameterType->EVEnergyCapacity);
					iso1DC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u;
					grammarID = 101;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVChargeParameterType->EVEnergyRequest);
					iso1DC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u;
					grammarID = 102;
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							iso1DC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0);
							iso1DC_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 = 103;
						} 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));
							iso1DC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							iso1DC_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;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 101:
			/* 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_iso1PhysicalValueType(stream, &iso1DC_EVChargeParameterType->EVEnergyRequest);
					iso1DC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u;
					grammarID = 102;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							iso1DC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0);
							iso1DC_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 = 103;
						} 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));
							iso1DC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							iso1DC_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;
				}
			}
			break;
		case 102:
			/* 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));
							iso1DC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0);
							iso1DC_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 = 103;
						} 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));
							iso1DC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							iso1DC_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;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 103:
			/* 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));
							iso1DC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							iso1DC_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:
			/* 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_iso1ConsumptionCostType(bitstream_t* stream, struct iso1ConsumptionCostType* iso1ConsumptionCostType) {
	int grammarID = 104;
	int done = 0;
	
	init_iso1ConsumptionCostType(iso1ConsumptionCostType);
	
	while(!done) {
		switch(grammarID) {
		case 104:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1ConsumptionCostType->startValue);
					grammarID = 105;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 105:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ConsumptionCostType->Cost.arrayLen < iso1ConsumptionCostType_Cost_ARRAY_SIZE) {
						errn = decode_iso1CostType(stream, &iso1ConsumptionCostType->Cost.array[iso1ConsumptionCostType->Cost.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({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ConsumptionCostType->Cost.arrayLen < iso1ConsumptionCostType_Cost_ARRAY_SIZE) {
						errn = decode_iso1CostType(stream, &iso1ConsumptionCostType->Cost.array[iso1ConsumptionCostType->Cost.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 107;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 107:
			/* 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 (iso1ConsumptionCostType->Cost.arrayLen < iso1ConsumptionCostType_Cost_ARRAY_SIZE) {
						errn = decode_iso1CostType(stream, &iso1ConsumptionCostType->Cost.array[iso1ConsumptionCostType->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: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_iso1PMaxScheduleType(bitstream_t* stream, struct iso1PMaxScheduleType* iso1PMaxScheduleType) {
	int grammarID = 108;
	int done = 0;
	
	init_iso1PMaxScheduleType(iso1PMaxScheduleType);
	
	while(!done) {
		switch(grammarID) {
		case 108:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1PMaxScheduleType->PMaxScheduleEntry.arrayLen < iso1PMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) {
						errn = decode_iso1PMaxScheduleEntryType(stream, &iso1PMaxScheduleType->PMaxScheduleEntry.array[iso1PMaxScheduleType->PMaxScheduleEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 109;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 109:
			/* 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 (iso1PMaxScheduleType->PMaxScheduleEntry.arrayLen < iso1PMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) {
						errn = decode_iso1PMaxScheduleEntryType(stream, &iso1PMaxScheduleType->PMaxScheduleEntry.array[iso1PMaxScheduleType->PMaxScheduleEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 109;
					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,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_iso1PaymentOptionListType(bitstream_t* stream, struct iso1PaymentOptionListType* iso1PaymentOptionListType) {
	int grammarID = 110;
	int done = 0;
	
	init_iso1PaymentOptionListType(iso1PaymentOptionListType);
	
	while(!done) {
		switch(grammarID) {
		case 110:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1PaymentOptionListType->PaymentOption.arrayLen < iso1PaymentOptionListType_PaymentOption_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
								iso1PaymentOptionListType->PaymentOption.array[iso1PaymentOptionListType->PaymentOption.arrayLen] = (iso1paymentOptionType) uint32;
								iso1PaymentOptionListType->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 = 111;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 111:
			/* 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 (iso1PaymentOptionListType->PaymentOption.arrayLen < iso1PaymentOptionListType_PaymentOption_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
								iso1PaymentOptionListType->PaymentOption.array[iso1PaymentOptionListType->PaymentOption.arrayLen] = (iso1paymentOptionType) uint32;
								iso1PaymentOptionListType->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#,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_iso1ObjectType(bitstream_t* stream, struct iso1ObjectType* iso1ObjectType) {
	int grammarID = 112;
	int done = 0;
	
	init_iso1ObjectType(iso1ObjectType);
	
	while(!done) {
		switch(grammarID) {
		case 112:
			/* 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, &iso1ObjectType->Encoding.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->Encoding.charactersLen >= 2) {
							iso1ObjectType->Encoding.charactersLen = (uint16_t)(iso1ObjectType->Encoding.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->Encoding.charactersLen, iso1ObjectType->Encoding.characters, iso1ObjectType_Encoding_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->Encoding_isUsed = 1u;
					grammarID = 113;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->Id.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->Id.charactersLen >= 2) {
							iso1ObjectType->Id.charactersLen = (uint16_t)(iso1ObjectType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->Id.charactersLen, iso1ObjectType->Id.characters, iso1ObjectType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->Id_isUsed = 1u;
					grammarID = 114;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->MimeType.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->MimeType.charactersLen >= 2) {
							iso1ObjectType->MimeType.charactersLen = (uint16_t)(iso1ObjectType->MimeType.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->MimeType.charactersLen, iso1ObjectType->MimeType.characters, iso1ObjectType_MimeType_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->MimeType_isUsed = 1u;
					grammarID = 115;
					break;
				case 3:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 116;
					break;
				case 4:
					done = 1;
					grammarID = 4;
					break;
				case 5:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->ANY.charactersLen >= 2) {
							iso1ObjectType->ANY.charactersLen = (uint16_t)(iso1ObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->ANY.charactersLen, iso1ObjectType->ANY.characters, iso1ObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 113:
			/* 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, &iso1ObjectType->Id.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->Id.charactersLen >= 2) {
							iso1ObjectType->Id.charactersLen = (uint16_t)(iso1ObjectType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->Id.charactersLen, iso1ObjectType->Id.characters, iso1ObjectType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->Id_isUsed = 1u;
					grammarID = 114;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->MimeType.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->MimeType.charactersLen >= 2) {
							iso1ObjectType->MimeType.charactersLen = (uint16_t)(iso1ObjectType->MimeType.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->MimeType.charactersLen, iso1ObjectType->MimeType.characters, iso1ObjectType_MimeType_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->MimeType_isUsed = 1u;
					grammarID = 115;
					break;
				case 2:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 116;
					break;
				case 3:
					done = 1;
					grammarID = 4;
					break;
				case 4:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->ANY.charactersLen >= 2) {
							iso1ObjectType->ANY.charactersLen = (uint16_t)(iso1ObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->ANY.charactersLen, iso1ObjectType->ANY.characters, iso1ObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 114:
			/* 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, &iso1ObjectType->MimeType.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->MimeType.charactersLen >= 2) {
							iso1ObjectType->MimeType.charactersLen = (uint16_t)(iso1ObjectType->MimeType.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->MimeType.charactersLen, iso1ObjectType->MimeType.characters, iso1ObjectType_MimeType_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->MimeType_isUsed = 1u;
					grammarID = 115;
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 116;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->ANY.charactersLen >= 2) {
							iso1ObjectType->ANY.charactersLen = (uint16_t)(iso1ObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->ANY.charactersLen, iso1ObjectType->ANY.characters, iso1ObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 115:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->ANY.charactersLen >= 2) {
							iso1ObjectType->ANY.charactersLen = (uint16_t)(iso1ObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->ANY.charactersLen, iso1ObjectType->ANY.characters, iso1ObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 116:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1ObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1ObjectType->ANY.charactersLen >= 2) {
							iso1ObjectType->ANY.charactersLen = (uint16_t)(iso1ObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ObjectType->ANY.charactersLen, iso1ObjectType->ANY.characters, iso1ObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ObjectType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = 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,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_iso1PhysicalValueType(bitstream_t* stream, struct iso1PhysicalValueType* iso1PhysicalValueType) {
	int grammarID = 117;
	int done = 0;
	
	init_iso1PhysicalValueType(iso1PhysicalValueType);
	
	while(!done) {
		switch(grammarID) {
		case 117:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013: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));
							iso1PhysicalValueType->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:2013:MsgDataTypes}Multiplier) ? */
						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}Unit)] */
			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);
							iso1PhysicalValueType->Unit = (iso1unitSymbolType) 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}Unit) ? */
						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}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, &iso1PhysicalValueType->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: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='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_iso1RSAKeyValueType(bitstream_t* stream, struct iso1RSAKeyValueType* iso1RSAKeyValueType) {
	int grammarID = 120;
	int done = 0;
	
	init_iso1RSAKeyValueType(iso1RSAKeyValueType);
	
	while(!done) {
		switch(grammarID) {
		case 120:
			/* 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, &iso1RSAKeyValueType->Modulus.bytesLen);
							if (errn == 0) {
								errn =  (iso1RSAKeyValueType->Modulus.bytesLen) <= iso1RSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1RSAKeyValueType->Modulus.bytesLen, iso1RSAKeyValueType->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 = 121;
						} 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({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, &iso1RSAKeyValueType->Exponent.bytesLen);
							if (errn == 0) {
								errn =  (iso1RSAKeyValueType->Exponent.bytesLen) <= iso1RSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1RSAKeyValueType->Exponent.bytesLen, iso1RSAKeyValueType->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='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_iso1SessionStopResType(bitstream_t* stream, struct iso1SessionStopResType* iso1SessionStopResType) {
	int grammarID = 122;
	int done = 0;
	
	init_iso1SessionStopResType(iso1SessionStopResType);
	
	while(!done) {
		switch(grammarID) {
		case 122:
			/* 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);
							iso1SessionStopResType->ResponseCode = (iso1responseCodeType) 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: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_iso1CertificateUpdateReqType(bitstream_t* stream, struct iso1CertificateUpdateReqType* iso1CertificateUpdateReqType) {
	int grammarID = 123;
	int done = 0;
	
	init_iso1CertificateUpdateReqType(iso1CertificateUpdateReqType);
	
	while(!done) {
		switch(grammarID) {
		case 123:
			/* 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, &iso1CertificateUpdateReqType->Id.charactersLen);
					if (errn == 0) {
						if (iso1CertificateUpdateReqType->Id.charactersLen >= 2) {
							iso1CertificateUpdateReqType->Id.charactersLen = (uint16_t)(iso1CertificateUpdateReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1CertificateUpdateReqType->Id.charactersLen, iso1CertificateUpdateReqType->Id.characters, iso1CertificateUpdateReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 124;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 124:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1CertificateChainType(stream, &iso1CertificateUpdateReqType->ContractSignatureCertChain);
					grammarID = 125;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 125:
			/* Element[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, &iso1CertificateUpdateReqType->eMAID.charactersLen);
							if (errn == 0) {
								if (iso1CertificateUpdateReqType->eMAID.charactersLen >= 2) {
									iso1CertificateUpdateReqType->eMAID.charactersLen = (uint16_t)(iso1CertificateUpdateReqType->eMAID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1CertificateUpdateReqType->eMAID.charactersLen, iso1CertificateUpdateReqType->eMAID.characters, iso1CertificateUpdateReqType_eMAID_CHARACTERS_SIZE);
								} 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 = 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}ListOfRootCertificateIDs)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1ListOfRootCertificateIDsType(stream, &iso1CertificateUpdateReqType->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='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_iso1SignatureValueType(bitstream_t* stream, struct iso1SignatureValueType* iso1SignatureValueType) {
	int grammarID = 126;
	int done = 0;
	
	init_iso1SignatureValueType(iso1SignatureValueType);
	
	while(!done) {
		switch(grammarID) {
		case 126:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1SignatureValueType->Id.charactersLen);
					if (errn == 0) {
						if (iso1SignatureValueType->Id.charactersLen >= 2) {
							iso1SignatureValueType->Id.charactersLen = (uint16_t)(iso1SignatureValueType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignatureValueType->Id.charactersLen, iso1SignatureValueType->Id.characters, iso1SignatureValueType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignatureValueType->Id_isUsed = 1u;
					grammarID = 24;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1SignatureValueType->CONTENT.bytesLen);
					if (errn == 0) {
						errn =  (iso1SignatureValueType->CONTENT.bytesLen) <= iso1SignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
					}
					if (errn == 0) {
						errn = decodeBytes(stream, iso1SignatureValueType->CONTENT.bytesLen, iso1SignatureValueType->CONTENT.bytes);
					}
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 24:
			/* StartTag[CHARACTERS[BINARY_BASE64]] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1SignatureValueType->CONTENT.bytesLen);
					if (errn == 0) {
						errn =  (iso1SignatureValueType->CONTENT.bytesLen) <= iso1SignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
					}
					if (errn == 0) {
						errn = decodeBytes(stream, iso1SignatureValueType->CONTENT.bytesLen, iso1SignatureValueType->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,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_iso1PaymentDetailsReqType(bitstream_t* stream, struct iso1PaymentDetailsReqType* iso1PaymentDetailsReqType) {
	int grammarID = 127;
	int done = 0;
	
	init_iso1PaymentDetailsReqType(iso1PaymentDetailsReqType);
	
	while(!done) {
		switch(grammarID) {
		case 127:
			/* 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, &iso1PaymentDetailsReqType->eMAID.charactersLen);
							if (errn == 0) {
								if (iso1PaymentDetailsReqType->eMAID.charactersLen >= 2) {
									iso1PaymentDetailsReqType->eMAID.charactersLen = (uint16_t)(iso1PaymentDetailsReqType->eMAID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1PaymentDetailsReqType->eMAID.charactersLen, iso1PaymentDetailsReqType->eMAID.characters, iso1PaymentDetailsReqType_eMAID_CHARACTERS_SIZE);
								} 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 = 128;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 128:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1CertificateChainType(stream, &iso1PaymentDetailsReqType->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: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_iso1AuthorizationResType(bitstream_t* stream, struct iso1AuthorizationResType* iso1AuthorizationResType) {
	int grammarID = 129;
	int done = 0;
	
	init_iso1AuthorizationResType(iso1AuthorizationResType);
	
	while(!done) {
		switch(grammarID) {
		case 129:
			/* 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);
							iso1AuthorizationResType->ResponseCode = (iso1responseCodeType) 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 = 130;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 130:
			/* 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);
							iso1AuthorizationResType->EVSEProcessing = (iso1EVSEProcessingType) 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='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_iso1DC_EVSEChargeParameterType(bitstream_t* stream, struct iso1DC_EVSEChargeParameterType* iso1DC_EVSEChargeParameterType) {
	int grammarID = 131;
	int done = 0;
	
	init_iso1DC_EVSEChargeParameterType(iso1DC_EVSEChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 131:
			/* 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_iso1DC_EVSEStatusType(stream, &iso1DC_EVSEChargeParameterType->DC_EVSEStatus);
					grammarID = 132;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 132:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEMaximumCurrentLimit);
					grammarID = 133;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 133:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEMaximumPowerLimit);
					grammarID = 134;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 134:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEMaximumVoltageLimit);
					grammarID = 135;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 135:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEMinimumCurrentLimit);
					grammarID = 136;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 136:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEMinimumVoltageLimit);
					grammarID = 137;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 137:
			/* 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_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSECurrentRegulationTolerance);
					iso1DC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u;
					grammarID = 138;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEPeakCurrentRipple);
					grammarID = 139;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 138:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEPeakCurrentRipple);
					grammarID = 139;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 139:
			/* 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_iso1PhysicalValueType(stream, &iso1DC_EVSEChargeParameterType->EVSEEnergyToBeDelivered);
					iso1DC_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: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_iso1SubCertificatesType(bitstream_t* stream, struct iso1SubCertificatesType* iso1SubCertificatesType) {
	int grammarID = 140;
	int done = 0;
	
	init_iso1SubCertificatesType(iso1SubCertificatesType);
	
	while(!done) {
		switch(grammarID) {
		case 140:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SubCertificatesType->Certificate.arrayLen < iso1SubCertificatesType_Certificate_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen) <= iso1SubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytes);
								}
								iso1SubCertificatesType->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 = 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:MsgDataTypes}Certificate), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SubCertificatesType->Certificate.arrayLen < iso1SubCertificatesType_Certificate_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen) <= iso1SubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytes);
								}
								iso1SubCertificatesType->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 = 142;
						} 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 142:
			/* 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 (iso1SubCertificatesType->Certificate.arrayLen < iso1SubCertificatesType_Certificate_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen) <= iso1SubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytes);
								}
								iso1SubCertificatesType->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 = 143;
						} 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 143:
			/* 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 (iso1SubCertificatesType->Certificate.arrayLen < iso1SubCertificatesType_Certificate_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen) <= iso1SubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytesLen, iso1SubCertificatesType->Certificate.array[iso1SubCertificatesType->Certificate.arrayLen].bytes);
								}
								iso1SubCertificatesType->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] */
			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_iso1ChargingStatusResType(bitstream_t* stream, struct iso1ChargingStatusResType* iso1ChargingStatusResType) {
	int grammarID = 144;
	int done = 0;
	
	init_iso1ChargingStatusResType(iso1ChargingStatusResType);
	
	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);
							iso1ChargingStatusResType->ResponseCode = (iso1responseCodeType) 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}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, &iso1ChargingStatusResType->EVSEID.charactersLen);
							if (errn == 0) {
								if (iso1ChargingStatusResType->EVSEID.charactersLen >= 2) {
									iso1ChargingStatusResType->EVSEID.charactersLen = (uint16_t)(iso1ChargingStatusResType->EVSEID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1ChargingStatusResType->EVSEID.charactersLen, iso1ChargingStatusResType->EVSEID.characters, iso1ChargingStatusResType_EVSEID_CHARACTERS_SIZE);
								} 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 = 146;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 146:
			/* 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));
							iso1ChargingStatusResType->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 = 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: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_iso1PhysicalValueType(stream, &iso1ChargingStatusResType->EVSEMaxCurrent);
					iso1ChargingStatusResType->EVSEMaxCurrent_isUsed = 1u;
					grammarID = 148;
					break;
				case 1:
					errn = decode_iso1MeterInfoType(stream, &iso1ChargingStatusResType->MeterInfo);
					iso1ChargingStatusResType->MeterInfo_isUsed = 1u;
					grammarID = 149;
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &iso1ChargingStatusResType->ReceiptRequired);
							iso1ChargingStatusResType->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 = 150;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					errn = decode_iso1AC_EVSEStatusType(stream, &iso1ChargingStatusResType->AC_EVSEStatus);
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 148:
			/* 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_iso1MeterInfoType(stream, &iso1ChargingStatusResType->MeterInfo);
					iso1ChargingStatusResType->MeterInfo_isUsed = 1u;
					grammarID = 149;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &iso1ChargingStatusResType->ReceiptRequired);
							iso1ChargingStatusResType->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 = 150;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					errn = decode_iso1AC_EVSEStatusType(stream, &iso1ChargingStatusResType->AC_EVSEStatus);
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 149:
			/* 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, &iso1ChargingStatusResType->ReceiptRequired);
							iso1ChargingStatusResType->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 = 150;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = decode_iso1AC_EVSEStatusType(stream, &iso1ChargingStatusResType->AC_EVSEStatus);
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 150:
			/* 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_iso1AC_EVSEStatusType(stream, &iso1ChargingStatusResType->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#,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_iso1DSAKeyValueType(bitstream_t* stream, struct iso1DSAKeyValueType* iso1DSAKeyValueType) {
	int grammarID = 151;
	int done = 0;
	
	init_iso1DSAKeyValueType(iso1DSAKeyValueType);
	
	while(!done) {
		switch(grammarID) {
		case 151:
			/* 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, &iso1DSAKeyValueType->P.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->P.bytesLen) <= iso1DSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->P.bytesLen, iso1DSAKeyValueType->P.bytes);
							}
							iso1DSAKeyValueType->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 = 152;
						} 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, &iso1DSAKeyValueType->G.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->G.bytesLen) <= iso1DSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->G.bytesLen, iso1DSAKeyValueType->G.bytes);
							}
							iso1DSAKeyValueType->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 = 153;
						} 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, &iso1DSAKeyValueType->Y.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->Y.bytesLen) <= iso1DSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->Y.bytesLen, iso1DSAKeyValueType->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 = 154;
						} 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({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, &iso1DSAKeyValueType->Q.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->Q.bytesLen) <= iso1DSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->Q.bytesLen, iso1DSAKeyValueType->Q.bytes);
							}
							iso1DSAKeyValueType->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 = 155;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 155:
			/* 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, &iso1DSAKeyValueType->G.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->G.bytesLen) <= iso1DSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->G.bytesLen, iso1DSAKeyValueType->G.bytes);
							}
							iso1DSAKeyValueType->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 = 153;
						} 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, &iso1DSAKeyValueType->Y.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->Y.bytesLen) <= iso1DSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->Y.bytesLen, iso1DSAKeyValueType->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 = 154;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 153:
			/* 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, &iso1DSAKeyValueType->Y.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->Y.bytesLen) <= iso1DSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->Y.bytesLen, iso1DSAKeyValueType->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 = 154;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 154:
			/* 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, &iso1DSAKeyValueType->J.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->J.bytesLen) <= iso1DSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->J.bytesLen, iso1DSAKeyValueType->J.bytes);
							}
							iso1DSAKeyValueType->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 = 156;
						} 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, &iso1DSAKeyValueType->Seed.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->Seed.bytesLen) <= iso1DSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->Seed.bytesLen, iso1DSAKeyValueType->Seed.bytes);
							}
							iso1DSAKeyValueType->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 = 157;
						} 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 156:
			/* 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, &iso1DSAKeyValueType->Seed.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->Seed.bytesLen) <= iso1DSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->Seed.bytesLen, iso1DSAKeyValueType->Seed.bytes);
							}
							iso1DSAKeyValueType->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 = 157;
						} 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 157:
			/* 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, &iso1DSAKeyValueType->PgenCounter.bytesLen);
							if (errn == 0) {
								errn =  (iso1DSAKeyValueType->PgenCounter.bytesLen) <= iso1DSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1DSAKeyValueType->PgenCounter.bytesLen, iso1DSAKeyValueType->PgenCounter.bytes);
							}
							iso1DSAKeyValueType->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: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_iso1ListOfRootCertificateIDsType(bitstream_t* stream, struct iso1ListOfRootCertificateIDsType* iso1ListOfRootCertificateIDsType) {
	int grammarID = 158;
	int done = 0;
	
	init_iso1ListOfRootCertificateIDsType(iso1ListOfRootCertificateIDsType);
	
	while(!done) {
		switch(grammarID) {
		case 158:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ListOfRootCertificateIDsType->RootCertificateID.arrayLen < iso1ListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) {
						errn = decode_iso1X509IssuerSerialType(stream, &iso1ListOfRootCertificateIDsType->RootCertificateID.array[iso1ListOfRootCertificateIDsType->RootCertificateID.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}RootCertificateID), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ListOfRootCertificateIDsType->RootCertificateID.arrayLen < iso1ListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) {
						errn = decode_iso1X509IssuerSerialType(stream, &iso1ListOfRootCertificateIDsType->RootCertificateID.array[iso1ListOfRootCertificateIDsType->RootCertificateID.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 159;
					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,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_iso1ChargeServiceType(bitstream_t* stream, struct iso1ChargeServiceType* iso1ChargeServiceType) {
	int grammarID = 160;
	int done = 0;
	
	init_iso1ChargeServiceType(iso1ChargeServiceType);
	
	while(!done) {
		switch(grammarID) {
		case 160:
			/* 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, &iso1ChargeServiceType->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 = 161;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 161:
			/* 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, &iso1ChargeServiceType->ServiceName.charactersLen);
							if (errn == 0) {
								if (iso1ChargeServiceType->ServiceName.charactersLen >= 2) {
									iso1ChargeServiceType->ServiceName.charactersLen = (uint16_t)(iso1ChargeServiceType->ServiceName.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1ChargeServiceType->ServiceName.charactersLen, iso1ChargeServiceType->ServiceName.characters, iso1ChargeServiceType_ServiceName_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1ChargeServiceType->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 = 162;
						} 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);
							iso1ChargeServiceType->ServiceCategory = (iso1serviceCategoryType) 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 = 163;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 162:
			/* 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);
							iso1ChargeServiceType->ServiceCategory = (iso1serviceCategoryType) 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 = 163;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 163:
			/* 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, &iso1ChargeServiceType->ServiceScope.charactersLen);
							if (errn == 0) {
								if (iso1ChargeServiceType->ServiceScope.charactersLen >= 2) {
									iso1ChargeServiceType->ServiceScope.charactersLen = (uint16_t)(iso1ChargeServiceType->ServiceScope.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1ChargeServiceType->ServiceScope.charactersLen, iso1ChargeServiceType->ServiceScope.characters, iso1ChargeServiceType_ServiceScope_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1ChargeServiceType->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 = 164;
						} 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, &iso1ChargeServiceType->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 = 165;
						} 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: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, &iso1ChargeServiceType->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 = 165;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 165:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1SupportedEnergyTransferModeType(stream, &iso1ChargeServiceType->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,IntervalType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_iso1IntervalType(bitstream_t* stream, struct iso1IntervalType* iso1IntervalType) {
	int grammarID = 34;
	int done = 0;
	
	init_iso1IntervalType(iso1IntervalType);
	
	while(!done) {
		switch(grammarID) {
		case 34:
			/* 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,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_iso1MeteringReceiptReqType(bitstream_t* stream, struct iso1MeteringReceiptReqType* iso1MeteringReceiptReqType) {
	int grammarID = 166;
	int done = 0;
	
	init_iso1MeteringReceiptReqType(iso1MeteringReceiptReqType);
	
	while(!done) {
		switch(grammarID) {
		case 166:
			/* 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) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1MeteringReceiptReqType->Id.charactersLen);
					if (errn == 0) {
						if (iso1MeteringReceiptReqType->Id.charactersLen >= 2) {
							iso1MeteringReceiptReqType->Id.charactersLen = (uint16_t)(iso1MeteringReceiptReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1MeteringReceiptReqType->Id.charactersLen, iso1MeteringReceiptReqType->Id.characters, iso1MeteringReceiptReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1MeteringReceiptReqType->Id_isUsed = 1u;
					grammarID = 167;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1MeteringReceiptReqType->SessionID.bytesLen);
							if (errn == 0) {
								errn =  (iso1MeteringReceiptReqType->SessionID.bytesLen) <= iso1MeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1MeteringReceiptReqType->SessionID.bytesLen, iso1MeteringReceiptReqType->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:MsgBody}SessionID) ? */
						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 167:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2013: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, &iso1MeteringReceiptReqType->SessionID.bytesLen);
							if (errn == 0) {
								errn =  (iso1MeteringReceiptReqType->SessionID.bytesLen) <= iso1MeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1MeteringReceiptReqType->SessionID.bytesLen, iso1MeteringReceiptReqType->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:MsgBody}SessionID) ? */
						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({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */
			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, 8, &(uint32));
							iso1MeteringReceiptReqType->SAScheduleTupleID = (uint8_t)(uint32 + 1);
							iso1MeteringReceiptReqType->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:2013:MsgBody}SAScheduleTupleID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 169;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = decode_iso1MeterInfoType(stream, &iso1MeteringReceiptReqType->MeterInfo);
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 169:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1MeterInfoType(stream, &iso1MeteringReceiptReqType->MeterInfo);
					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,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_iso1ServiceDetailResType(bitstream_t* stream, struct iso1ServiceDetailResType* iso1ServiceDetailResType) {
	int grammarID = 170;
	int done = 0;
	
	init_iso1ServiceDetailResType(iso1ServiceDetailResType);
	
	while(!done) {
		switch(grammarID) {
		case 170:
			/* 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);
							iso1ServiceDetailResType->ResponseCode = (iso1responseCodeType) 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 = 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: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, &iso1ServiceDetailResType->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 = 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:2013:MsgBody}ServiceParameterList), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1ServiceParameterListType(stream, &iso1ServiceDetailResType->ServiceParameterList);
					iso1ServiceDetailResType->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#,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_iso1KeyValueType(bitstream_t* stream, struct iso1KeyValueType* iso1KeyValueType) {
	int grammarID = 173;
	int done = 0;
	
	init_iso1KeyValueType(iso1KeyValueType);
	
	while(!done) {
		switch(grammarID) {
		case 173:
			/* 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_iso1DSAKeyValueType(stream, &iso1KeyValueType->DSAKeyValue);
					iso1KeyValueType->DSAKeyValue_isUsed = 1u;
					grammarID = 174;
					break;
				case 1:
					errn = decode_iso1RSAKeyValueType(stream, &iso1KeyValueType->RSAKeyValue);
					iso1KeyValueType->RSAKeyValue_isUsed = 1u;
					grammarID = 174;
					break;
				case 2:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 174;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &iso1KeyValueType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1KeyValueType->ANY.charactersLen >= 2) {
							iso1KeyValueType->ANY.charactersLen = (uint16_t)(iso1KeyValueType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyValueType->ANY.charactersLen, iso1KeyValueType->ANY.characters, iso1KeyValueType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyValueType->ANY_isUsed = 1u;
					grammarID = 175;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 174:
			/* 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:
					errn = decodeUnsignedInteger16(stream, &iso1KeyValueType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1KeyValueType->ANY.charactersLen >= 2) {
							iso1KeyValueType->ANY.charactersLen = (uint16_t)(iso1KeyValueType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyValueType->ANY.charactersLen, iso1KeyValueType->ANY.characters, iso1KeyValueType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyValueType->ANY_isUsed = 1u;
					grammarID = 174;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 175:
			/* 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_iso1DSAKeyValueType(stream, &iso1KeyValueType->DSAKeyValue);
					iso1KeyValueType->DSAKeyValue_isUsed = 1u;
					grammarID = 174;
					break;
				case 1:
					errn = decode_iso1RSAKeyValueType(stream, &iso1KeyValueType->RSAKeyValue);
					iso1KeyValueType->RSAKeyValue_isUsed = 1u;
					grammarID = 174;
					break;
				case 2:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 174;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &iso1KeyValueType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1KeyValueType->ANY.charactersLen >= 2) {
							iso1KeyValueType->ANY.charactersLen = (uint16_t)(iso1KeyValueType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyValueType->ANY.charactersLen, iso1KeyValueType->ANY.characters, iso1KeyValueType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyValueType->ANY_isUsed = 1u;
					grammarID = 175;
					break;
				default:
					errn = 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-16})',  derivedBy='RESTRICTION'.  */
static int decode_iso1SelectedServiceListType(bitstream_t* stream, struct iso1SelectedServiceListType* iso1SelectedServiceListType) {
	int grammarID = 176;
	int done = 0;
	
	init_iso1SelectedServiceListType(iso1SelectedServiceListType);
	
	while(!done) {
		switch(grammarID) {
		case 176:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 177;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 177:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.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;
		case 178:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 179;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 179:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 180;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 180:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 181;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 181:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 182;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 182:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 183;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 183:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 184;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 184:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 185;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 185:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 186;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 186:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 187;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 187:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 188;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 188:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 189;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 189:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 190;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 190:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 191;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 191:
			/* 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 (iso1SelectedServiceListType->SelectedService.arrayLen < iso1SelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_iso1SelectedServiceType(stream, &iso1SelectedServiceListType->SelectedService.array[iso1SelectedServiceListType->SelectedService.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,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_iso1CableCheckResType(bitstream_t* stream, struct iso1CableCheckResType* iso1CableCheckResType) {
	int grammarID = 192;
	int done = 0;
	
	init_iso1CableCheckResType(iso1CableCheckResType);
	
	while(!done) {
		switch(grammarID) {
		case 192:
			/* 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);
							iso1CableCheckResType->ResponseCode = (iso1responseCodeType) 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 = 193;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 193:
			/* 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_iso1DC_EVSEStatusType(stream, &iso1CableCheckResType->DC_EVSEStatus);
					grammarID = 130;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 130:
			/* 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);
							iso1CableCheckResType->EVSEProcessing = (iso1EVSEProcessingType) 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#,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_iso1X509IssuerSerialType(bitstream_t* stream, struct iso1X509IssuerSerialType* iso1X509IssuerSerialType) {
	int grammarID = 194;
	int done = 0;
	
	init_iso1X509IssuerSerialType(iso1X509IssuerSerialType);
	
	while(!done) {
		switch(grammarID) {
		case 194:
			/* 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, &iso1X509IssuerSerialType->X509IssuerName.charactersLen);
							if (errn == 0) {
								if (iso1X509IssuerSerialType->X509IssuerName.charactersLen >= 2) {
									iso1X509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(iso1X509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1X509IssuerSerialType->X509IssuerName.charactersLen, iso1X509IssuerSerialType->X509IssuerName.characters, iso1X509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE);
								} 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 = 195;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 195:
			/* 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 = decodeIntegerBig(stream, &iso1X509IssuerSerialType->X509SerialNumber.negative, iso1X509IssuerSerialType_X509SerialNumber_BYTES_SIZE, iso1X509IssuerSerialType->X509SerialNumber.data, &iso1X509IssuerSerialType->X509SerialNumber.len);
						} else {
							/* Second 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#,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_iso1KeyInfoType(bitstream_t* stream, struct iso1KeyInfoType* iso1KeyInfoType) {
	int grammarID = 196;
	int done = 0;
	
	init_iso1KeyInfoType(iso1KeyInfoType);
	
	while(!done) {
		switch(grammarID) {
		case 196:
			/* 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, &iso1KeyInfoType->Id.charactersLen);
					if (errn == 0) {
						if (iso1KeyInfoType->Id.charactersLen >= 2) {
							iso1KeyInfoType->Id.charactersLen = (uint16_t)(iso1KeyInfoType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyInfoType->Id.charactersLen, iso1KeyInfoType->Id.characters, iso1KeyInfoType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyInfoType->Id_isUsed = 1u;
					grammarID = 197;
					break;
				case 1:
					if (iso1KeyInfoType->KeyName.arrayLen < iso1KeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].characters, iso1KeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					if (iso1KeyInfoType->KeyValue.arrayLen < iso1KeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_iso1KeyValueType(stream, &iso1KeyInfoType->KeyValue.array[iso1KeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 3:
					if (iso1KeyInfoType->RetrievalMethod.arrayLen < iso1KeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_iso1RetrievalMethodType(stream, &iso1KeyInfoType->RetrievalMethod.array[iso1KeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 4:
					if (iso1KeyInfoType->X509Data.arrayLen < iso1KeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_iso1X509DataType(stream, &iso1KeyInfoType->X509Data.array[iso1KeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 5:
					if (iso1KeyInfoType->PGPData.arrayLen < iso1KeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_iso1PGPDataType(stream, &iso1KeyInfoType->PGPData.array[iso1KeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 6:
					if (iso1KeyInfoType->SPKIData.arrayLen < iso1KeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_iso1SPKIDataType(stream, &iso1KeyInfoType->SPKIData.array[iso1KeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 7:
					if (iso1KeyInfoType->MgmtData.arrayLen < iso1KeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].characters, iso1KeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} 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 = 198;
					break;
				case 9:
					errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1KeyInfoType->ANY.charactersLen >= 2) {
							iso1KeyInfoType->ANY.charactersLen = (uint16_t)(iso1KeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyInfoType->ANY.charactersLen, iso1KeyInfoType->ANY.characters, iso1KeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyInfoType->ANY_isUsed = 1u;
					grammarID = 199;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 197:
			/* 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 (iso1KeyInfoType->KeyName.arrayLen < iso1KeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].characters, iso1KeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (iso1KeyInfoType->KeyValue.arrayLen < iso1KeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_iso1KeyValueType(stream, &iso1KeyInfoType->KeyValue.array[iso1KeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 2:
					if (iso1KeyInfoType->RetrievalMethod.arrayLen < iso1KeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_iso1RetrievalMethodType(stream, &iso1KeyInfoType->RetrievalMethod.array[iso1KeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 3:
					if (iso1KeyInfoType->X509Data.arrayLen < iso1KeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_iso1X509DataType(stream, &iso1KeyInfoType->X509Data.array[iso1KeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 4:
					if (iso1KeyInfoType->PGPData.arrayLen < iso1KeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_iso1PGPDataType(stream, &iso1KeyInfoType->PGPData.array[iso1KeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 5:
					if (iso1KeyInfoType->SPKIData.arrayLen < iso1KeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_iso1SPKIDataType(stream, &iso1KeyInfoType->SPKIData.array[iso1KeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 6:
					if (iso1KeyInfoType->MgmtData.arrayLen < iso1KeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].characters, iso1KeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} 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 = 198;
					break;
				case 8:
					errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1KeyInfoType->ANY.charactersLen >= 2) {
							iso1KeyInfoType->ANY.charactersLen = (uint16_t)(iso1KeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyInfoType->ANY.charactersLen, iso1KeyInfoType->ANY.characters, iso1KeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyInfoType->ANY_isUsed = 1u;
					grammarID = 199;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 198:
			/* 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 (iso1KeyInfoType->KeyName.arrayLen < iso1KeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].characters, iso1KeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (iso1KeyInfoType->KeyValue.arrayLen < iso1KeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_iso1KeyValueType(stream, &iso1KeyInfoType->KeyValue.array[iso1KeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 2:
					if (iso1KeyInfoType->RetrievalMethod.arrayLen < iso1KeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_iso1RetrievalMethodType(stream, &iso1KeyInfoType->RetrievalMethod.array[iso1KeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 3:
					if (iso1KeyInfoType->X509Data.arrayLen < iso1KeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_iso1X509DataType(stream, &iso1KeyInfoType->X509Data.array[iso1KeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 4:
					if (iso1KeyInfoType->PGPData.arrayLen < iso1KeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_iso1PGPDataType(stream, &iso1KeyInfoType->PGPData.array[iso1KeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 5:
					if (iso1KeyInfoType->SPKIData.arrayLen < iso1KeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_iso1SPKIDataType(stream, &iso1KeyInfoType->SPKIData.array[iso1KeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 6:
					if (iso1KeyInfoType->MgmtData.arrayLen < iso1KeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].characters, iso1KeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} 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 = 198;
					break;
				case 8:
					done = 1;
					grammarID = 4;
					break;
				case 9:
					errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1KeyInfoType->ANY.charactersLen >= 2) {
							iso1KeyInfoType->ANY.charactersLen = (uint16_t)(iso1KeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyInfoType->ANY.charactersLen, iso1KeyInfoType->ANY.characters, iso1KeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyInfoType->ANY_isUsed = 1u;
					grammarID = 198;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 199:
			/* 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 (iso1KeyInfoType->KeyName.arrayLen < iso1KeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].charactersLen, iso1KeyInfoType->KeyName.array[iso1KeyInfoType->KeyName.arrayLen].characters, iso1KeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (iso1KeyInfoType->KeyValue.arrayLen < iso1KeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_iso1KeyValueType(stream, &iso1KeyInfoType->KeyValue.array[iso1KeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 2:
					if (iso1KeyInfoType->RetrievalMethod.arrayLen < iso1KeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_iso1RetrievalMethodType(stream, &iso1KeyInfoType->RetrievalMethod.array[iso1KeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 3:
					if (iso1KeyInfoType->X509Data.arrayLen < iso1KeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_iso1X509DataType(stream, &iso1KeyInfoType->X509Data.array[iso1KeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 4:
					if (iso1KeyInfoType->PGPData.arrayLen < iso1KeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_iso1PGPDataType(stream, &iso1KeyInfoType->PGPData.array[iso1KeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 5:
					if (iso1KeyInfoType->SPKIData.arrayLen < iso1KeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_iso1SPKIDataType(stream, &iso1KeyInfoType->SPKIData.array[iso1KeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 198;
					break;
				case 6:
					if (iso1KeyInfoType->MgmtData.arrayLen < iso1KeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].charactersLen, iso1KeyInfoType->MgmtData.array[iso1KeyInfoType->MgmtData.arrayLen].characters, iso1KeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1KeyInfoType->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 = 198;
						} 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 = 198;
					break;
				case 8:
					errn = decodeUnsignedInteger16(stream, &iso1KeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1KeyInfoType->ANY.charactersLen >= 2) {
							iso1KeyInfoType->ANY.charactersLen = (uint16_t)(iso1KeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1KeyInfoType->ANY.charactersLen, iso1KeyInfoType->ANY.characters, iso1KeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1KeyInfoType->ANY_isUsed = 1u;
					grammarID = 199;
					break;
				default:
					errn = 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_iso1TransformsType(bitstream_t* stream, struct iso1TransformsType* iso1TransformsType) {
	int grammarID = 200;
	int done = 0;
	
	init_iso1TransformsType(iso1TransformsType);
	
	while(!done) {
		switch(grammarID) {
		case 200:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1TransformsType->Transform.arrayLen < iso1TransformsType_Transform_ARRAY_SIZE) {
						errn = decode_iso1TransformType(stream, &iso1TransformsType->Transform.array[iso1TransformsType->Transform.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 201;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 201:
			/* 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 (iso1TransformsType->Transform.arrayLen < iso1TransformsType_Transform_ARRAY_SIZE) {
						errn = decode_iso1TransformType(stream, &iso1TransformsType->Transform.array[iso1TransformsType->Transform.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 201;
					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,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_iso1ChargeParameterDiscoveryReqType(bitstream_t* stream, struct iso1ChargeParameterDiscoveryReqType* iso1ChargeParameterDiscoveryReqType) {
	int grammarID = 202;
	int done = 0;
	
	init_iso1ChargeParameterDiscoveryReqType(iso1ChargeParameterDiscoveryReqType);
	
	while(!done) {
		switch(grammarID) {
		case 202:
			/* 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, &iso1ChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple);
							iso1ChargeParameterDiscoveryReqType->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 = 203;
						} 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);
							iso1ChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (iso1EnergyTransferModeType) 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 = 204;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 203:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */
			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);
							iso1ChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (iso1EnergyTransferModeType) 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 = 204;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 204:
			/* 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_iso1AC_EVChargeParameterType(stream, &iso1ChargeParameterDiscoveryReqType->AC_EVChargeParameter);
					iso1ChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 1:
					errn = decode_iso1DC_EVChargeParameterType(stream, &iso1ChargeParameterDiscoveryReqType->DC_EVChargeParameter);
					iso1ChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					errn = decode_iso1EVChargeParameterType(stream, &iso1ChargeParameterDiscoveryReqType->EVChargeParameter);
					iso1ChargeParameterDiscoveryReqType->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: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_iso1PreChargeReqType(bitstream_t* stream, struct iso1PreChargeReqType* iso1PreChargeReqType) {
	int grammarID = 205;
	int done = 0;
	
	init_iso1PreChargeReqType(iso1PreChargeReqType);
	
	while(!done) {
		switch(grammarID) {
		case 205:
			/* 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_iso1DC_EVStatusType(stream, &iso1PreChargeReqType->DC_EVStatus);
					grammarID = 206;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 206:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1PreChargeReqType->EVTargetVoltage);
					grammarID = 207;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 207:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1PreChargeReqType->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: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_iso1EVSEStatusType(bitstream_t* stream, struct iso1EVSEStatusType* iso1EVSEStatusType) {
	int grammarID = 208;
	int done = 0;
	
	init_iso1EVSEStatusType(iso1EVSEStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 208:
			/* 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, &iso1EVSEStatusType->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 = 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: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);
							iso1EVSEStatusType->EVSENotification = (iso1EVSENotificationType) 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 = 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_iso1SignatureMethodType(bitstream_t* stream, struct iso1SignatureMethodType* iso1SignatureMethodType) {
	int grammarID = 210;
	int done = 0;
	
	init_iso1SignatureMethodType(iso1SignatureMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 210:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1SignatureMethodType->Algorithm.charactersLen);
					if (errn == 0) {
						if (iso1SignatureMethodType->Algorithm.charactersLen >= 2) {
							iso1SignatureMethodType->Algorithm.charactersLen = (uint16_t)(iso1SignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignatureMethodType->Algorithm.charactersLen, iso1SignatureMethodType->Algorithm.characters, iso1SignatureMethodType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 211;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 211:
			/* 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, &iso1SignatureMethodType->HMACOutputLength);
							iso1SignatureMethodType->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 = 116;
						} 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 = 116;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &iso1SignatureMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1SignatureMethodType->ANY.charactersLen >= 2) {
							iso1SignatureMethodType->ANY.charactersLen = (uint16_t)(iso1SignatureMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignatureMethodType->ANY.charactersLen, iso1SignatureMethodType->ANY.characters, iso1SignatureMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignatureMethodType->ANY_isUsed = 1u;
					grammarID = 212;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 116:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1SignatureMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1SignatureMethodType->ANY.charactersLen >= 2) {
							iso1SignatureMethodType->ANY.charactersLen = (uint16_t)(iso1SignatureMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignatureMethodType->ANY.charactersLen, iso1SignatureMethodType->ANY.characters, iso1SignatureMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignatureMethodType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 212:
			/* 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, &iso1SignatureMethodType->HMACOutputLength);
							iso1SignatureMethodType->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 = 116;
						} 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 = 116;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &iso1SignatureMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1SignatureMethodType->ANY.charactersLen >= 2) {
							iso1SignatureMethodType->ANY.charactersLen = (uint16_t)(iso1SignatureMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignatureMethodType->ANY.charactersLen, iso1SignatureMethodType->ANY.characters, iso1SignatureMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignatureMethodType->ANY_isUsed = 1u;
					grammarID = 212;
					break;
				default:
					errn = 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_iso1X509DataType(bitstream_t* stream, struct iso1X509DataType* iso1X509DataType) {
	int grammarID = 213;
	int done = 0;
	
	init_iso1X509DataType(iso1X509DataType);
	
	while(!done) {
		switch(grammarID) {
		case 213:
			/* 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 (iso1X509DataType->X509IssuerSerial.arrayLen < iso1X509DataType_X509IssuerSerial_ARRAY_SIZE) {
						errn = decode_iso1X509IssuerSerialType(stream, &iso1X509DataType->X509IssuerSerial.array[iso1X509DataType->X509IssuerSerial.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 214;
					break;
				case 1:
					if (iso1X509DataType->X509SKI.arrayLen < iso1X509DataType_X509SKI_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytesLen) <= iso1X509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytesLen, iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytes);
								}
								iso1X509DataType->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 = 214;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					if (iso1X509DataType->X509SubjectName.arrayLen < iso1X509DataType_X509SubjectName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen >= 2) {
										iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen, iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].characters, iso1X509DataType_X509SubjectName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1X509DataType->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 = 214;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					if (iso1X509DataType->X509Certificate.arrayLen < iso1X509DataType_X509Certificate_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytesLen) <= iso1X509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytesLen, iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytes);
								}
								iso1X509DataType->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 = 214;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					if (iso1X509DataType->X509CRL.arrayLen < iso1X509DataType_X509CRL_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytesLen) <= iso1X509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytesLen, iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytes);
								}
								iso1X509DataType->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 = 214;
						} 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 = 214;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 214:
			/* 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 (iso1X509DataType->X509IssuerSerial.arrayLen < iso1X509DataType_X509IssuerSerial_ARRAY_SIZE) {
						errn = decode_iso1X509IssuerSerialType(stream, &iso1X509DataType->X509IssuerSerial.array[iso1X509DataType->X509IssuerSerial.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 214;
					break;
				case 1:
					if (iso1X509DataType->X509SKI.arrayLen < iso1X509DataType_X509SKI_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytesLen) <= iso1X509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytesLen, iso1X509DataType->X509SKI.array[iso1X509DataType->X509SKI.arrayLen].bytes);
								}
								iso1X509DataType->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 = 214;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					if (iso1X509DataType->X509SubjectName.arrayLen < iso1X509DataType_X509SubjectName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen >= 2) {
										iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].charactersLen, iso1X509DataType->X509SubjectName.array[iso1X509DataType->X509SubjectName.arrayLen].characters, iso1X509DataType_X509SubjectName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1X509DataType->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 = 214;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					if (iso1X509DataType->X509Certificate.arrayLen < iso1X509DataType_X509Certificate_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytesLen) <= iso1X509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytesLen, iso1X509DataType->X509Certificate.array[iso1X509DataType->X509Certificate.arrayLen].bytes);
								}
								iso1X509DataType->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 = 214;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					if (iso1X509DataType->X509CRL.arrayLen < iso1X509DataType_X509CRL_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytesLen) <= iso1X509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytesLen, iso1X509DataType->X509CRL.array[iso1X509DataType->X509CRL.arrayLen].bytes);
								}
								iso1X509DataType->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 = 214;
						} 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 = 214;
					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='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_iso1NotificationType(bitstream_t* stream, struct iso1NotificationType* iso1NotificationType) {
	int grammarID = 215;
	int done = 0;
	
	init_iso1NotificationType(iso1NotificationType);
	
	while(!done) {
		switch(grammarID) {
		case 215:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013: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);
							iso1NotificationType->FaultCode = (iso1faultCodeType) 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}FaultCode) ? */
						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: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, &iso1NotificationType->FaultMsg.charactersLen);
							if (errn == 0) {
								if (iso1NotificationType->FaultMsg.charactersLen >= 2) {
									iso1NotificationType->FaultMsg.charactersLen = (uint16_t)(iso1NotificationType->FaultMsg.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1NotificationType->FaultMsg.charactersLen, iso1NotificationType->FaultMsg.characters, iso1NotificationType_FaultMsg_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1NotificationType->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:2013:MsgDataTypes}FaultMsg) ? */
						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,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_iso1SAScheduleListType(bitstream_t* stream, struct iso1SAScheduleListType* iso1SAScheduleListType) {
	int grammarID = 217;
	int done = 0;
	
	init_iso1SAScheduleListType(iso1SAScheduleListType);
	
	while(!done) {
		switch(grammarID) {
		case 217:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SAScheduleListType->SAScheduleTuple.arrayLen < iso1SAScheduleListType_SAScheduleTuple_ARRAY_SIZE) {
						errn = decode_iso1SAScheduleTupleType(stream, &iso1SAScheduleListType->SAScheduleTuple.array[iso1SAScheduleListType->SAScheduleTuple.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 218;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 218:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SAScheduleListType->SAScheduleTuple.arrayLen < iso1SAScheduleListType_SAScheduleTuple_ARRAY_SIZE) {
						errn = decode_iso1SAScheduleTupleType(stream, &iso1SAScheduleListType->SAScheduleTuple.array[iso1SAScheduleListType->SAScheduleTuple.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 219;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 219:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SAScheduleListType->SAScheduleTuple.arrayLen < iso1SAScheduleListType_SAScheduleTuple_ARRAY_SIZE) {
						errn = decode_iso1SAScheduleTupleType(stream, &iso1SAScheduleListType->SAScheduleTuple.array[iso1SAScheduleListType->SAScheduleTuple.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,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_iso1BodyType(bitstream_t* stream, struct iso1BodyType* iso1BodyType) {
	int grammarID = 220;
	int done = 0;
	
	init_iso1BodyType(iso1BodyType);
	
	while(!done) {
		switch(grammarID) {
		case 220:
			/* 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_iso1AuthorizationReqType(stream, &iso1BodyType->AuthorizationReq);
					iso1BodyType->AuthorizationReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 1:
					errn = decode_iso1AuthorizationResType(stream, &iso1BodyType->AuthorizationRes);
					iso1BodyType->AuthorizationRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					errn = decode_iso1BodyBaseType(stream, &iso1BodyType->BodyElement);
					iso1BodyType->BodyElement_isUsed = 1u;
					grammarID = 3;
					break;
				case 3:
					errn = decode_iso1CableCheckReqType(stream, &iso1BodyType->CableCheckReq);
					iso1BodyType->CableCheckReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 4:
					errn = decode_iso1CableCheckResType(stream, &iso1BodyType->CableCheckRes);
					iso1BodyType->CableCheckRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 5:
					errn = decode_iso1CertificateInstallationReqType(stream, &iso1BodyType->CertificateInstallationReq);
					iso1BodyType->CertificateInstallationReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 6:
					errn = decode_iso1CertificateInstallationResType(stream, &iso1BodyType->CertificateInstallationRes);
					iso1BodyType->CertificateInstallationRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 7:
					errn = decode_iso1CertificateUpdateReqType(stream, &iso1BodyType->CertificateUpdateReq);
					iso1BodyType->CertificateUpdateReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 8:
					errn = decode_iso1CertificateUpdateResType(stream, &iso1BodyType->CertificateUpdateRes);
					iso1BodyType->CertificateUpdateRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 9:
					errn = decode_iso1ChargeParameterDiscoveryReqType(stream, &iso1BodyType->ChargeParameterDiscoveryReq);
					iso1BodyType->ChargeParameterDiscoveryReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 10:
					errn = decode_iso1ChargeParameterDiscoveryResType(stream, &iso1BodyType->ChargeParameterDiscoveryRes);
					iso1BodyType->ChargeParameterDiscoveryRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 11:
					errn = decode_iso1ChargingStatusReqType(stream, &iso1BodyType->ChargingStatusReq);
					iso1BodyType->ChargingStatusReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 12:
					errn = decode_iso1ChargingStatusResType(stream, &iso1BodyType->ChargingStatusRes);
					iso1BodyType->ChargingStatusRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 13:
					errn = decode_iso1CurrentDemandReqType(stream, &iso1BodyType->CurrentDemandReq);
					iso1BodyType->CurrentDemandReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 14:
					errn = decode_iso1CurrentDemandResType(stream, &iso1BodyType->CurrentDemandRes);
					iso1BodyType->CurrentDemandRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 15:
					errn = decode_iso1MeteringReceiptReqType(stream, &iso1BodyType->MeteringReceiptReq);
					iso1BodyType->MeteringReceiptReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 16:
					errn = decode_iso1MeteringReceiptResType(stream, &iso1BodyType->MeteringReceiptRes);
					iso1BodyType->MeteringReceiptRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 17:
					errn = decode_iso1PaymentDetailsReqType(stream, &iso1BodyType->PaymentDetailsReq);
					iso1BodyType->PaymentDetailsReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 18:
					errn = decode_iso1PaymentDetailsResType(stream, &iso1BodyType->PaymentDetailsRes);
					iso1BodyType->PaymentDetailsRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 19:
					errn = decode_iso1PaymentServiceSelectionReqType(stream, &iso1BodyType->PaymentServiceSelectionReq);
					iso1BodyType->PaymentServiceSelectionReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 20:
					errn = decode_iso1PaymentServiceSelectionResType(stream, &iso1BodyType->PaymentServiceSelectionRes);
					iso1BodyType->PaymentServiceSelectionRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 21:
					errn = decode_iso1PowerDeliveryReqType(stream, &iso1BodyType->PowerDeliveryReq);
					iso1BodyType->PowerDeliveryReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 22:
					errn = decode_iso1PowerDeliveryResType(stream, &iso1BodyType->PowerDeliveryRes);
					iso1BodyType->PowerDeliveryRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 23:
					errn = decode_iso1PreChargeReqType(stream, &iso1BodyType->PreChargeReq);
					iso1BodyType->PreChargeReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 24:
					errn = decode_iso1PreChargeResType(stream, &iso1BodyType->PreChargeRes);
					iso1BodyType->PreChargeRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 25:
					errn = decode_iso1ServiceDetailReqType(stream, &iso1BodyType->ServiceDetailReq);
					iso1BodyType->ServiceDetailReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 26:
					errn = decode_iso1ServiceDetailResType(stream, &iso1BodyType->ServiceDetailRes);
					iso1BodyType->ServiceDetailRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 27:
					errn = decode_iso1ServiceDiscoveryReqType(stream, &iso1BodyType->ServiceDiscoveryReq);
					iso1BodyType->ServiceDiscoveryReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 28:
					errn = decode_iso1ServiceDiscoveryResType(stream, &iso1BodyType->ServiceDiscoveryRes);
					iso1BodyType->ServiceDiscoveryRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 29:
					errn = decode_iso1SessionSetupReqType(stream, &iso1BodyType->SessionSetupReq);
					iso1BodyType->SessionSetupReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 30:
					errn = decode_iso1SessionSetupResType(stream, &iso1BodyType->SessionSetupRes);
					iso1BodyType->SessionSetupRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 31:
					errn = decode_iso1SessionStopReqType(stream, &iso1BodyType->SessionStopReq);
					iso1BodyType->SessionStopReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 32:
					errn = decode_iso1SessionStopResType(stream, &iso1BodyType->SessionStopRes);
					iso1BodyType->SessionStopRes_isUsed = 1u;
					grammarID = 3;
					break;
				case 33:
					errn = decode_iso1WeldingDetectionReqType(stream, &iso1BodyType->WeldingDetectionReq);
					iso1BodyType->WeldingDetectionReq_isUsed = 1u;
					grammarID = 3;
					break;
				case 34:
					errn = decode_iso1WeldingDetectionResType(stream, &iso1BodyType->WeldingDetectionRes);
					iso1BodyType->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: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-24})',  derivedBy='RESTRICTION'.  */
static int decode_iso1ChargingProfileType(bitstream_t* stream, struct iso1ChargingProfileType* iso1ChargingProfileType) {
	int grammarID = 221;
	int done = 0;
	
	init_iso1ChargingProfileType(iso1ChargingProfileType);
	
	while(!done) {
		switch(grammarID) {
		case 221:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 222;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 222:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 223;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 223:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 224;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 224:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 225;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 225:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 226;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 226:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.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;
		case 227:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 228;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 228:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 229;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 229:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 230;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 230:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 231;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 231:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 232;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 232:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 233;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 233:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 234;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 234:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 235;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 235:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 236;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 236:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 237;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 237:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 238:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 239;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 239:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 240;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 240:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.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;
		case 241:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 242;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 242:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 243;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 243:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 244;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 244:
			/* 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 (iso1ChargingProfileType->ProfileEntry.arrayLen < iso1ChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_iso1ProfileEntryType(stream, &iso1ChargingProfileType->ProfileEntry.array[iso1ChargingProfileType->ProfileEntry.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='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_iso1TransformType(bitstream_t* stream, struct iso1TransformType* iso1TransformType) {
	int grammarID = 245;
	int done = 0;
	
	init_iso1TransformType(iso1TransformType);
	
	while(!done) {
		switch(grammarID) {
		case 245:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1TransformType->Algorithm.charactersLen);
					if (errn == 0) {
						if (iso1TransformType->Algorithm.charactersLen >= 2) {
							iso1TransformType->Algorithm.charactersLen = (uint16_t)(iso1TransformType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1TransformType->Algorithm.charactersLen, iso1TransformType->Algorithm.characters, iso1TransformType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 246;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 246:
			/* 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 (iso1TransformType->XPath.arrayLen < iso1TransformType_XPath_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen >= 2) {
										iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen = (uint16_t)(iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen, iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].characters, iso1TransformType_XPath_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1TransformType->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 = 247;
						} 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 = 247;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &iso1TransformType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1TransformType->ANY.charactersLen >= 2) {
							iso1TransformType->ANY.charactersLen = (uint16_t)(iso1TransformType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1TransformType->ANY.charactersLen, iso1TransformType->ANY.characters, iso1TransformType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1TransformType->ANY_isUsed = 1u;
					grammarID = 247;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 247:
			/* 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 (iso1TransformType->XPath.arrayLen < iso1TransformType_XPath_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen);
								if (errn == 0) {
									if (iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen >= 2) {
										iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen = (uint16_t)(iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].charactersLen, iso1TransformType->XPath.array[iso1TransformType->XPath.arrayLen].characters, iso1TransformType_XPath_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								iso1TransformType->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 = 247;
						} 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 = 247;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &iso1TransformType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1TransformType->ANY.charactersLen >= 2) {
							iso1TransformType->ANY.charactersLen = (uint16_t)(iso1TransformType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1TransformType->ANY.charactersLen, iso1TransformType->ANY.characters, iso1TransformType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1TransformType->ANY_isUsed = 1u;
					grammarID = 247;
					break;
				default:
					errn = 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_iso1SAScheduleTupleType(bitstream_t* stream, struct iso1SAScheduleTupleType* iso1SAScheduleTupleType) {
	int grammarID = 248;
	int done = 0;
	
	init_iso1SAScheduleTupleType(iso1SAScheduleTupleType);
	
	while(!done) {
		switch(grammarID) {
		case 248:
			/* 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));
							iso1SAScheduleTupleType->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 = 249;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 249:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PMaxScheduleType(stream, &iso1SAScheduleTupleType->PMaxSchedule);
					grammarID = 250;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 250:
			/* 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_iso1SalesTariffType(stream, &iso1SAScheduleTupleType->SalesTariff);
					iso1SAScheduleTupleType->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] */
			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_iso1AC_EVChargeParameterType(bitstream_t* stream, struct iso1AC_EVChargeParameterType* iso1AC_EVChargeParameterType) {
	int grammarID = 251;
	int done = 0;
	
	init_iso1AC_EVChargeParameterType(iso1AC_EVChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 251:
			/* 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, &iso1AC_EVChargeParameterType->DepartureTime);
							iso1AC_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 = 252;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1AC_EVChargeParameterType->EAmount);
					grammarID = 253;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 252:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1AC_EVChargeParameterType->EAmount);
					grammarID = 253;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 253:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1AC_EVChargeParameterType->EVMaxVoltage);
					grammarID = 254;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 254:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1AC_EVChargeParameterType->EVMaxCurrent);
					grammarID = 255;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 255:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1AC_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: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_iso1AnonType_V2G_Message(bitstream_t* stream, struct iso1AnonType_V2G_Message* iso1AnonType_V2G_Message) {
	int grammarID = 256;
	int done = 0;
	
	init_iso1AnonType_V2G_Message(iso1AnonType_V2G_Message);
	
	while(!done) {
		switch(grammarID) {
		case 256:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1MessageHeaderType(stream, &iso1AnonType_V2G_Message->Header);
					grammarID = 257;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 257:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1BodyType(stream, &iso1AnonType_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: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_iso1PaymentDetailsResType(bitstream_t* stream, struct iso1PaymentDetailsResType* iso1PaymentDetailsResType) {
	int grammarID = 258;
	int done = 0;
	
	init_iso1PaymentDetailsResType(iso1PaymentDetailsResType);
	
	while(!done) {
		switch(grammarID) {
		case 258:
			/* 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);
							iso1PaymentDetailsResType->ResponseCode = (iso1responseCodeType) 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 = 259;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 259:
			/* 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, &iso1PaymentDetailsResType->GenChallenge.bytesLen);
							if (errn == 0) {
								errn =  (iso1PaymentDetailsResType->GenChallenge.bytesLen) <= iso1PaymentDetailsResType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1PaymentDetailsResType->GenChallenge.bytesLen, iso1PaymentDetailsResType->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 = 260;
						} 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({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, &iso1PaymentDetailsResType->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='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_iso1ContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct iso1ContractSignatureEncryptedPrivateKeyType* iso1ContractSignatureEncryptedPrivateKeyType) {
	int grammarID = 23;
	int done = 0;
	
	init_iso1ContractSignatureEncryptedPrivateKeyType(iso1ContractSignatureEncryptedPrivateKeyType);
	
	while(!done) {
		switch(grammarID) {
		case 23:
			/* 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, &iso1ContractSignatureEncryptedPrivateKeyType->Id.charactersLen);
					if (errn == 0) {
						if (iso1ContractSignatureEncryptedPrivateKeyType->Id.charactersLen >= 2) {
							iso1ContractSignatureEncryptedPrivateKeyType->Id.charactersLen = (uint16_t)(iso1ContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ContractSignatureEncryptedPrivateKeyType->Id.charactersLen, iso1ContractSignatureEncryptedPrivateKeyType->Id.characters, iso1ContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 24;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 24:
			/* StartTag[CHARACTERS[BINARY_BASE64]] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1ContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen);
					if (errn == 0) {
						errn =  (iso1ContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen) <= iso1ContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
					}
					if (errn == 0) {
						errn = decodeBytes(stream, iso1ContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen, iso1ContractSignatureEncryptedPrivateKeyType->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: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_iso1PMaxScheduleEntryType(bitstream_t* stream, struct iso1PMaxScheduleEntryType* iso1PMaxScheduleEntryType) {
	int grammarID = 261;
	int done = 0;
	
	init_iso1PMaxScheduleEntryType(iso1PMaxScheduleEntryType);
	
	while(!done) {
		switch(grammarID) {
		case 261:
			/* 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_iso1RelativeTimeIntervalType(stream, &iso1PMaxScheduleEntryType->RelativeTimeInterval);
					iso1PMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u;
					grammarID = 262;
					break;
				case 1:
					errn = decode_iso1IntervalType(stream, &iso1PMaxScheduleEntryType->TimeInterval);
					iso1PMaxScheduleEntryType->TimeInterval_isUsed = 1u;
					grammarID = 262;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 262:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1PMaxScheduleEntryType->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='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_iso1SPKIDataType(bitstream_t* stream, struct iso1SPKIDataType* iso1SPKIDataType) {
	int grammarID = 263;
	int done = 0;
	
	init_iso1SPKIDataType(iso1SPKIDataType);
	
	while(!done) {
		switch(grammarID) {
		case 263:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SPKIDataType->SPKISexp.arrayLen < iso1SPKIDataType_SPKISexp_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen) <= iso1SPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen, iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytes);
								}
								iso1SPKIDataType->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 = 264;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 264:
			/* 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 (iso1SPKIDataType->SPKISexp.arrayLen < iso1SPKIDataType_SPKISexp_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen) <= iso1SPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen, iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytes);
								}
								iso1SPKIDataType->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 = 264;
						} 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 = 265;
					break;
				case 2:
					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#}SPKISexp), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SPKIDataType->SPKISexp.arrayLen < iso1SPKIDataType_SPKISexp_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen) <= iso1SPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytesLen, iso1SPKIDataType->SPKISexp.array[iso1SPKIDataType->SPKISexp.arrayLen].bytes);
								}
								iso1SPKIDataType->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 = 264;
						} 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,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_iso1MeteringReceiptResType(bitstream_t* stream, struct iso1MeteringReceiptResType* iso1MeteringReceiptResType) {
	int grammarID = 93;
	int done = 0;
	
	init_iso1MeteringReceiptResType(iso1MeteringReceiptResType);
	
	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);
							iso1MeteringReceiptResType->ResponseCode = (iso1responseCodeType) 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: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_iso1AC_EVSEStatusType(stream, &iso1MeteringReceiptResType->AC_EVSEStatus);
					iso1MeteringReceiptResType->AC_EVSEStatus_isUsed = 1u;
					grammarID = 3;
					break;
				case 1:
					errn = decode_iso1DC_EVSEStatusType(stream, &iso1MeteringReceiptResType->DC_EVSEStatus);
					iso1MeteringReceiptResType->DC_EVSEStatus_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					errn = decode_iso1EVSEStatusType(stream, &iso1MeteringReceiptResType->EVSEStatus);
					iso1MeteringReceiptResType->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,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_iso1SessionStopReqType(bitstream_t* stream, struct iso1SessionStopReqType* iso1SessionStopReqType) {
	int grammarID = 266;
	int done = 0;
	
	init_iso1SessionStopReqType(iso1SessionStopReqType);
	
	while(!done) {
		switch(grammarID) {
		case 266:
			/* 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);
							iso1SessionStopReqType->ChargingSession = (iso1chargingSessionType) 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: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_iso1WeldingDetectionResType(bitstream_t* stream, struct iso1WeldingDetectionResType* iso1WeldingDetectionResType) {
	int grammarID = 39;
	int done = 0;
	
	init_iso1WeldingDetectionResType(iso1WeldingDetectionResType);
	
	while(!done) {
		switch(grammarID) {
		case 39:
			/* 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);
							iso1WeldingDetectionResType->ResponseCode = (iso1responseCodeType) 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 = 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({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1DC_EVSEStatusType(stream, &iso1WeldingDetectionResType->DC_EVSEStatus);
					grammarID = 41;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 41:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1WeldingDetectionResType->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='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_iso1ReferenceType(bitstream_t* stream, struct iso1ReferenceType* iso1ReferenceType) {
	int grammarID = 267;
	int done = 0;
	
	init_iso1ReferenceType(iso1ReferenceType);
	
	while(!done) {
		switch(grammarID) {
		case 267:
			/* 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, &iso1ReferenceType->Id.charactersLen);
					if (errn == 0) {
						if (iso1ReferenceType->Id.charactersLen >= 2) {
							iso1ReferenceType->Id.charactersLen = (uint16_t)(iso1ReferenceType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ReferenceType->Id.charactersLen, iso1ReferenceType->Id.characters, iso1ReferenceType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ReferenceType->Id_isUsed = 1u;
					grammarID = 268;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1ReferenceType->Type.charactersLen);
					if (errn == 0) {
						if (iso1ReferenceType->Type.charactersLen >= 2) {
							iso1ReferenceType->Type.charactersLen = (uint16_t)(iso1ReferenceType->Type.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ReferenceType->Type.charactersLen, iso1ReferenceType->Type.characters, iso1ReferenceType_Type_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ReferenceType->Type_isUsed = 1u;
					grammarID = 269;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1ReferenceType->URI.charactersLen);
					if (errn == 0) {
						if (iso1ReferenceType->URI.charactersLen >= 2) {
							iso1ReferenceType->URI.charactersLen = (uint16_t)(iso1ReferenceType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ReferenceType->URI.charactersLen, iso1ReferenceType->URI.characters, iso1ReferenceType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ReferenceType->URI_isUsed = 1u;
					grammarID = 270;
					break;
				case 3:
					errn = decode_iso1TransformsType(stream, &iso1ReferenceType->Transforms);
					iso1ReferenceType->Transforms_isUsed = 1u;
					grammarID = 271;
					break;
				case 4:
					errn = decode_iso1DigestMethodType(stream, &iso1ReferenceType->DigestMethod);
					grammarID = 272;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 268:
			/* 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, &iso1ReferenceType->Type.charactersLen);
					if (errn == 0) {
						if (iso1ReferenceType->Type.charactersLen >= 2) {
							iso1ReferenceType->Type.charactersLen = (uint16_t)(iso1ReferenceType->Type.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ReferenceType->Type.charactersLen, iso1ReferenceType->Type.characters, iso1ReferenceType_Type_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ReferenceType->Type_isUsed = 1u;
					grammarID = 269;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1ReferenceType->URI.charactersLen);
					if (errn == 0) {
						if (iso1ReferenceType->URI.charactersLen >= 2) {
							iso1ReferenceType->URI.charactersLen = (uint16_t)(iso1ReferenceType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ReferenceType->URI.charactersLen, iso1ReferenceType->URI.characters, iso1ReferenceType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ReferenceType->URI_isUsed = 1u;
					grammarID = 270;
					break;
				case 2:
					errn = decode_iso1TransformsType(stream, &iso1ReferenceType->Transforms);
					iso1ReferenceType->Transforms_isUsed = 1u;
					grammarID = 271;
					break;
				case 3:
					errn = decode_iso1DigestMethodType(stream, &iso1ReferenceType->DigestMethod);
					grammarID = 272;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 269:
			/* 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, &iso1ReferenceType->URI.charactersLen);
					if (errn == 0) {
						if (iso1ReferenceType->URI.charactersLen >= 2) {
							iso1ReferenceType->URI.charactersLen = (uint16_t)(iso1ReferenceType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1ReferenceType->URI.charactersLen, iso1ReferenceType->URI.characters, iso1ReferenceType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1ReferenceType->URI_isUsed = 1u;
					grammarID = 270;
					break;
				case 1:
					errn = decode_iso1TransformsType(stream, &iso1ReferenceType->Transforms);
					iso1ReferenceType->Transforms_isUsed = 1u;
					grammarID = 271;
					break;
				case 2:
					errn = decode_iso1DigestMethodType(stream, &iso1ReferenceType->DigestMethod);
					grammarID = 272;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 270:
			/* 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_iso1TransformsType(stream, &iso1ReferenceType->Transforms);
					iso1ReferenceType->Transforms_isUsed = 1u;
					grammarID = 271;
					break;
				case 1:
					errn = decode_iso1DigestMethodType(stream, &iso1ReferenceType->DigestMethod);
					grammarID = 272;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 271:
			/* 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_iso1DigestMethodType(stream, &iso1ReferenceType->DigestMethod);
					grammarID = 272;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 272:
			/* 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, &iso1ReferenceType->DigestValue.bytesLen);
							if (errn == 0) {
								errn =  (iso1ReferenceType->DigestValue.bytesLen) <= iso1ReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1ReferenceType->DigestValue.bytesLen, iso1ReferenceType->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: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_iso1CurrentDemandReqType(bitstream_t* stream, struct iso1CurrentDemandReqType* iso1CurrentDemandReqType) {
	int grammarID = 273;
	int done = 0;
	
	init_iso1CurrentDemandReqType(iso1CurrentDemandReqType);
	
	while(!done) {
		switch(grammarID) {
		case 273:
			/* 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_iso1DC_EVStatusType(stream, &iso1CurrentDemandReqType->DC_EVStatus);
					grammarID = 274;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 274:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVTargetCurrent);
					grammarID = 275;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 275:
			/* 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_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVMaximumVoltageLimit);
					iso1CurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u;
					grammarID = 276;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVMaximumCurrentLimit);
					iso1CurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u;
					grammarID = 277;
					break;
				case 2:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVMaximumPowerLimit);
					iso1CurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 278;
					break;
				case 3:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &iso1CurrentDemandReqType->BulkChargingComplete);
							iso1CurrentDemandReqType->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 = 279;
						} 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, &iso1CurrentDemandReqType->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 = 280;
						} 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({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_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVMaximumCurrentLimit);
					iso1CurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u;
					grammarID = 277;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVMaximumPowerLimit);
					iso1CurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 278;
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &iso1CurrentDemandReqType->BulkChargingComplete);
							iso1CurrentDemandReqType->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 = 279;
						} 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, &iso1CurrentDemandReqType->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 = 280;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 277:
			/* 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_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVMaximumPowerLimit);
					iso1CurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 278;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &iso1CurrentDemandReqType->BulkChargingComplete);
							iso1CurrentDemandReqType->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 = 279;
						} 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, &iso1CurrentDemandReqType->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 = 280;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 278:
			/* 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, &iso1CurrentDemandReqType->BulkChargingComplete);
							iso1CurrentDemandReqType->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 = 279;
						} 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, &iso1CurrentDemandReqType->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 = 280;
						} 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: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, &iso1CurrentDemandReqType->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 = 280;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 280:
			/* 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_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->RemainingTimeToFullSoC);
					iso1CurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u;
					grammarID = 281;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->RemainingTimeToBulkSoC);
					iso1CurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u;
					grammarID = 282;
					break;
				case 2:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVTargetVoltage);
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 281:
			/* 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_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->RemainingTimeToBulkSoC);
					iso1CurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u;
					grammarID = 282;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->EVTargetVoltage);
					grammarID = 3;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 282:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandReqType->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,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_iso1SalesTariffEntryType(bitstream_t* stream, struct iso1SalesTariffEntryType* iso1SalesTariffEntryType) {
	int grammarID = 283;
	int done = 0;
	
	init_iso1SalesTariffEntryType(iso1SalesTariffEntryType);
	
	while(!done) {
		switch(grammarID) {
		case 283:
			/* 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_iso1RelativeTimeIntervalType(stream, &iso1SalesTariffEntryType->RelativeTimeInterval);
					iso1SalesTariffEntryType->RelativeTimeInterval_isUsed = 1u;
					grammarID = 284;
					break;
				case 1:
					errn = decode_iso1IntervalType(stream, &iso1SalesTariffEntryType->TimeInterval);
					iso1SalesTariffEntryType->TimeInterval_isUsed = 1u;
					grammarID = 284;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 284:
			/* 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));
							iso1SalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0);
							iso1SalesTariffEntryType->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 = 285;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (iso1SalesTariffEntryType->ConsumptionCost.arrayLen < iso1SalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) {
						errn = decode_iso1ConsumptionCostType(stream, &iso1SalesTariffEntryType->ConsumptionCost.array[iso1SalesTariffEntryType->ConsumptionCost.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 286;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 285:
			/* 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 (iso1SalesTariffEntryType->ConsumptionCost.arrayLen < iso1SalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) {
						errn = decode_iso1ConsumptionCostType(stream, &iso1SalesTariffEntryType->ConsumptionCost.array[iso1SalesTariffEntryType->ConsumptionCost.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 286;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 286:
			/* 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 (iso1SalesTariffEntryType->ConsumptionCost.arrayLen < iso1SalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) {
						errn = decode_iso1ConsumptionCostType(stream, &iso1SalesTariffEntryType->ConsumptionCost.array[iso1SalesTariffEntryType->ConsumptionCost.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 287;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 287:
			/* 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 (iso1SalesTariffEntryType->ConsumptionCost.arrayLen < iso1SalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) {
						errn = decode_iso1ConsumptionCostType(stream, &iso1SalesTariffEntryType->ConsumptionCost.array[iso1SalesTariffEntryType->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;
					break;
				default:
					errn = 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_iso1EntryType(bitstream_t* stream, struct iso1EntryType* iso1EntryType) {
	int grammarID = 288;
	int done = 0;
	
	init_iso1EntryType(iso1EntryType);
	
	while(!done) {
		switch(grammarID) {
		case 288:
			/* 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_iso1RelativeTimeIntervalType(stream, &iso1EntryType->RelativeTimeInterval);
					iso1EntryType->RelativeTimeInterval_isUsed = 1u;
					grammarID = 3;
					break;
				case 1:
					errn = decode_iso1IntervalType(stream, &iso1EntryType->TimeInterval);
					iso1EntryType->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,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_iso1SessionSetupReqType(bitstream_t* stream, struct iso1SessionSetupReqType* iso1SessionSetupReqType) {
	int grammarID = 289;
	int done = 0;
	
	init_iso1SessionSetupReqType(iso1SessionSetupReqType);
	
	while(!done) {
		switch(grammarID) {
		case 289:
			/* 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, &iso1SessionSetupReqType->EVCCID.bytesLen);
							if (errn == 0) {
								errn =  (iso1SessionSetupReqType->EVCCID.bytesLen) <= iso1SessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1SessionSetupReqType->EVCCID.bytesLen, iso1SessionSetupReqType->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 = 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,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_iso1CostType(bitstream_t* stream, struct iso1CostType* iso1CostType) {
	int grammarID = 290;
	int done = 0;
	
	init_iso1CostType(iso1CostType);
	
	while(!done) {
		switch(grammarID) {
		case 290:
			/* 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);
							iso1CostType->costKind = (iso1costKindType) 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 = 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: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, &iso1CostType->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 = 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}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));
							iso1CostType->amountMultiplier = (int8_t)(uint32 -3);
							iso1CostType->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 */
						}
					}
					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,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_iso1DC_EVPowerDeliveryParameterType(bitstream_t* stream, struct iso1DC_EVPowerDeliveryParameterType* iso1DC_EVPowerDeliveryParameterType) {
	int grammarID = 293;
	int done = 0;
	
	init_iso1DC_EVPowerDeliveryParameterType(iso1DC_EVPowerDeliveryParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 293:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1DC_EVStatusType(stream, &iso1DC_EVPowerDeliveryParameterType->DC_EVStatus);
					grammarID = 294;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 294:
			/* 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, &iso1DC_EVPowerDeliveryParameterType->BulkChargingComplete);
							iso1DC_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 = 295;
						} 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, &iso1DC_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 295:
			/* 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, &iso1DC_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='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_iso1RetrievalMethodType(bitstream_t* stream, struct iso1RetrievalMethodType* iso1RetrievalMethodType) {
	int grammarID = 296;
	int done = 0;
	
	init_iso1RetrievalMethodType(iso1RetrievalMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 296:
			/* 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, &iso1RetrievalMethodType->Type.charactersLen);
					if (errn == 0) {
						if (iso1RetrievalMethodType->Type.charactersLen >= 2) {
							iso1RetrievalMethodType->Type.charactersLen = (uint16_t)(iso1RetrievalMethodType->Type.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1RetrievalMethodType->Type.charactersLen, iso1RetrievalMethodType->Type.characters, iso1RetrievalMethodType_Type_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1RetrievalMethodType->Type_isUsed = 1u;
					grammarID = 297;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1RetrievalMethodType->URI.charactersLen);
					if (errn == 0) {
						if (iso1RetrievalMethodType->URI.charactersLen >= 2) {
							iso1RetrievalMethodType->URI.charactersLen = (uint16_t)(iso1RetrievalMethodType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1RetrievalMethodType->URI.charactersLen, iso1RetrievalMethodType->URI.characters, iso1RetrievalMethodType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1RetrievalMethodType->URI_isUsed = 1u;
					grammarID = 298;
					break;
				case 2:
					errn = decode_iso1TransformsType(stream, &iso1RetrievalMethodType->Transforms);
					iso1RetrievalMethodType->Transforms_isUsed = 1u;
					grammarID = 3;
					break;
				case 3:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 297:
			/* 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, &iso1RetrievalMethodType->URI.charactersLen);
					if (errn == 0) {
						if (iso1RetrievalMethodType->URI.charactersLen >= 2) {
							iso1RetrievalMethodType->URI.charactersLen = (uint16_t)(iso1RetrievalMethodType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1RetrievalMethodType->URI.charactersLen, iso1RetrievalMethodType->URI.characters, iso1RetrievalMethodType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1RetrievalMethodType->URI_isUsed = 1u;
					grammarID = 298;
					break;
				case 1:
					errn = decode_iso1TransformsType(stream, &iso1RetrievalMethodType->Transforms);
					iso1RetrievalMethodType->Transforms_isUsed = 1u;
					grammarID = 3;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 298:
			/* 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_iso1TransformsType(stream, &iso1RetrievalMethodType->Transforms);
					iso1RetrievalMethodType->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,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_iso1CertificateUpdateResType(bitstream_t* stream, struct iso1CertificateUpdateResType* iso1CertificateUpdateResType) {
	int grammarID = 299;
	int done = 0;
	
	init_iso1CertificateUpdateResType(iso1CertificateUpdateResType);
	
	while(!done) {
		switch(grammarID) {
		case 299:
			/* 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);
							iso1CertificateUpdateResType->ResponseCode = (iso1responseCodeType) 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 = 300;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 300:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1CertificateChainType(stream, &iso1CertificateUpdateResType->SAProvisioningCertificateChain);
					grammarID = 301;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 301:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1CertificateChainType(stream, &iso1CertificateUpdateResType->ContractSignatureCertChain);
					grammarID = 302;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 302:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1ContractSignatureEncryptedPrivateKeyType(stream, &iso1CertificateUpdateResType->ContractSignatureEncryptedPrivateKey);
					grammarID = 303;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 303:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1DiffieHellmanPublickeyType(stream, &iso1CertificateUpdateResType->DHpublickey);
					grammarID = 304;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 304:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1EMAIDType(stream, &iso1CertificateUpdateResType->eMAID);
					grammarID = 305;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 305:
			/* 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, &iso1CertificateUpdateResType->RetryCounter);
							iso1CertificateUpdateResType->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,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_iso1CertificateInstallationResType(bitstream_t* stream, struct iso1CertificateInstallationResType* iso1CertificateInstallationResType) {
	int grammarID = 306;
	int done = 0;
	
	init_iso1CertificateInstallationResType(iso1CertificateInstallationResType);
	
	while(!done) {
		switch(grammarID) {
		case 306:
			/* 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);
							iso1CertificateInstallationResType->ResponseCode = (iso1responseCodeType) 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 = 307;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 307:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1CertificateChainType(stream, &iso1CertificateInstallationResType->SAProvisioningCertificateChain);
					grammarID = 308;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 308:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1CertificateChainType(stream, &iso1CertificateInstallationResType->ContractSignatureCertChain);
					grammarID = 309;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 309:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1ContractSignatureEncryptedPrivateKeyType(stream, &iso1CertificateInstallationResType->ContractSignatureEncryptedPrivateKey);
					grammarID = 310;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 310:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1DiffieHellmanPublickeyType(stream, &iso1CertificateInstallationResType->DHpublickey);
					grammarID = 311;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 311:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1EMAIDType(stream, &iso1CertificateInstallationResType->eMAID);
					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#,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_iso1CanonicalizationMethodType(bitstream_t* stream, struct iso1CanonicalizationMethodType* iso1CanonicalizationMethodType) {
	int grammarID = 312;
	int done = 0;
	
	init_iso1CanonicalizationMethodType(iso1CanonicalizationMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 312:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1CanonicalizationMethodType->Algorithm.charactersLen);
					if (errn == 0) {
						if (iso1CanonicalizationMethodType->Algorithm.charactersLen >= 2) {
							iso1CanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(iso1CanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1CanonicalizationMethodType->Algorithm.charactersLen, iso1CanonicalizationMethodType->Algorithm.characters, iso1CanonicalizationMethodType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 115;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 115:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1CanonicalizationMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1CanonicalizationMethodType->ANY.charactersLen >= 2) {
							iso1CanonicalizationMethodType->ANY.charactersLen = (uint16_t)(iso1CanonicalizationMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1CanonicalizationMethodType->ANY.charactersLen, iso1CanonicalizationMethodType->ANY.characters, iso1CanonicalizationMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1CanonicalizationMethodType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 116:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1CanonicalizationMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1CanonicalizationMethodType->ANY.charactersLen >= 2) {
							iso1CanonicalizationMethodType->ANY.charactersLen = (uint16_t)(iso1CanonicalizationMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1CanonicalizationMethodType->ANY.charactersLen, iso1CanonicalizationMethodType->ANY.characters, iso1CanonicalizationMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1CanonicalizationMethodType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = 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_iso1WeldingDetectionReqType(bitstream_t* stream, struct iso1WeldingDetectionReqType* iso1WeldingDetectionReqType) {
	int grammarID = 313;
	int done = 0;
	
	init_iso1WeldingDetectionReqType(iso1WeldingDetectionReqType);
	
	while(!done) {
		switch(grammarID) {
		case 313:
			/* 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_iso1DC_EVStatusType(stream, &iso1WeldingDetectionReqType->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: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_iso1DC_EVStatusType(bitstream_t* stream, struct iso1DC_EVStatusType* iso1DC_EVStatusType) {
	int grammarID = 314;
	int done = 0;
	
	init_iso1DC_EVStatusType(iso1DC_EVStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 314:
			/* 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, &iso1DC_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 = 315;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 315:
			/* 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);
							iso1DC_EVStatusType->EVErrorCode = (iso1DC_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 = 316;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 316:
			/* 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));
							iso1DC_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,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_iso1CurrentDemandResType(bitstream_t* stream, struct iso1CurrentDemandResType* iso1CurrentDemandResType) {
	int grammarID = 317;
	int done = 0;
	
	init_iso1CurrentDemandResType(iso1CurrentDemandResType);
	
	while(!done) {
		switch(grammarID) {
		case 317:
			/* 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);
							iso1CurrentDemandResType->ResponseCode = (iso1responseCodeType) 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 = 318;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 318:
			/* 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_iso1DC_EVSEStatusType(stream, &iso1CurrentDemandResType->DC_EVSEStatus);
					grammarID = 319;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 319:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEPresentVoltage);
					grammarID = 320;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 320:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEPresentCurrent);
					grammarID = 321;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 321:
			/* 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, &iso1CurrentDemandResType->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 = 322;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 322:
			/* 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, &iso1CurrentDemandResType->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 = 323;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 323:
			/* 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, &iso1CurrentDemandResType->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 = 324;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 324:
			/* 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_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEMaximumVoltageLimit);
					iso1CurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u;
					grammarID = 325;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEMaximumCurrentLimit);
					iso1CurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u;
					grammarID = 326;
					break;
				case 2:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEMaximumPowerLimit);
					iso1CurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u;
					grammarID = 327;
					break;
				case 3:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1CurrentDemandResType->EVSEID.charactersLen);
							if (errn == 0) {
								if (iso1CurrentDemandResType->EVSEID.charactersLen >= 2) {
									iso1CurrentDemandResType->EVSEID.charactersLen = (uint16_t)(iso1CurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1CurrentDemandResType->EVSEID.charactersLen, iso1CurrentDemandResType->EVSEID.characters, iso1CurrentDemandResType_EVSEID_CHARACTERS_SIZE);
								} 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 = 328;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 325:
			/* 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_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEMaximumCurrentLimit);
					iso1CurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u;
					grammarID = 326;
					break;
				case 1:
					errn = decode_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEMaximumPowerLimit);
					iso1CurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u;
					grammarID = 327;
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1CurrentDemandResType->EVSEID.charactersLen);
							if (errn == 0) {
								if (iso1CurrentDemandResType->EVSEID.charactersLen >= 2) {
									iso1CurrentDemandResType->EVSEID.charactersLen = (uint16_t)(iso1CurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1CurrentDemandResType->EVSEID.charactersLen, iso1CurrentDemandResType->EVSEID.characters, iso1CurrentDemandResType_EVSEID_CHARACTERS_SIZE);
								} 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 = 328;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 326:
			/* 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_iso1PhysicalValueType(stream, &iso1CurrentDemandResType->EVSEMaximumPowerLimit);
					iso1CurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u;
					grammarID = 327;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &iso1CurrentDemandResType->EVSEID.charactersLen);
							if (errn == 0) {
								if (iso1CurrentDemandResType->EVSEID.charactersLen >= 2) {
									iso1CurrentDemandResType->EVSEID.charactersLen = (uint16_t)(iso1CurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1CurrentDemandResType->EVSEID.charactersLen, iso1CurrentDemandResType->EVSEID.characters, iso1CurrentDemandResType_EVSEID_CHARACTERS_SIZE);
								} 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 = 328;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 327:
			/* 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, &iso1CurrentDemandResType->EVSEID.charactersLen);
							if (errn == 0) {
								if (iso1CurrentDemandResType->EVSEID.charactersLen >= 2) {
									iso1CurrentDemandResType->EVSEID.charactersLen = (uint16_t)(iso1CurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1CurrentDemandResType->EVSEID.charactersLen, iso1CurrentDemandResType->EVSEID.characters, iso1CurrentDemandResType_EVSEID_CHARACTERS_SIZE);
								} 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 = 328;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 328:
			/* 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));
							iso1CurrentDemandResType->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 = 329;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 329:
			/* 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_iso1MeterInfoType(stream, &iso1CurrentDemandResType->MeterInfo);
					iso1CurrentDemandResType->MeterInfo_isUsed = 1u;
					grammarID = 330;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &iso1CurrentDemandResType->ReceiptRequired);
							iso1CurrentDemandResType->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 = 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 330:
			/* 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, &iso1CurrentDemandResType->ReceiptRequired);
							iso1CurrentDemandResType->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 = 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,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_iso1ServiceType(bitstream_t* stream, struct iso1ServiceType* iso1ServiceType) {
	int grammarID = 331;
	int done = 0;
	
	init_iso1ServiceType(iso1ServiceType);
	
	while(!done) {
		switch(grammarID) {
		case 331:
			/* 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, &iso1ServiceType->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 = 332;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 332:
			/* 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, &iso1ServiceType->ServiceName.charactersLen);
							if (errn == 0) {
								if (iso1ServiceType->ServiceName.charactersLen >= 2) {
									iso1ServiceType->ServiceName.charactersLen = (uint16_t)(iso1ServiceType->ServiceName.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1ServiceType->ServiceName.charactersLen, iso1ServiceType->ServiceName.characters, iso1ServiceType_ServiceName_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1ServiceType->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 = 333;
						} 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);
							iso1ServiceType->ServiceCategory = (iso1serviceCategoryType) 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 = 334;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 333:
			/* 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);
							iso1ServiceType->ServiceCategory = (iso1serviceCategoryType) 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 = 334;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 334:
			/* 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, &iso1ServiceType->ServiceScope.charactersLen);
							if (errn == 0) {
								if (iso1ServiceType->ServiceScope.charactersLen >= 2) {
									iso1ServiceType->ServiceScope.charactersLen = (uint16_t)(iso1ServiceType->ServiceScope.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1ServiceType->ServiceScope.charactersLen, iso1ServiceType->ServiceScope.characters, iso1ServiceType_ServiceScope_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1ServiceType->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 = 335;
						} 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, &iso1ServiceType->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 335:
			/* 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, &iso1ServiceType->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,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_iso1ServiceDiscoveryReqType(bitstream_t* stream, struct iso1ServiceDiscoveryReqType* iso1ServiceDiscoveryReqType) {
	int grammarID = 336;
	int done = 0;
	
	init_iso1ServiceDiscoveryReqType(iso1ServiceDiscoveryReqType);
	
	while(!done) {
		switch(grammarID) {
		case 336:
			/* 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, &iso1ServiceDiscoveryReqType->ServiceScope.charactersLen);
							if (errn == 0) {
								if (iso1ServiceDiscoveryReqType->ServiceScope.charactersLen >= 2) {
									iso1ServiceDiscoveryReqType->ServiceScope.charactersLen = (uint16_t)(iso1ServiceDiscoveryReqType->ServiceScope.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1ServiceDiscoveryReqType->ServiceScope.charactersLen, iso1ServiceDiscoveryReqType->ServiceScope.characters, iso1ServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1ServiceDiscoveryReqType->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 = 337;
						} 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);
							iso1ServiceDiscoveryReqType->ServiceCategory = (iso1serviceCategoryType) uint32;
							iso1ServiceDiscoveryReqType->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 2:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 337:
			/* 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);
							iso1ServiceDiscoveryReqType->ServiceCategory = (iso1serviceCategoryType) uint32;
							iso1ServiceDiscoveryReqType->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;
					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_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_iso1AC_EVSEChargeParameterType(bitstream_t* stream, struct iso1AC_EVSEChargeParameterType* iso1AC_EVSEChargeParameterType) {
	int grammarID = 338;
	int done = 0;
	
	init_iso1AC_EVSEChargeParameterType(iso1AC_EVSEChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 338:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1AC_EVSEStatusType(stream, &iso1AC_EVSEChargeParameterType->AC_EVSEStatus);
					grammarID = 339;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 339:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1AC_EVSEChargeParameterType->EVSENominalVoltage);
					grammarID = 340;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 340:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1PhysicalValueType(stream, &iso1AC_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='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_iso1CableCheckReqType(bitstream_t* stream, struct iso1CableCheckReqType* iso1CableCheckReqType) {
	int grammarID = 313;
	int done = 0;
	
	init_iso1CableCheckReqType(iso1CableCheckReqType);
	
	while(!done) {
		switch(grammarID) {
		case 313:
			/* 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_iso1DC_EVStatusType(stream, &iso1CableCheckReqType->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: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_iso1SelectedServiceType(bitstream_t* stream, struct iso1SelectedServiceType* iso1SelectedServiceType) {
	int grammarID = 341;
	int done = 0;
	
	init_iso1SelectedServiceType(iso1SelectedServiceType);
	
	while(!done) {
		switch(grammarID) {
		case 341:
			/* 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, &iso1SelectedServiceType->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 = 342;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 342:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013: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, &iso1SelectedServiceType->ParameterSetID);
							iso1SelectedServiceType->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:2013: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;
					break;
				default:
					errn = 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_iso1AC_EVSEStatusType(bitstream_t* stream, struct iso1AC_EVSEStatusType* iso1AC_EVSEStatusType) {
	int grammarID = 343;
	int done = 0;
	
	init_iso1AC_EVSEStatusType(iso1AC_EVSEStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 343:
			/* 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, &iso1AC_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 = 344;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 344:
			/* 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);
							iso1AC_EVSEStatusType->EVSENotification = (iso1EVSENotificationType) 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 = 345;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 345:
			/* 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, &iso1AC_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 = 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,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_iso1SalesTariffType(bitstream_t* stream, struct iso1SalesTariffType* iso1SalesTariffType) {
	int grammarID = 346;
	int done = 0;
	
	init_iso1SalesTariffType(iso1SalesTariffType);
	
	while(!done) {
		switch(grammarID) {
		case 346:
			/* 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, &iso1SalesTariffType->Id.charactersLen);
					if (errn == 0) {
						if (iso1SalesTariffType->Id.charactersLen >= 2) {
							iso1SalesTariffType->Id.charactersLen = (uint16_t)(iso1SalesTariffType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SalesTariffType->Id.charactersLen, iso1SalesTariffType->Id.characters, iso1SalesTariffType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SalesTariffType->Id_isUsed = 1u;
					grammarID = 347;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
							iso1SalesTariffType->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 = 348;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 347:
			/* 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));
							iso1SalesTariffType->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 = 348;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 348:
			/* 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, &iso1SalesTariffType->SalesTariffDescription.charactersLen);
							if (errn == 0) {
								if (iso1SalesTariffType->SalesTariffDescription.charactersLen >= 2) {
									iso1SalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(iso1SalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, iso1SalesTariffType->SalesTariffDescription.charactersLen, iso1SalesTariffType->SalesTariffDescription.characters, iso1SalesTariffType_SalesTariffDescription_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							iso1SalesTariffType->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 = 349;
						} 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));
							iso1SalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0);
							iso1SalesTariffType->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 = 350;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					if (iso1SalesTariffType->SalesTariffEntry.arrayLen < iso1SalesTariffType_SalesTariffEntry_ARRAY_SIZE) {
						errn = decode_iso1SalesTariffEntryType(stream, &iso1SalesTariffType->SalesTariffEntry.array[iso1SalesTariffType->SalesTariffEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 351;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 349:
			/* 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));
							iso1SalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0);
							iso1SalesTariffType->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 = 350;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (iso1SalesTariffType->SalesTariffEntry.arrayLen < iso1SalesTariffType_SalesTariffEntry_ARRAY_SIZE) {
						errn = decode_iso1SalesTariffEntryType(stream, &iso1SalesTariffType->SalesTariffEntry.array[iso1SalesTariffType->SalesTariffEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 351;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 350:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SalesTariffType->SalesTariffEntry.arrayLen < iso1SalesTariffType_SalesTariffEntry_ARRAY_SIZE) {
						errn = decode_iso1SalesTariffEntryType(stream, &iso1SalesTariffType->SalesTariffEntry.array[iso1SalesTariffType->SalesTariffEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 351;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 351:
			/* 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 (iso1SalesTariffType->SalesTariffEntry.arrayLen < iso1SalesTariffType_SalesTariffEntry_ARRAY_SIZE) {
						errn = decode_iso1SalesTariffEntryType(stream, &iso1SalesTariffType->SalesTariffEntry.array[iso1SalesTariffType->SalesTariffEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 351;
					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,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_iso1PaymentServiceSelectionReqType(bitstream_t* stream, struct iso1PaymentServiceSelectionReqType* iso1PaymentServiceSelectionReqType) {
	int grammarID = 352;
	int done = 0;
	
	init_iso1PaymentServiceSelectionReqType(iso1PaymentServiceSelectionReqType);
	
	while(!done) {
		switch(grammarID) {
		case 352:
			/* 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);
							iso1PaymentServiceSelectionReqType->SelectedPaymentOption = (iso1paymentOptionType) 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 = 353;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 353:
			/* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_iso1SelectedServiceListType(stream, &iso1PaymentServiceSelectionReqType->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#,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_iso1SignaturePropertiesType(bitstream_t* stream, struct iso1SignaturePropertiesType* iso1SignaturePropertiesType) {
	int grammarID = 354;
	int done = 0;
	
	init_iso1SignaturePropertiesType(iso1SignaturePropertiesType);
	
	while(!done) {
		switch(grammarID) {
		case 354:
			/* 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, &iso1SignaturePropertiesType->Id.charactersLen);
					if (errn == 0) {
						if (iso1SignaturePropertiesType->Id.charactersLen >= 2) {
							iso1SignaturePropertiesType->Id.charactersLen = (uint16_t)(iso1SignaturePropertiesType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignaturePropertiesType->Id.charactersLen, iso1SignaturePropertiesType->Id.characters, iso1SignaturePropertiesType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignaturePropertiesType->Id_isUsed = 1u;
					grammarID = 355;
					break;
				case 1:
					if (iso1SignaturePropertiesType->SignatureProperty.arrayLen < iso1SignaturePropertiesType_SignatureProperty_ARRAY_SIZE) {
						errn = decode_iso1SignaturePropertyType(stream, &iso1SignaturePropertiesType->SignatureProperty.array[iso1SignaturePropertiesType->SignatureProperty.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 356;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 355:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SignaturePropertiesType->SignatureProperty.arrayLen < iso1SignaturePropertiesType_SignatureProperty_ARRAY_SIZE) {
						errn = decode_iso1SignaturePropertyType(stream, &iso1SignaturePropertiesType->SignatureProperty.array[iso1SignaturePropertiesType->SignatureProperty.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 356;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 356:
			/* 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 (iso1SignaturePropertiesType->SignatureProperty.arrayLen < iso1SignaturePropertiesType_SignatureProperty_ARRAY_SIZE) {
						errn = decode_iso1SignaturePropertyType(stream, &iso1SignaturePropertiesType->SignatureProperty.array[iso1SignaturePropertiesType->SignatureProperty.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 356;
					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,BodyBaseType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_iso1BodyBaseType(bitstream_t* stream, struct iso1BodyBaseType* iso1BodyBaseType) {
	int grammarID = 34;
	int done = 0;
	
	init_iso1BodyBaseType(iso1BodyBaseType);
	
	while(!done) {
		switch(grammarID) {
		case 34:
			/* 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,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_iso1SupportedEnergyTransferModeType(bitstream_t* stream, struct iso1SupportedEnergyTransferModeType* iso1SupportedEnergyTransferModeType) {
	int grammarID = 357;
	int done = 0;
	
	init_iso1SupportedEnergyTransferModeType(iso1SupportedEnergyTransferModeType);
	
	while(!done) {
		switch(grammarID) {
		case 357:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < iso1SupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
								iso1SupportedEnergyTransferModeType->EnergyTransferMode.array[iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (iso1EnergyTransferModeType) uint32;
								iso1SupportedEnergyTransferModeType->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 = 358;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 358:
			/* 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 (iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < iso1SupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
								iso1SupportedEnergyTransferModeType->EnergyTransferMode.array[iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (iso1EnergyTransferModeType) uint32;
								iso1SupportedEnergyTransferModeType->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 = 359;
						} 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 359:
			/* 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 (iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < iso1SupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
								iso1SupportedEnergyTransferModeType->EnergyTransferMode.array[iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (iso1EnergyTransferModeType) uint32;
								iso1SupportedEnergyTransferModeType->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 = 360;
						} 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 360:
			/* 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 (iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < iso1SupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
								iso1SupportedEnergyTransferModeType->EnergyTransferMode.array[iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (iso1EnergyTransferModeType) uint32;
								iso1SupportedEnergyTransferModeType->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 = 361;
						} 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 361:
			/* 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 (iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < iso1SupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
								iso1SupportedEnergyTransferModeType->EnergyTransferMode.array[iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (iso1EnergyTransferModeType) uint32;
								iso1SupportedEnergyTransferModeType->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 = 362;
						} 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 362:
			/* 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 (iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < iso1SupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
								iso1SupportedEnergyTransferModeType->EnergyTransferMode.array[iso1SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (iso1EnergyTransferModeType) uint32;
								iso1SupportedEnergyTransferModeType->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:
			/* 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_iso1ChargingStatusReqType(bitstream_t* stream, struct iso1ChargingStatusReqType* iso1ChargingStatusReqType) {
	int grammarID = 34;
	int done = 0;
	
	init_iso1ChargingStatusReqType(iso1ChargingStatusReqType);
	
	while(!done) {
		switch(grammarID) {
		case 34:
			/* 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_iso1PaymentServiceSelectionResType(bitstream_t* stream, struct iso1PaymentServiceSelectionResType* iso1PaymentServiceSelectionResType) {
	int grammarID = 122;
	int done = 0;
	
	init_iso1PaymentServiceSelectionResType(iso1PaymentServiceSelectionResType);
	
	while(!done) {
		switch(grammarID) {
		case 122:
			/* 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);
							iso1PaymentServiceSelectionResType->ResponseCode = (iso1responseCodeType) 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#,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_iso1DigestMethodType(bitstream_t* stream, struct iso1DigestMethodType* iso1DigestMethodType) {
	int grammarID = 312;
	int done = 0;
	
	init_iso1DigestMethodType(iso1DigestMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 312:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1DigestMethodType->Algorithm.charactersLen);
					if (errn == 0) {
						if (iso1DigestMethodType->Algorithm.charactersLen >= 2) {
							iso1DigestMethodType->Algorithm.charactersLen = (uint16_t)(iso1DigestMethodType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1DigestMethodType->Algorithm.charactersLen, iso1DigestMethodType->Algorithm.characters, iso1DigestMethodType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 115;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 115:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1DigestMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1DigestMethodType->ANY.charactersLen >= 2) {
							iso1DigestMethodType->ANY.charactersLen = (uint16_t)(iso1DigestMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1DigestMethodType->ANY.charactersLen, iso1DigestMethodType->ANY.characters, iso1DigestMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1DigestMethodType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 116:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1DigestMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1DigestMethodType->ANY.charactersLen >= 2) {
							iso1DigestMethodType->ANY.charactersLen = (uint16_t)(iso1DigestMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1DigestMethodType->ANY.charactersLen, iso1DigestMethodType->ANY.characters, iso1DigestMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1DigestMethodType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = 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_iso1SignaturePropertyType(bitstream_t* stream, struct iso1SignaturePropertyType* iso1SignaturePropertyType) {
	int grammarID = 363;
	int done = 0;
	
	init_iso1SignaturePropertyType(iso1SignaturePropertyType);
	
	while(!done) {
		switch(grammarID) {
		case 363:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1SignaturePropertyType->Id.charactersLen);
					if (errn == 0) {
						if (iso1SignaturePropertyType->Id.charactersLen >= 2) {
							iso1SignaturePropertyType->Id.charactersLen = (uint16_t)(iso1SignaturePropertyType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignaturePropertyType->Id.charactersLen, iso1SignaturePropertyType->Id.characters, iso1SignaturePropertyType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignaturePropertyType->Id_isUsed = 1u;
					grammarID = 364;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1SignaturePropertyType->Target.charactersLen);
					if (errn == 0) {
						if (iso1SignaturePropertyType->Target.charactersLen >= 2) {
							iso1SignaturePropertyType->Target.charactersLen = (uint16_t)(iso1SignaturePropertyType->Target.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignaturePropertyType->Target.charactersLen, iso1SignaturePropertyType->Target.characters, iso1SignaturePropertyType_Target_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 365;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 364:
			/* StartTag[ATTRIBUTE[STRING](Target)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &iso1SignaturePropertyType->Target.charactersLen);
					if (errn == 0) {
						if (iso1SignaturePropertyType->Target.charactersLen >= 2) {
							iso1SignaturePropertyType->Target.charactersLen = (uint16_t)(iso1SignaturePropertyType->Target.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignaturePropertyType->Target.charactersLen, iso1SignaturePropertyType->Target.characters, iso1SignaturePropertyType_Target_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 365;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 365:
			/* 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 = 116;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1SignaturePropertyType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1SignaturePropertyType->ANY.charactersLen >= 2) {
							iso1SignaturePropertyType->ANY.charactersLen = (uint16_t)(iso1SignaturePropertyType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignaturePropertyType->ANY.charactersLen, iso1SignaturePropertyType->ANY.characters, iso1SignaturePropertyType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignaturePropertyType->ANY_isUsed = 1u;
					grammarID = 366;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 116:
			/* 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 = 116;
					break;
				case 1:
					done = 1;
					grammarID = 4;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &iso1SignaturePropertyType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1SignaturePropertyType->ANY.charactersLen >= 2) {
							iso1SignaturePropertyType->ANY.charactersLen = (uint16_t)(iso1SignaturePropertyType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignaturePropertyType->ANY.charactersLen, iso1SignaturePropertyType->ANY.characters, iso1SignaturePropertyType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignaturePropertyType->ANY_isUsed = 1u;
					grammarID = 116;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 366:
			/* 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 = 116;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &iso1SignaturePropertyType->ANY.charactersLen);
					if (errn == 0) {
						if (iso1SignaturePropertyType->ANY.charactersLen >= 2) {
							iso1SignaturePropertyType->ANY.charactersLen = (uint16_t)(iso1SignaturePropertyType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, iso1SignaturePropertyType->ANY.charactersLen, iso1SignaturePropertyType->ANY.characters, iso1SignaturePropertyType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					iso1SignaturePropertyType->ANY_isUsed = 1u;
					grammarID = 366;
					break;
				default:
					errn = 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_iso1PGPDataType(bitstream_t* stream, struct iso1PGPDataType* iso1PGPDataType) {
	int grammarID = 367;
	int done = 0;
	
	init_iso1PGPDataType(iso1PGPDataType);
	
	while(!done) {
		switch(grammarID) {
		case 367:
			/* 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, &iso1PGPDataType->PGPKeyID.bytesLen);
							if (errn == 0) {
								errn =  (iso1PGPDataType->PGPKeyID.bytesLen) <= iso1PGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1PGPDataType->PGPKeyID.bytesLen, iso1PGPDataType->PGPKeyID.bytes);
							}
							iso1PGPDataType->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 = 368;
						} 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, &iso1PGPDataType->PGPKeyPacket.bytesLen);
							if (errn == 0) {
								errn =  (iso1PGPDataType->PGPKeyPacket.bytesLen) <= iso1PGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1PGPDataType->PGPKeyPacket.bytesLen, iso1PGPDataType->PGPKeyPacket.bytes);
							}
							iso1PGPDataType->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 = 369;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 368:
			/* 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, &iso1PGPDataType->PGPKeyPacket.bytesLen);
							if (errn == 0) {
								errn =  (iso1PGPDataType->PGPKeyPacket.bytesLen) <= iso1PGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, iso1PGPDataType->PGPKeyPacket.bytesLen, iso1PGPDataType->PGPKeyPacket.bytes);
							}
							iso1PGPDataType->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 = 369;
						} 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 = 369;
					break;
				case 2:
					done = 1;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 369:
			/* 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 = 369;
					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;
}

int decode_iso1EXISchemaInformedElementFragmentGrammar(bitstream_t* stream, struct iso1EXISchemaInformedElementFragmentGrammar* exiElementFrag) {
	int grammarID = 370;
	int done = 0;
	
	init_iso1EXISchemaInformedElementFragmentGrammar(exiElementFrag);
	while(!done) {
		switch(grammarID) {
		case 370:
			/* First(xsi:type)(xsi:nil)StartTag[ATTRIBUTE[STRING](Algorithm), ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), ATTRIBUTE[STRING](MimeType), ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name), ATTRIBUTE[STRING](Target), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), ATTRIBUTE_GENERIC, 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_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 9, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 4:
					errn = decodeUnsignedInteger16(stream, &exiElementFrag->Id.charactersLen);
					if (errn == 0) {
						if (exiElementFrag->Id.charactersLen >= 2) {
							exiElementFrag->Id.charactersLen = (uint16_t)(exiElementFrag->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, exiElementFrag->Id.charactersLen, exiElementFrag->Id.characters, iso1exiElementFrag_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					exiElementFrag->Id_isUsed = 1u;
					grammarID = 370;
					break;
				case 255:
					done = 1;
					grammarID = 4;
					break;
				case 256:
					errn = decodeUnsignedInteger16(stream, &exiElementFrag->CHARACTERS_GENERIC.charactersLen);
					if (errn == 0) {
						if (exiElementFrag->CHARACTERS_GENERIC.charactersLen >= 2) {
							exiElementFrag->CHARACTERS_GENERIC.charactersLen = (uint16_t)(exiElementFrag->CHARACTERS_GENERIC.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, exiElementFrag->CHARACTERS_GENERIC.charactersLen, exiElementFrag->CHARACTERS_GENERIC.characters, iso1exiElementFrag_CHARACTERS_GENERIC_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					exiElementFrag->CHARACTERS_GENERIC_isUsed = 1u;
					grammarID = 371;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 371:
			/* Element[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_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 8, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 244:
					done = 1;
					grammarID = 4;
					break;
				case 245:
					errn = decodeUnsignedInteger16(stream, &exiElementFrag->CHARACTERS_GENERIC.charactersLen);
					if (errn == 0) {
						if (exiElementFrag->CHARACTERS_GENERIC.charactersLen >= 2) {
							exiElementFrag->CHARACTERS_GENERIC.charactersLen = (uint16_t)(exiElementFrag->CHARACTERS_GENERIC.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, exiElementFrag->CHARACTERS_GENERIC.charactersLen, exiElementFrag->CHARACTERS_GENERIC.characters, iso1exiElementFrag_CHARACTERS_GENERIC_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					exiElementFrag->CHARACTERS_GENERIC_isUsed = 1u;
					grammarID = 371;
					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_iso1ExiDocument(bitstream_t* stream, struct iso1EXIDocument* exiDoc) {
	errn = readEXIHeader(stream);

	if(errn == 0) {
		/* DocContent[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: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:MsgBody}BodyElement), 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: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: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:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus), 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({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Entry), 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({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#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), 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({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), 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({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}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:MsgDef}V2G_Message), 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#}X509Data), START_ELEMENT_GENERIC] */
		init_iso1EXIDocument(exiDoc);
		errn = decodeNBitUnsignedInteger(stream, 7, &eventCode);
		if(errn == 0) {
			switch(eventCode) {
			case 0:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter) */
				errn = decode_iso1AC_EVChargeParameterType(stream, &exiDoc->AC_EVChargeParameter);
				exiDoc->AC_EVChargeParameter_isUsed = 1u;
				break;
			case 1:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter) */
				errn = decode_iso1AC_EVSEChargeParameterType(stream, &exiDoc->AC_EVSEChargeParameter);
				exiDoc->AC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 2:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus) */
				errn = decode_iso1AC_EVSEStatusType(stream, &exiDoc->AC_EVSEStatus);
				exiDoc->AC_EVSEStatus_isUsed = 1u;
				break;
			case 3:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq) */
				errn = decode_iso1AuthorizationReqType(stream, &exiDoc->AuthorizationReq);
				exiDoc->AuthorizationReq_isUsed = 1u;
				break;
			case 4:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes) */
				errn = decode_iso1AuthorizationResType(stream, &exiDoc->AuthorizationRes);
				exiDoc->AuthorizationRes_isUsed = 1u;
				break;
			case 5:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement) */
				errn = decode_iso1BodyBaseType(stream, &exiDoc->BodyElement);
				exiDoc->BodyElement_isUsed = 1u;
				break;
			case 6:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq) */
				errn = decode_iso1CableCheckReqType(stream, &exiDoc->CableCheckReq);
				exiDoc->CableCheckReq_isUsed = 1u;
				break;
			case 7:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes) */
				errn = decode_iso1CableCheckResType(stream, &exiDoc->CableCheckRes);
				exiDoc->CableCheckRes_isUsed = 1u;
				break;
			case 8:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */
				errn = decode_iso1CanonicalizationMethodType(stream, &exiDoc->CanonicalizationMethod);
				exiDoc->CanonicalizationMethod_isUsed = 1u;
				break;
			case 9:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq) */
				errn = decode_iso1CertificateInstallationReqType(stream, &exiDoc->CertificateInstallationReq);
				exiDoc->CertificateInstallationReq_isUsed = 1u;
				break;
			case 10:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes) */
				errn = decode_iso1CertificateInstallationResType(stream, &exiDoc->CertificateInstallationRes);
				exiDoc->CertificateInstallationRes_isUsed = 1u;
				break;
			case 11:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq) */
				errn = decode_iso1CertificateUpdateReqType(stream, &exiDoc->CertificateUpdateReq);
				exiDoc->CertificateUpdateReq_isUsed = 1u;
				break;
			case 12:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes) */
				errn = decode_iso1CertificateUpdateResType(stream, &exiDoc->CertificateUpdateRes);
				exiDoc->CertificateUpdateRes_isUsed = 1u;
				break;
			case 13:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq) */
				errn = decode_iso1ChargeParameterDiscoveryReqType(stream, &exiDoc->ChargeParameterDiscoveryReq);
				exiDoc->ChargeParameterDiscoveryReq_isUsed = 1u;
				break;
			case 14:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes) */
				errn = decode_iso1ChargeParameterDiscoveryResType(stream, &exiDoc->ChargeParameterDiscoveryRes);
				exiDoc->ChargeParameterDiscoveryRes_isUsed = 1u;
				break;
			case 15:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq) */
				errn = decode_iso1ChargingStatusReqType(stream, &exiDoc->ChargingStatusReq);
				exiDoc->ChargingStatusReq_isUsed = 1u;
				break;
			case 16:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes) */
				errn = decode_iso1ChargingStatusResType(stream, &exiDoc->ChargingStatusRes);
				exiDoc->ChargingStatusRes_isUsed = 1u;
				break;
			case 17:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq) */
				errn = decode_iso1CurrentDemandReqType(stream, &exiDoc->CurrentDemandReq);
				exiDoc->CurrentDemandReq_isUsed = 1u;
				break;
			case 18:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes) */
				errn = decode_iso1CurrentDemandResType(stream, &exiDoc->CurrentDemandRes);
				exiDoc->CurrentDemandRes_isUsed = 1u;
				break;
			case 19:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter) */
				errn = decode_iso1DC_EVChargeParameterType(stream, &exiDoc->DC_EVChargeParameter);
				exiDoc->DC_EVChargeParameter_isUsed = 1u;
				break;
			case 20:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter) */
				errn = decode_iso1DC_EVPowerDeliveryParameterType(stream, &exiDoc->DC_EVPowerDeliveryParameter);
				exiDoc->DC_EVPowerDeliveryParameter_isUsed = 1u;
				break;
			case 21:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter) */
				errn = decode_iso1DC_EVSEChargeParameterType(stream, &exiDoc->DC_EVSEChargeParameter);
				exiDoc->DC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 22:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus) */
				errn = decode_iso1DC_EVSEStatusType(stream, &exiDoc->DC_EVSEStatus);
				exiDoc->DC_EVSEStatus_isUsed = 1u;
				break;
			case 23:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus) */
				errn = decode_iso1DC_EVStatusType(stream, &exiDoc->DC_EVStatus);
				exiDoc->DC_EVStatus_isUsed = 1u;
				break;
			case 24:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */
				errn = decode_iso1DSAKeyValueType(stream, &exiDoc->DSAKeyValue);
				exiDoc->DSAKeyValue_isUsed = 1u;
				break;
			case 25:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */
				errn = decode_iso1DigestMethodType(stream, &exiDoc->DigestMethod);
				exiDoc->DigestMethod_isUsed = 1u;
				break;
			case 26:
				/* 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) <= iso1EXIDocument_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 27:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter) */
				errn = decode_iso1EVChargeParameterType(stream, &exiDoc->EVChargeParameter);
				exiDoc->EVChargeParameter_isUsed = 1u;
				break;
			case 28:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter) */
				errn = decode_iso1EVPowerDeliveryParameterType(stream, &exiDoc->EVPowerDeliveryParameter);
				exiDoc->EVPowerDeliveryParameter_isUsed = 1u;
				break;
			case 29:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter) */
				errn = decode_iso1EVSEChargeParameterType(stream, &exiDoc->EVSEChargeParameter);
				exiDoc->EVSEChargeParameter_isUsed = 1u;
				break;
			case 30:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus) */
				errn = decode_iso1EVSEStatusType(stream, &exiDoc->EVSEStatus);
				exiDoc->EVSEStatus_isUsed = 1u;
				break;
			case 31:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVStatus) */
				errn = decode_iso1EVStatusType(stream, &exiDoc->EVStatus);
				exiDoc->EVStatus_isUsed = 1u;
				break;
			case 32:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Entry) */
				errn = decode_iso1EntryType(stream, &exiDoc->Entry);
				exiDoc->Entry_isUsed = 1u;
				break;
			case 33:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */
				errn = decode_iso1KeyInfoType(stream, &exiDoc->KeyInfo);
				exiDoc->KeyInfo_isUsed = 1u;
				break;
			case 34:
				/* 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) {
							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, iso1EXIDocument_KeyName_CHARACTERS_SIZE);
							} 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 35:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */
				errn = decode_iso1KeyValueType(stream, &exiDoc->KeyValue);
				exiDoc->KeyValue_isUsed = 1u;
				break;
			case 36:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */
				errn = decode_iso1ManifestType(stream, &exiDoc->Manifest);
				exiDoc->Manifest_isUsed = 1u;
				break;
			case 37:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq) */
				errn = decode_iso1MeteringReceiptReqType(stream, &exiDoc->MeteringReceiptReq);
				exiDoc->MeteringReceiptReq_isUsed = 1u;
				break;
			case 38:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes) */
				errn = decode_iso1MeteringReceiptResType(stream, &exiDoc->MeteringReceiptRes);
				exiDoc->MeteringReceiptRes_isUsed = 1u;
				break;
			case 39:
				/* 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) {
							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, iso1EXIDocument_MgmtData_CHARACTERS_SIZE);
							} 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 40:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */
				errn = decode_iso1ObjectType(stream, &exiDoc->Object);
				exiDoc->Object_isUsed = 1u;
				break;
			case 41:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */
				errn = decode_iso1PGPDataType(stream, &exiDoc->PGPData);
				exiDoc->PGPData_isUsed = 1u;
				break;
			case 42:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry) */
				errn = decode_iso1PMaxScheduleEntryType(stream, &exiDoc->PMaxScheduleEntry);
				exiDoc->PMaxScheduleEntry_isUsed = 1u;
				break;
			case 43:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq) */
				errn = decode_iso1PaymentDetailsReqType(stream, &exiDoc->PaymentDetailsReq);
				exiDoc->PaymentDetailsReq_isUsed = 1u;
				break;
			case 44:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes) */
				errn = decode_iso1PaymentDetailsResType(stream, &exiDoc->PaymentDetailsRes);
				exiDoc->PaymentDetailsRes_isUsed = 1u;
				break;
			case 45:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq) */
				errn = decode_iso1PaymentServiceSelectionReqType(stream, &exiDoc->PaymentServiceSelectionReq);
				exiDoc->PaymentServiceSelectionReq_isUsed = 1u;
				break;
			case 46:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes) */
				errn = decode_iso1PaymentServiceSelectionResType(stream, &exiDoc->PaymentServiceSelectionRes);
				exiDoc->PaymentServiceSelectionRes_isUsed = 1u;
				break;
			case 47:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq) */
				errn = decode_iso1PowerDeliveryReqType(stream, &exiDoc->PowerDeliveryReq);
				exiDoc->PowerDeliveryReq_isUsed = 1u;
				break;
			case 48:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes) */
				errn = decode_iso1PowerDeliveryResType(stream, &exiDoc->PowerDeliveryRes);
				exiDoc->PowerDeliveryRes_isUsed = 1u;
				break;
			case 49:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq) */
				errn = decode_iso1PreChargeReqType(stream, &exiDoc->PreChargeReq);
				exiDoc->PreChargeReq_isUsed = 1u;
				break;
			case 50:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes) */
				errn = decode_iso1PreChargeResType(stream, &exiDoc->PreChargeRes);
				exiDoc->PreChargeRes_isUsed = 1u;
				break;
			case 51:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */
				errn = decode_iso1RSAKeyValueType(stream, &exiDoc->RSAKeyValue);
				exiDoc->RSAKeyValue_isUsed = 1u;
				break;
			case 52:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */
				errn = decode_iso1ReferenceType(stream, &exiDoc->Reference);
				exiDoc->Reference_isUsed = 1u;
				break;
			case 53:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval) */
				errn = decode_iso1RelativeTimeIntervalType(stream, &exiDoc->RelativeTimeInterval);
				exiDoc->RelativeTimeInterval_isUsed = 1u;
				break;
			case 54:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */
				errn = decode_iso1RetrievalMethodType(stream, &exiDoc->RetrievalMethod);
				exiDoc->RetrievalMethod_isUsed = 1u;
				break;
			case 55:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList) */
				errn = decode_iso1SAScheduleListType(stream, &exiDoc->SAScheduleList);
				exiDoc->SAScheduleList_isUsed = 1u;
				break;
			case 56:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules) */
				errn = decode_iso1SASchedulesType(stream, &exiDoc->SASchedules);
				exiDoc->SASchedules_isUsed = 1u;
				break;
			case 57:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */
				errn = decode_iso1SPKIDataType(stream, &exiDoc->SPKIData);
				exiDoc->SPKIData_isUsed = 1u;
				break;
			case 58:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry) */
				errn = decode_iso1SalesTariffEntryType(stream, &exiDoc->SalesTariffEntry);
				exiDoc->SalesTariffEntry_isUsed = 1u;
				break;
			case 59:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq) */
				errn = decode_iso1ServiceDetailReqType(stream, &exiDoc->ServiceDetailReq);
				exiDoc->ServiceDetailReq_isUsed = 1u;
				break;
			case 60:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes) */
				errn = decode_iso1ServiceDetailResType(stream, &exiDoc->ServiceDetailRes);
				exiDoc->ServiceDetailRes_isUsed = 1u;
				break;
			case 61:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq) */
				errn = decode_iso1ServiceDiscoveryReqType(stream, &exiDoc->ServiceDiscoveryReq);
				exiDoc->ServiceDiscoveryReq_isUsed = 1u;
				break;
			case 62:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes) */
				errn = decode_iso1ServiceDiscoveryResType(stream, &exiDoc->ServiceDiscoveryRes);
				exiDoc->ServiceDiscoveryRes_isUsed = 1u;
				break;
			case 63:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq) */
				errn = decode_iso1SessionSetupReqType(stream, &exiDoc->SessionSetupReq);
				exiDoc->SessionSetupReq_isUsed = 1u;
				break;
			case 64:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes) */
				errn = decode_iso1SessionSetupResType(stream, &exiDoc->SessionSetupRes);
				exiDoc->SessionSetupRes_isUsed = 1u;
				break;
			case 65:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq) */
				errn = decode_iso1SessionStopReqType(stream, &exiDoc->SessionStopReq);
				exiDoc->SessionStopReq_isUsed = 1u;
				break;
			case 66:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes) */
				errn = decode_iso1SessionStopResType(stream, &exiDoc->SessionStopRes);
				exiDoc->SessionStopRes_isUsed = 1u;
				break;
			case 67:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */
				errn = decode_iso1SignatureType(stream, &exiDoc->Signature);
				exiDoc->Signature_isUsed = 1u;
				break;
			case 68:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */
				errn = decode_iso1SignatureMethodType(stream, &exiDoc->SignatureMethod);
				exiDoc->SignatureMethod_isUsed = 1u;
				break;
			case 69:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */
				errn = decode_iso1SignaturePropertiesType(stream, &exiDoc->SignatureProperties);
				exiDoc->SignatureProperties_isUsed = 1u;
				break;
			case 70:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */
				errn = decode_iso1SignaturePropertyType(stream, &exiDoc->SignatureProperty);
				exiDoc->SignatureProperty_isUsed = 1u;
				break;
			case 71:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */
				errn = decode_iso1SignatureValueType(stream, &exiDoc->SignatureValue);
				exiDoc->SignatureValue_isUsed = 1u;
				break;
			case 72:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */
				errn = decode_iso1SignedInfoType(stream, &exiDoc->SignedInfo);
				exiDoc->SignedInfo_isUsed = 1u;
				break;
			case 73:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval) */
				errn = decode_iso1IntervalType(stream, &exiDoc->TimeInterval);
				exiDoc->TimeInterval_isUsed = 1u;
				break;
			case 74:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */
				errn = decode_iso1TransformType(stream, &exiDoc->Transform);
				exiDoc->Transform_isUsed = 1u;
				break;
			case 75:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */
				errn = decode_iso1TransformsType(stream, &exiDoc->Transforms);
				exiDoc->Transforms_isUsed = 1u;
				break;
			case 76:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}V2G_Message) */
				errn = decode_iso1AnonType_V2G_Message(stream, &exiDoc->V2G_Message);
				exiDoc->V2G_Message_isUsed = 1u;
				break;
			case 77:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq) */
				errn = decode_iso1WeldingDetectionReqType(stream, &exiDoc->WeldingDetectionReq);
				exiDoc->WeldingDetectionReq_isUsed = 1u;
				break;
			case 78:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes) */
				errn = decode_iso1WeldingDetectionResType(stream, &exiDoc->WeldingDetectionRes);
				exiDoc->WeldingDetectionRes_isUsed = 1u;
				break;
			case 79:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */
				errn = decode_iso1X509DataType(stream, &exiDoc->X509Data);
				exiDoc->X509Data_isUsed = 1u;
				break;
			default:
				errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
				break;
			}
		}

	}

	(void)exiDoc; /* avoid unused warning */
	(void)eventCode; /* avoid unused warning */
	(void)uint32; /* avoid unused warning */

	return errn;
}

#if DEPLOY_ISO1_CODEC_FRAGMENT == SUPPORT_YES
int decode_iso1ExiFragment(bitstream_t* stream, struct iso1EXIFragment* 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_iso1EXIFragment(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_iso1AC_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_iso1AC_EVSEChargeParameterType(stream, &exiFrag->AC_EVSEChargeParameter);
				exiFrag->AC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 2:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus) */
				errn = decode_iso1AC_EVSEStatusType(stream, &exiFrag->AC_EVSEStatus);
				exiFrag->AC_EVSEStatus_isUsed = 1u;
				break;
			case 3:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus) */
				errn = decode_iso1AC_EVSEStatusType(stream, &exiFrag->AC_EVSEStatus);
				exiFrag->AC_EVSEStatus_isUsed = 1u;
				break;
			case 4:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq) */
				errn = decode_iso1AuthorizationReqType(stream, &exiFrag->AuthorizationReq);
				exiFrag->AuthorizationReq_isUsed = 1u;
				break;
			case 5:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes) */
				errn = decode_iso1AuthorizationResType(stream, &exiFrag->AuthorizationRes);
				exiFrag->AuthorizationRes_isUsed = 1u;
				break;
			case 6:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body) */
				errn = decode_iso1BodyType(stream, &exiFrag->Body);
				exiFrag->Body_isUsed = 1u;
				break;
			case 7:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement) */
				errn = decode_iso1BodyBaseType(stream, &exiFrag->BodyElement);
				exiFrag->BodyElement_isUsed = 1u;
				break;
			case 8:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->BulkChargingComplete);
						exiFrag->BulkChargingComplete_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:2013:MsgDataTypes}BulkChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->BulkChargingComplete);
						exiFrag->BulkChargingComplete_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				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_iso1CableCheckReqType(stream, &exiFrag->CableCheckReq);
				exiFrag->CableCheckReq_isUsed = 1u;
				break;
			case 12:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes) */
				errn = decode_iso1CableCheckResType(stream, &exiFrag->CableCheckRes);
				exiFrag->CableCheckRes_isUsed = 1u;
				break;
			case 13:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */
				errn = decode_iso1CanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod);
				exiFrag->CanonicalizationMethod_isUsed = 1u;
				break;
			case 14:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->Certificate.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->Certificate.bytesLen) <= iso1EXIFragment_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->Certificate.bytesLen, exiFrag->Certificate.bytes);
						}
						exiFrag->Certificate_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 15:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq) */
				errn = decode_iso1CertificateInstallationReqType(stream, &exiFrag->CertificateInstallationReq);
				exiFrag->CertificateInstallationReq_isUsed = 1u;
				break;
			case 16:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes) */
				errn = decode_iso1CertificateInstallationResType(stream, &exiFrag->CertificateInstallationRes);
				exiFrag->CertificateInstallationRes_isUsed = 1u;
				break;
			case 17:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq) */
				errn = decode_iso1CertificateUpdateReqType(stream, &exiFrag->CertificateUpdateReq);
				exiFrag->CertificateUpdateReq_isUsed = 1u;
				break;
			case 18:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes) */
				errn = decode_iso1CertificateUpdateResType(stream, &exiFrag->CertificateUpdateRes);
				exiFrag->CertificateUpdateRes_isUsed = 1u;
				break;
			case 19:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq) */
				errn = decode_iso1ChargeParameterDiscoveryReqType(stream, &exiFrag->ChargeParameterDiscoveryReq);
				exiFrag->ChargeParameterDiscoveryReq_isUsed = 1u;
				break;
			case 20:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes) */
				errn = decode_iso1ChargeParameterDiscoveryResType(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 = (iso1chargeProgressType) 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_iso1ChargeServiceType(stream, &exiFrag->ChargeService);
				exiFrag->ChargeService_isUsed = 1u;
				break;
			case 23:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->ChargingComplete);
						exiFrag->ChargingComplete_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:2013:MsgDataTypes}ChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->ChargingComplete);
						exiFrag->ChargingComplete_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:2013:MsgBody}ChargingProfile) */
				errn = decode_iso1ChargingProfileType(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_iso1PhysicalValueType(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 = (iso1chargingSessionType) 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_iso1ChargingStatusReqType(stream, &exiFrag->ChargingStatusReq);
				exiFrag->ChargingStatusReq_isUsed = 1u;
				break;
			case 31:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes) */
				errn = decode_iso1ChargingStatusResType(stream, &exiFrag->ChargingStatusRes);
				exiFrag->ChargingStatusRes_isUsed = 1u;
				break;
			case 32:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost) */
				errn = decode_iso1ConsumptionCostType(stream, &exiFrag->ConsumptionCost);
				exiFrag->ConsumptionCost_isUsed = 1u;
				break;
			case 33:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain) */
				errn = decode_iso1CertificateChainType(stream, &exiFrag->ContractSignatureCertChain);
				exiFrag->ContractSignatureCertChain_isUsed = 1u;
				break;
			case 34:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey) */
				errn = decode_iso1ContractSignatureEncryptedPrivateKeyType(stream, &exiFrag->ContractSignatureEncryptedPrivateKey);
				exiFrag->ContractSignatureEncryptedPrivateKey_isUsed = 1u;
				break;
			case 35:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost) */
				errn = decode_iso1CostType(stream, &exiFrag->Cost);
				exiFrag->Cost_isUsed = 1u;
				break;
			case 36:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq) */
				errn = decode_iso1CurrentDemandReqType(stream, &exiFrag->CurrentDemandReq);
				exiFrag->CurrentDemandReq_isUsed = 1u;
				break;
			case 37:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes) */
				errn = decode_iso1CurrentDemandResType(stream, &exiFrag->CurrentDemandRes);
				exiFrag->CurrentDemandRes_isUsed = 1u;
				break;
			case 38:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter) */
				errn = decode_iso1DC_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_iso1DC_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_iso1DC_EVSEChargeParameterType(stream, &exiFrag->DC_EVSEChargeParameter);
				exiFrag->DC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 41:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus) */
				errn = decode_iso1DC_EVSEStatusType(stream, &exiFrag->DC_EVSEStatus);
				exiFrag->DC_EVSEStatus_isUsed = 1u;
				break;
			case 42:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus) */
				errn = decode_iso1DC_EVSEStatusType(stream, &exiFrag->DC_EVSEStatus);
				exiFrag->DC_EVSEStatus_isUsed = 1u;
				break;
			case 43:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus) */
				errn = decode_iso1DC_EVStatusType(stream, &exiFrag->DC_EVStatus);
				exiFrag->DC_EVStatus_isUsed = 1u;
				break;
			case 44:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus) */
				errn = decode_iso1DC_EVStatusType(stream, &exiFrag->DC_EVStatus);
				exiFrag->DC_EVStatus_isUsed = 1u;
				break;
			case 45:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey) */
				errn = decode_iso1DiffieHellmanPublickeyType(stream, &exiFrag->DHpublickey);
				exiFrag->DHpublickey_isUsed = 1u;
				break;
			case 46:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */
				errn = decode_iso1DSAKeyValueType(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_iso1DigestMethodType(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) <= iso1EXIFragment_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_iso1PhysicalValueType(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) <= iso1EXIFragment_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_iso1EVChargeParameterType(stream, &exiFrag->EVChargeParameter);
				exiFrag->EVChargeParameter_isUsed = 1u;
				break;
			case 54:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVEnergyCapacity);
				exiFrag->EVEnergyCapacity_isUsed = 1u;
				break;
			case 55:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest) */
				errn = decode_iso1PhysicalValueType(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 = (iso1DC_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_iso1PhysicalValueType(stream, &exiFrag->EVMaxCurrent);
				exiFrag->EVMaxCurrent_isUsed = 1u;
				break;
			case 58:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMaxVoltage);
				exiFrag->EVMaxVoltage_isUsed = 1u;
				break;
			case 59:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMaximumCurrentLimit);
				exiFrag->EVMaximumCurrentLimit_isUsed = 1u;
				break;
			case 60:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMaximumCurrentLimit);
				exiFrag->EVMaximumCurrentLimit_isUsed = 1u;
				break;
			case 61:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMaximumPowerLimit);
				exiFrag->EVMaximumPowerLimit_isUsed = 1u;
				break;
			case 62:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMaximumPowerLimit);
				exiFrag->EVMaximumPowerLimit_isUsed = 1u;
				break;
			case 63:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMaximumVoltageLimit);
				exiFrag->EVMaximumVoltageLimit_isUsed = 1u;
				break;
			case 64:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMaximumVoltageLimit);
				exiFrag->EVMaximumVoltageLimit_isUsed = 1u;
				break;
			case 65:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVMinCurrent);
				exiFrag->EVMinCurrent_isUsed = 1u;
				break;
			case 66:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter) */
				errn = decode_iso1EVPowerDeliveryParameterType(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_iso1EVSEChargeParameterType(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_iso1PhysicalValueType(stream, &exiFrag->EVSECurrentRegulationTolerance);
				exiFrag->EVSECurrentRegulationTolerance_isUsed = 1u;
				break;
			case 72:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEEnergyToBeDelivered);
				exiFrag->EVSEEnergyToBeDelivered_isUsed = 1u;
				break;
			case 73:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->EVSEID.charactersLen);
						if (errn == 0) {
							if (exiFrag->EVSEID.charactersLen >= 2) {
								exiFrag->EVSEID.charactersLen = (uint16_t)(exiFrag->EVSEID.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->EVSEID.charactersLen, exiFrag->EVSEID.characters, iso1EXIFragment_EVSEID_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->EVSEID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				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 = (iso1isolationLevelType) 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 = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaxCurrent);
				exiFrag->EVSEMaxCurrent_isUsed = 1u;
				break;
			case 76:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaxCurrent);
				exiFrag->EVSEMaxCurrent_isUsed = 1u;
				break;
			case 77:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaximumCurrentLimit);
				exiFrag->EVSEMaximumCurrentLimit_isUsed = 1u;
				break;
			case 78:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaximumCurrentLimit);
				exiFrag->EVSEMaximumCurrentLimit_isUsed = 1u;
				break;
			case 79:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaximumPowerLimit);
				exiFrag->EVSEMaximumPowerLimit_isUsed = 1u;
				break;
			case 80:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaximumPowerLimit);
				exiFrag->EVSEMaximumPowerLimit_isUsed = 1u;
				break;
			case 81:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaximumVoltageLimit);
				exiFrag->EVSEMaximumVoltageLimit_isUsed = 1u;
				break;
			case 82:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMaximumVoltageLimit);
				exiFrag->EVSEMaximumVoltageLimit_isUsed = 1u;
				break;
			case 83:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMinimumCurrentLimit);
				exiFrag->EVSEMinimumCurrentLimit_isUsed = 1u;
				break;
			case 84:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEMinimumVoltageLimit);
				exiFrag->EVSEMinimumVoltageLimit_isUsed = 1u;
				break;
			case 85:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage) */
				errn = decode_iso1PhysicalValueType(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 = (iso1EVSENotificationType) 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_iso1PhysicalValueType(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_iso1PhysicalValueType(stream, &exiFrag->EVSEPresentCurrent);
				exiFrag->EVSEPresentCurrent_isUsed = 1u;
				break;
			case 90:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVSEPresentVoltage);
				exiFrag->EVSEPresentVoltage_isUsed = 1u;
				break;
			case 91:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->EVSEProcessing = (iso1EVSEProcessingType) uint32;
						exiFrag->EVSEProcessing_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:2013:MsgDataTypes}EVSEStatus) */
				errn = decode_iso1EVSEStatusType(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 = (iso1DC_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) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger64(stream, &exiFrag->EVSETimeStamp);
						exiFrag->EVSETimeStamp_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				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_iso1EVStatusType(stream, &exiFrag->EVStatus);
				exiFrag->EVStatus_isUsed = 1u;
				break;
			case 97:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVTargetCurrent);
				exiFrag->EVTargetCurrent_isUsed = 1u;
				break;
			case 98:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->EVTargetVoltage);
				exiFrag->EVTargetVoltage_isUsed = 1u;
				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 = (iso1EnergyTransferModeType) 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_iso1EntryType(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) <= iso1EXIFragment_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 = (iso1faultCodeType) 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) {
							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, iso1EXIFragment_FaultMsg_CHARACTERS_SIZE);
							} 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) <= iso1EXIFragment_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) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->GenChallenge.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->GenChallenge.bytesLen) <= iso1EXIFragment_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->GenChallenge.bytesLen, exiFrag->GenChallenge.bytes);
						}
						exiFrag->GenChallenge_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#}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_iso1MessageHeaderType(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) <= iso1EXIFragment_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_iso1KeyInfoType(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) {
							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, iso1EXIFragment_KeyName_CHARACTERS_SIZE);
							} 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_iso1KeyValueType(stream, &exiFrag->KeyValue);
				exiFrag->KeyValue_isUsed = 1u;
				break;
			case 114:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs) */
				errn = decode_iso1ListOfRootCertificateIDsType(stream, &exiFrag->ListOfRootCertificateIDs);
				exiFrag->ListOfRootCertificateIDs_isUsed = 1u;
				break;
			case 115:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */
				errn = decode_iso1ManifestType(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) {
							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, iso1EXIFragment_MeterID_CHARACTERS_SIZE);
							} 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 = decode_iso1MeterInfoType(stream, &exiFrag->MeterInfo);
				exiFrag->MeterInfo_isUsed = 1u;
				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_iso1MeteringReceiptReqType(stream, &exiFrag->MeteringReceiptReq);
				exiFrag->MeteringReceiptReq_isUsed = 1u;
				break;
			case 122:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes) */
				errn = decode_iso1MeteringReceiptResType(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) {
							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, iso1EXIFragment_MgmtData_CHARACTERS_SIZE);
							} 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) <= iso1EXIFragment_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_iso1NotificationType(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) <= iso1EXIFragment_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_iso1ObjectType(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) <= iso1EXIFragment_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_iso1PGPDataType(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) <= iso1EXIFragment_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) */
				/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->PGPKeyPacket.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->PGPKeyPacket.bytesLen) <= iso1EXIFragment_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->PGPKeyPacket.bytesLen, exiFrag->PGPKeyPacket.bytes);
						}
						exiFrag->PGPKeyPacket_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 135:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->PMax);
				exiFrag->PMax_isUsed = 1u;
				break;
			case 136:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule) */
				errn = decode_iso1PMaxScheduleType(stream, &exiFrag->PMaxSchedule);
				exiFrag->PMaxSchedule_isUsed = 1u;
				break;
			case 137:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry) */
				errn = decode_iso1PMaxScheduleEntryType(stream, &exiFrag->PMaxScheduleEntry);
				exiFrag->PMaxScheduleEntry_isUsed = 1u;
				break;
			case 138:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter) */
				errn = decode_iso1ParameterType(stream, &exiFrag->Parameter);
				exiFrag->Parameter_isUsed = 1u;
				break;
			case 139:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet) */
				errn = decode_iso1ParameterSetType(stream, &exiFrag->ParameterSet);
				exiFrag->ParameterSet_isUsed = 1u;
				break;
			case 140:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->ParameterSetID);
						exiFrag->ParameterSetID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 141:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq) */
				errn = decode_iso1PaymentDetailsReqType(stream, &exiFrag->PaymentDetailsReq);
				exiFrag->PaymentDetailsReq_isUsed = 1u;
				break;
			case 142:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes) */
				errn = decode_iso1PaymentDetailsResType(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 = (iso1paymentOptionType) 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_iso1PaymentOptionListType(stream, &exiFrag->PaymentOptionList);
				exiFrag->PaymentOptionList_isUsed = 1u;
				break;
			case 145:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq) */
				errn = decode_iso1PaymentServiceSelectionReqType(stream, &exiFrag->PaymentServiceSelectionReq);
				exiFrag->PaymentServiceSelectionReq_isUsed = 1u;
				break;
			case 146:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes) */
				errn = decode_iso1PaymentServiceSelectionResType(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) <= iso1EXIFragment_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_iso1PowerDeliveryReqType(stream, &exiFrag->PowerDeliveryReq);
				exiFrag->PowerDeliveryReq_isUsed = 1u;
				break;
			case 149:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes) */
				errn = decode_iso1PowerDeliveryResType(stream, &exiFrag->PowerDeliveryRes);
				exiFrag->PowerDeliveryRes_isUsed = 1u;
				break;
			case 150:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq) */
				errn = decode_iso1PreChargeReqType(stream, &exiFrag->PreChargeReq);
				exiFrag->PreChargeReq_isUsed = 1u;
				break;
			case 151:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes) */
				errn = decode_iso1PreChargeResType(stream, &exiFrag->PreChargeRes);
				exiFrag->PreChargeRes_isUsed = 1u;
				break;
			case 152:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry) */
				errn = decode_iso1ProfileEntryType(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) <= iso1EXIFragment_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_iso1RSAKeyValueType(stream, &exiFrag->RSAKeyValue);
				exiFrag->RSAKeyValue_isUsed = 1u;
				break;
			case 156:
				/* START_ELEMENT({urn:iso:15118:2:2013: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 157:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */
				errn = decode_iso1ReferenceType(stream, &exiFrag->Reference);
				exiFrag->Reference_isUsed = 1u;
				break;
			case 158:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval) */
				errn = decode_iso1RelativeTimeIntervalType(stream, &exiFrag->RelativeTimeInterval);
				exiFrag->RelativeTimeInterval_isUsed = 1u;
				break;
			case 159:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC) */
				errn = decode_iso1PhysicalValueType(stream, &exiFrag->RemainingTimeToBulkSoC);
				exiFrag->RemainingTimeToBulkSoC_isUsed = 1u;
				break;
			case 160:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC) */
				errn = decode_iso1PhysicalValueType(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 = (iso1EnergyTransferModeType) 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) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
						exiFrag->ResponseCode = (iso1responseCodeType) uint32;
						exiFrag->ResponseCode_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 163:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */
				errn = decode_iso1RetrievalMethodType(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_iso1X509IssuerSerialType(stream, &exiFrag->RootCertificateID);
				exiFrag->RootCertificateID_isUsed = 1u;
				break;
			case 166:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain) */
				errn = decode_iso1CertificateChainType(stream, &exiFrag->SAProvisioningCertificateChain);
				exiFrag->SAProvisioningCertificateChain_isUsed = 1u;
				break;
			case 167:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList) */
				errn = decode_iso1SAScheduleListType(stream, &exiFrag->SAScheduleList);
				exiFrag->SAScheduleList_isUsed = 1u;
				break;
			case 168:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple) */
				errn = decode_iso1SAScheduleTupleType(stream, &exiFrag->SAScheduleTuple);
				exiFrag->SAScheduleTuple_isUsed = 1u;
				break;
			case 169:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
						exiFrag->SAScheduleTupleID = (uint8_t)(uint32 + 1);
						exiFrag->SAScheduleTupleID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 170:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
						exiFrag->SAScheduleTupleID = (uint8_t)(uint32 + 1);
						exiFrag->SAScheduleTupleID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 171:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules) */
				errn = decode_iso1SASchedulesType(stream, &exiFrag->SASchedules);
				exiFrag->SASchedules_isUsed = 1u;
				break;
			case 172:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */
				errn = decode_iso1SPKIDataType(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) <= iso1EXIFragment_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_iso1SalesTariffType(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) {
							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, iso1EXIFragment_SalesTariffDescription_CHARACTERS_SIZE);
							} 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_iso1SalesTariffEntryType(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) <= iso1EXIFragment_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 = (iso1paymentOptionType) 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_iso1SelectedServiceType(stream, &exiFrag->SelectedService);
				exiFrag->SelectedService_isUsed = 1u;
				break;
			case 181:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList) */
				errn = decode_iso1SelectedServiceListType(stream, &exiFrag->SelectedServiceList);
				exiFrag->SelectedServiceList_isUsed = 1u;
				break;
			case 182:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service) */
				errn = decode_iso1ServiceType(stream, &exiFrag->Service);
				exiFrag->Service_isUsed = 1u;
				break;
			case 183:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->ServiceCategory = (iso1serviceCategoryType) uint32;
						exiFrag->ServiceCategory_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 184:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->ServiceCategory = (iso1serviceCategoryType) uint32;
						exiFrag->ServiceCategory_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 185:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq) */
				errn = decode_iso1ServiceDetailReqType(stream, &exiFrag->ServiceDetailReq);
				exiFrag->ServiceDetailReq_isUsed = 1u;
				break;
			case 186:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes) */
				errn = decode_iso1ServiceDetailResType(stream, &exiFrag->ServiceDetailRes);
				exiFrag->ServiceDetailRes_isUsed = 1u;
				break;
			case 187:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq) */
				errn = decode_iso1ServiceDiscoveryReqType(stream, &exiFrag->ServiceDiscoveryReq);
				exiFrag->ServiceDiscoveryReq_isUsed = 1u;
				break;
			case 188:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes) */
				errn = decode_iso1ServiceDiscoveryResType(stream, &exiFrag->ServiceDiscoveryRes);
				exiFrag->ServiceDiscoveryRes_isUsed = 1u;
				break;
			case 189:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) */
				/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceID);
						exiFrag->ServiceID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 190:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) */
				/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceID);
						exiFrag->ServiceID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 191:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList) */
				errn = decode_iso1ServiceListType(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) {
							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, iso1EXIFragment_ServiceName_CHARACTERS_SIZE);
							} 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_iso1ServiceParameterListType(stream, &exiFrag->ServiceParameterList);
				exiFrag->ServiceParameterList_isUsed = 1u;
				break;
			case 194:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceScope.charactersLen);
						if (errn == 0) {
							if (exiFrag->ServiceScope.charactersLen >= 2) {
								exiFrag->ServiceScope.charactersLen = (uint16_t)(exiFrag->ServiceScope.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->ServiceScope.charactersLen, exiFrag->ServiceScope.characters, iso1EXIFragment_ServiceScope_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->ServiceScope_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 195:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceScope.charactersLen);
						if (errn == 0) {
							if (exiFrag->ServiceScope.charactersLen >= 2) {
								exiFrag->ServiceScope.charactersLen = (uint16_t)(exiFrag->ServiceScope.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->ServiceScope.charactersLen, exiFrag->ServiceScope.characters, iso1EXIFragment_ServiceScope_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->ServiceScope_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 196:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID) */
				/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->SessionID.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->SessionID.bytesLen) <= iso1EXIFragment_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->SessionID.bytesLen, exiFrag->SessionID.bytes);
						}
						exiFrag->SessionID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 197:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) */
				/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->SessionID.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->SessionID.bytesLen) <= iso1EXIFragment_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->SessionID.bytesLen, exiFrag->SessionID.bytes);
						}
						exiFrag->SessionID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 198:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq) */
				errn = decode_iso1SessionSetupReqType(stream, &exiFrag->SessionSetupReq);
				exiFrag->SessionSetupReq_isUsed = 1u;
				break;
			case 199:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes) */
				errn = decode_iso1SessionSetupResType(stream, &exiFrag->SessionSetupRes);
				exiFrag->SessionSetupRes_isUsed = 1u;
				break;
			case 200:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq) */
				errn = decode_iso1SessionStopReqType(stream, &exiFrag->SessionStopReq);
				exiFrag->SessionStopReq_isUsed = 1u;
				break;
			case 201:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes) */
				errn = decode_iso1SessionStopResType(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) <= iso1EXIFragment_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_iso1SignatureType(stream, &exiFrag->Signature);
				exiFrag->Signature_isUsed = 1u;
				break;
			case 204:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */
				errn = decode_iso1SignatureMethodType(stream, &exiFrag->SignatureMethod);
				exiFrag->SignatureMethod_isUsed = 1u;
				break;
			case 205:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */
				errn = decode_iso1SignaturePropertiesType(stream, &exiFrag->SignatureProperties);
				exiFrag->SignatureProperties_isUsed = 1u;
				break;
			case 206:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */
				errn = decode_iso1SignaturePropertyType(stream, &exiFrag->SignatureProperty);
				exiFrag->SignatureProperty_isUsed = 1u;
				break;
			case 207:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */
				errn = decode_iso1SignatureValueType(stream, &exiFrag->SignatureValue);
				exiFrag->SignatureValue_isUsed = 1u;
				break;
			case 208:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */
				errn = decode_iso1SignedInfoType(stream, &exiFrag->SignedInfo);
				exiFrag->SignedInfo_isUsed = 1u;
				break;
			case 209:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates) */
				errn = decode_iso1SubCertificatesType(stream, &exiFrag->SubCertificates);
				exiFrag->SubCertificates_isUsed = 1u;
				break;
			case 210:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode) */
				errn = decode_iso1SupportedEnergyTransferModeType(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_iso1IntervalType(stream, &exiFrag->TimeInterval);
				exiFrag->TimeInterval_isUsed = 1u;
				break;
			case 213:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */
				errn = decode_iso1TransformType(stream, &exiFrag->Transform);
				exiFrag->Transform_isUsed = 1u;
				break;
			case 214:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */
				errn = decode_iso1TransformsType(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 = (iso1unitSymbolType) 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_iso1AnonType_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_iso1WeldingDetectionReqType(stream, &exiFrag->WeldingDetectionReq);
				exiFrag->WeldingDetectionReq_isUsed = 1u;
				break;
			case 219:
				/* START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes) */
				errn = decode_iso1WeldingDetectionResType(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) <= iso1EXIFragment_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) <= iso1EXIFragment_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_iso1X509DataType(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) {
							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, iso1EXIFragment_X509IssuerName_CHARACTERS_SIZE);
							} 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_iso1X509IssuerSerialType(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) <= iso1EXIFragment_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) {
							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, iso1EXIFragment_X509SubjectName_CHARACTERS_SIZE);
							} 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) {
							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, iso1EXIFragment_XPath_CHARACTERS_SIZE);
							} 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) <= iso1EXIFragment_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 = (iso1costKindType) 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 = decode_iso1EXISchemaInformedElementFragmentGrammar(stream, &exiFrag->eMAID);
				exiFrag->eMAID_isUsed = 1u;
				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_iso1PhysicalValueType(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_iso1PhysicalValueType(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) {
							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, iso1EXIFragment_stringValue_CHARACTERS_SIZE);
							} 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;
			}
		}

	}

	(void)exiFrag; /* avoid unused warning */

	return errn;
}
#endif /* DEPLOY_ISO1_CODEC_FRAGMENT */


#endif /* DEPLOY_ISO1_CODEC */

#endif

