diff --git a/README.txt b/README.txt
index 77f4bae..ee7ad6b 100644
--- a/README.txt
+++ b/README.txt
@@ -1,6 +1,6 @@
-------------------------------------------------------------------------
OpenV2G - an open source project implementing the basic functionality of the ISO IEC 15118 vehicle to grid (V2G) communication interface
-Version 0.9.1, released August 28, 2014
+Version 0.9.2, released September 12, 2014
http://openv2g.sourceforge.net/
Please report bugs via the SourceForge bug tracking system at http://sourceforge.net/tracker/?group_id=350113.
@@ -21,6 +21,13 @@ GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see
Code generated by EXIdizer
@@ -45,10 +45,6 @@ void init_appHandEXIDocument(struct appHandEXIDocument* exiDoc) { exiDoc->supportedAppProtocolRes_isUsed = 0u; } -void init_appHandAnonType_supportedAppProtocolRes(struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes) { - appHandAnonType_supportedAppProtocolRes->SchemaID_isUsed = 0u; -} - void init_appHandAppProtocolType(struct appHandAppProtocolType* appHandAppProtocolType) { } @@ -56,6 +52,10 @@ void init_appHandAnonType_supportedAppProtocolReq(struct appHandAnonType_support appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen = 0u; } +void init_appHandAnonType_supportedAppProtocolRes(struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes) { + appHandAnonType_supportedAppProtocolRes->SchemaID_isUsed = 0u; +} + diff --git a/src/appHandshake/appHandEXIDatatypes.h b/src/appHandshake/appHandEXIDatatypes.h index 61b76e3..4e9cbdb 100644 --- a/src/appHandshake/appHandEXIDatatypes.h +++ b/src/appHandshake/appHandEXIDatatypes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -50,12 +50,10 @@ extern "C" { /* Datatype definitions and structs for given XML Schema definitions */ -typedef enum { - responseCodeType_OK_SuccessfulNegotiation = 0, - responseCodeType_OK_SuccessfulNegotiationWithMinorDeviation = 1, - responseCodeType_Failed_NoNegotiation = 2 -} appHandresponseCodeType; - +#define UNION_YES 1 +#define UNION_NO 2 +#define SAVE_MEMORY_WITH_UNNAMED_UNION UNION_YES + /* Complex type name='urn:iso:15118:2:2010:AppProtocol,AppProtocolType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ProtocolNamespace,VersionNumberMajor,VersionNumberMinor,SchemaID,Priority)', derivedBy='RESTRICTION'. */ #define appHandAppProtocolType_ProtocolNamespace_CHARACTERS_SIZE 100 /* XML schema facet maxLength for urn:iso:15118:2:2010:AppProtocol,protocolNamespaceType is 100 */ struct appHandAppProtocolType { @@ -74,15 +72,11 @@ struct appHandAppProtocolType { uint8_t Priority ; }; -/* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolReq', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(AppProtocol{1-20})', derivedBy='RESTRICTION'. */ -#define appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE 5 -struct appHandAnonType_supportedAppProtocolReq { - /* element: AppProtocol, Complex type name='urn:iso:15118:2:2010:AppProtocol,AppProtocolType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ProtocolNamespace,VersionNumberMajor,VersionNumberMinor,SchemaID,Priority)', derivedBy='RESTRICTION'. */ - struct { - struct appHandAppProtocolType array[appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE]; - uint16_t arrayLen; - } AppProtocol; -}; +typedef enum { + appHandresponseCodeType_OK_SuccessfulNegotiation = 0, + appHandresponseCodeType_OK_SuccessfulNegotiationWithMinorDeviation = 1, + appHandresponseCodeType_Failed_NoNegotiation = 2 +} appHandresponseCodeType; /* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolRes', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ResponseCode,SchemaID{0-1})', derivedBy='RESTRICTION'. */ struct appHandAnonType_supportedAppProtocolRes { @@ -93,21 +87,30 @@ struct appHandAnonType_supportedAppProtocolRes { unsigned int SchemaID_isUsed:1; }; +/* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolReq', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(AppProtocol{1-20})', derivedBy='RESTRICTION'. */ +#define appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE 5 +struct appHandAnonType_supportedAppProtocolReq { + /* element: AppProtocol, Complex type name='urn:iso:15118:2:2010:AppProtocol,AppProtocolType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ProtocolNamespace,VersionNumberMajor,VersionNumberMinor,SchemaID,Priority)', derivedBy='RESTRICTION'. */ + struct { + struct appHandAppProtocolType array[appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE]; + uint16_t arrayLen; + } AppProtocol; +}; + /* Possible root elements of EXI Document */ struct appHandEXIDocument { -#define USE_UNION_FOR_GLOBAL_ELEMENTS 1 -#ifdef USE_UNION_FOR_GLOBAL_ELEMENTS +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES union { -#endif +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ struct appHandAnonType_supportedAppProtocolReq supportedAppProtocolReq ; struct appHandAnonType_supportedAppProtocolRes supportedAppProtocolRes ; -#ifdef USE_UNION_FOR_GLOBAL_ELEMENTS +#if SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES }; -#endif +#endif /* SAVE_MEMORY_WITH_UNNAMED_UNION == UNION_YES */ unsigned int supportedAppProtocolReq_isUsed:1; unsigned int supportedAppProtocolRes_isUsed:1; @@ -118,9 +121,9 @@ struct appHandEXIDocument { /* Initialization methods for structs */ void init_appHandEXIDocument(struct appHandEXIDocument* exiDoc); -void init_appHandAnonType_supportedAppProtocolRes(struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes); void init_appHandAppProtocolType(struct appHandAppProtocolType* appHandAppProtocolType); void init_appHandAnonType_supportedAppProtocolReq(struct appHandAnonType_supportedAppProtocolReq* appHandAnonType_supportedAppProtocolReq); +void init_appHandAnonType_supportedAppProtocolRes(struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes); #ifdef __cplusplus diff --git a/src/appHandshake/appHandEXIDatatypesDecoder.c b/src/appHandshake/appHandEXIDatatypesDecoder.c index ff72640..61e5fdc 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.c +++ b/src/appHandshake/appHandEXIDatatypesDecoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -48,129 +48,23 @@ static uint32_t uint32; /* Forward Declarations */ -static int decode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes); static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppProtocolType* appHandAppProtocolType); static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolReq* appHandAnonType_supportedAppProtocolReq); +static int decode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes); /* Deviant data decoding (skip functions) */ - /* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolRes', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ResponseCode,SchemaID{0-1})', derivedBy='RESTRICTION'. */ -static int decode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes) { - int grammarID = 0; - int done = 0; - - init_appHandAnonType_supportedAppProtocolRes(appHandAnonType_supportedAppProtocolRes); - - while(!done) { - switch(grammarID) { - case 0: - /* FirstStartTag[START_ELEMENT(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, 2, &uint32); - appHandAnonType_supportedAppProtocolRes->ResponseCode = (appHandresponseCodeType) 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(ResponseCode) ? */ - 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(SchemaID), 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, 8, &(uint32)); - appHandAnonType_supportedAppProtocolRes->SchemaID = (uint8_t)(uint32 + 0); - appHandAnonType_supportedAppProtocolRes->SchemaID_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT(SchemaID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 2; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 2: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:AppProtocol,AppProtocolType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ProtocolNamespace,VersionNumberMajor,VersionNumberMinor,SchemaID,Priority)', derivedBy='RESTRICTION'. */ + /* Complex type name='urn:iso:15118:2:2010:AppProtocol,AppProtocolType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ProtocolNamespace,VersionNumberMajor,VersionNumberMinor,SchemaID,Priority)', derivedBy='RESTRICTION'. */ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppProtocolType* appHandAppProtocolType) { - int grammarID = 4; + int grammarID = 0; int done = 0; init_appHandAppProtocolType(appHandAppProtocolType); while(!done) { switch(grammarID) { - case 4: + case 0: /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -202,7 +96,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP /* valid EE for simple element START_ELEMENT(ProtocolNamespace) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 5; + grammarID = 1; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -214,7 +108,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 5: + case 1: /* Element[START_ELEMENT(VersionNumberMajor)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -234,7 +128,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP /* valid EE for simple element START_ELEMENT(VersionNumberMajor) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 6; + grammarID = 2; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -246,7 +140,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 6: + case 2: /* Element[START_ELEMENT(VersionNumberMinor)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -266,7 +160,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP /* valid EE for simple element START_ELEMENT(VersionNumberMinor) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 7; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -278,7 +172,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 7: + case 3: /* Element[START_ELEMENT(SchemaID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -299,7 +193,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP /* valid EE for simple element START_ELEMENT(SchemaID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 8; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -311,7 +205,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 8: + case 4: /* Element[START_ELEMENT(Priority)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -332,7 +226,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP /* valid EE for simple element START_ELEMENT(Priority) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 2; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -344,14 +238,14 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 2: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -372,16 +266,58 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP /* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolReq', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(AppProtocol{1-20})', derivedBy='RESTRICTION'. */ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolReq* appHandAnonType_supportedAppProtocolReq) { - int grammarID = 9; + int grammarID = 7; int done = 0; init_appHandAnonType_supportedAppProtocolReq(appHandAnonType_supportedAppProtocolReq); while(!done) { switch(grammarID) { - case 9: + case 7: /* FirstStartTag[START_ELEMENT(AppProtocol)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen < appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE) { + errn = decode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array[appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 8; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 8: + /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen < appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE) { + errn = decode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array[appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 9; + break; + case 1: + done = 1; + grammarID = 6; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 9: + /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: @@ -392,6 +328,10 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s } grammarID = 10; break; + case 1: + done = 1; + grammarID = 6; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -413,7 +353,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -436,7 +376,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -459,7 +399,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -482,7 +422,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -505,7 +445,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -528,7 +468,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -551,7 +491,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -574,7 +514,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -597,7 +537,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -620,7 +560,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -643,7 +583,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -666,7 +606,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -689,7 +629,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -712,7 +652,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -735,7 +675,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -758,7 +698,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -777,11 +717,11 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 27; + grammarID = 5; break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -789,22 +729,67 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s } } break; - case 27: - /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 5: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen < appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE) { - errn = decode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array[appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 28; - break; - case 1: done = 1; - grammarID = 3; + grammarID = 6; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolRes', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ResponseCode,SchemaID{0-1})', derivedBy='RESTRICTION'. */ +static int decode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes) { + int grammarID = 27; + int done = 0; + + init_appHandAnonType_supportedAppProtocolRes(appHandAnonType_supportedAppProtocolRes); + + while(!done) { + switch(grammarID) { + case 27: + /* FirstStartTag[START_ELEMENT(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, 2, &uint32); + appHandAnonType_supportedAppProtocolRes->ResponseCode = (appHandresponseCodeType) 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(ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 28; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -813,21 +798,36 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s } break; case 28: - /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ + /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen < appHandAnonType_supportedAppProtocolReq_AppProtocol_ARRAY_SIZE) { - errn = decode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array[appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + appHandAnonType_supportedAppProtocolRes->SchemaID = (uint8_t)(uint32 + 0); + appHandAnonType_supportedAppProtocolRes->SchemaID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT(SchemaID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 5; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } } - grammarID = 2; break; case 1: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -835,14 +835,14 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s } } break; - case 2: + case 5: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 3; + grammarID = 6; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; diff --git a/src/appHandshake/appHandEXIDatatypesDecoder.h b/src/appHandshake/appHandEXIDatatypesDecoder.h index 9fdb02e..8451d3f 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.h +++ b/src/appHandshake/appHandEXIDatatypesDecoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.c b/src/appHandshake/appHandEXIDatatypesEncoder.c index 4be5045..28eb832 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.c +++ b/src/appHandshake/appHandEXIDatatypesEncoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -44,13 +44,13 @@ static int errn; /* Forward Declarations */ -static int encode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes); static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppProtocolType* appHandAppProtocolType); static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolReq* appHandAnonType_supportedAppProtocolReq); +static int encode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes); - /* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolRes', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ResponseCode,SchemaID{0-1})', derivedBy='RESTRICTION'. */ -static int encode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes) { + /* Complex type name='urn:iso:15118:2:2010:AppProtocol,AppProtocolType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ProtocolNamespace,VersionNumberMajor,VersionNumberMinor,SchemaID,Priority)', derivedBy='RESTRICTION'. */ +static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppProtocolType* appHandAppProtocolType) { int grammarID = 0; int done = 0; @@ -58,79 +58,6 @@ static int encode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, s while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT(ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, appHandAnonType_supportedAppProtocolRes->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 1; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 1: - /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */ - if ( appHandAnonType_supportedAppProtocolRes->SchemaID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(appHandAnonType_supportedAppProtocolRes->SchemaID - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 2; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 2: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:AppProtocol,AppProtocolType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ProtocolNamespace,VersionNumberMajor,VersionNumberMinor,SchemaID,Priority)', derivedBy='RESTRICTION'. */ -static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppProtocolType* appHandAppProtocolType) { - int grammarID = 4; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 4: /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -147,12 +74,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 5; + grammarID = 1; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 5: + case 1: /* Element[START_ELEMENT(VersionNumberMajor)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -165,12 +92,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 6; + grammarID = 2; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 6: + case 2: /* Element[START_ELEMENT(VersionNumberMinor)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -183,12 +110,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 7; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 7: + case 3: /* Element[START_ELEMENT(SchemaID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -201,12 +128,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 8; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 8: + case 4: /* Element[START_ELEMENT(Priority)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -219,19 +146,19 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 2; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 2: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -249,21 +176,57 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP /* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolReq', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(AppProtocol{1-20})', derivedBy='RESTRICTION'. */ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolReq* appHandAnonType_supportedAppProtocolReq) { - int grammarID = 9; + int grammarID = 7; int done = 0; unsigned int appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 9: + case 7: /* FirstStartTag[START_ELEMENT(AppProtocol)] */ if (appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex < appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array [appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex++]); } + grammarID = 8; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 8: + /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ + if (appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex < appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array [appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex++]); + } + grammarID = 9; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 9: + /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ + if (appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex < appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array [appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex++]); + } grammarID = 10; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -281,7 +244,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -299,7 +262,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -317,7 +280,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -335,7 +298,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -353,7 +316,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -371,7 +334,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -389,7 +352,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -407,7 +370,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -425,7 +388,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -443,7 +406,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -461,7 +424,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -479,7 +442,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -497,7 +460,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -515,7 +478,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -533,7 +496,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -551,7 +514,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -563,61 +526,98 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { errn = encode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array [appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex++]); } - grammarID = 27; + grammarID = 5; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 27: - /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ - if (appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex < appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array [appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex++]); - } - grammarID = 28; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 28: - /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ - if (appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex < appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array [appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex++]); - } - grammarID = 2; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 2: + case 5: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 3; + grammarID = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:AppProtocol,#AnonType_supportedAppProtocolRes', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(ResponseCode,SchemaID{0-1})', derivedBy='RESTRICTION'. */ +static int encode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, struct appHandAnonType_supportedAppProtocolRes* appHandAnonType_supportedAppProtocolRes) { + int grammarID = 27; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 27: + /* FirstStartTag[START_ELEMENT(ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, appHandAnonType_supportedAppProtocolRes->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 28; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 28: + /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */ + if ( appHandAnonType_supportedAppProtocolRes->SchemaID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(appHandAnonType_supportedAppProtocolRes->SchemaID - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 5; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 5: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.h b/src/appHandshake/appHandEXIDatatypesEncoder.h index 135aff0..f9c243f 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.h +++ b/src/appHandshake/appHandEXIDatatypesEncoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/AbstractDecoderChannel.c b/src/codec/AbstractDecoderChannel.c index bad8d06..3405329 100644 --- a/src/codec/AbstractDecoderChannel.c +++ b/src/codec/AbstractDecoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/AbstractEncoderChannel.c b/src/codec/AbstractEncoderChannel.c index f340fa1..b0700c7 100644 --- a/src/codec/AbstractEncoderChannel.c +++ b/src/codec/AbstractEncoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/BitDecoderChannel.c b/src/codec/BitDecoderChannel.c index 7b287c2..18c9457 100644 --- a/src/codec/BitDecoderChannel.c +++ b/src/codec/BitDecoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/BitEncoderChannel.c b/src/codec/BitEncoderChannel.c index 98ed6ba..6776436 100644 --- a/src/codec/BitEncoderChannel.c +++ b/src/codec/BitEncoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/BitInputStream.c b/src/codec/BitInputStream.c index 0f382cd..64dd3d8 100644 --- a/src/codec/BitInputStream.c +++ b/src/codec/BitInputStream.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/BitInputStream.h b/src/codec/BitInputStream.h index a6fd24c..218c54b 100644 --- a/src/codec/BitInputStream.h +++ b/src/codec/BitInputStream.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/BitOutputStream.c b/src/codec/BitOutputStream.c index 7293c85..abc98da 100644 --- a/src/codec/BitOutputStream.c +++ b/src/codec/BitOutputStream.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/BitOutputStream.h b/src/codec/BitOutputStream.h index b8e5e43..5a647f0 100644 --- a/src/codec/BitOutputStream.h +++ b/src/codec/BitOutputStream.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/ByteDecoderChannel.c b/src/codec/ByteDecoderChannel.c index 3a1e376..5b6b97e 100644 --- a/src/codec/ByteDecoderChannel.c +++ b/src/codec/ByteDecoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/ByteEncoderChannel.c b/src/codec/ByteEncoderChannel.c index af92b22..544e44a 100644 --- a/src/codec/ByteEncoderChannel.c +++ b/src/codec/ByteEncoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/ByteStream.c b/src/codec/ByteStream.c index b95e21c..5c845ae 100644 --- a/src/codec/ByteStream.c +++ b/src/codec/ByteStream.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/ByteStream.h b/src/codec/ByteStream.h index e270ed4..ff4deef 100644 --- a/src/codec/ByteStream.h +++ b/src/codec/ByteStream.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/DecoderChannel.h b/src/codec/DecoderChannel.h index 649cbbf..c84b605 100644 --- a/src/codec/DecoderChannel.h +++ b/src/codec/DecoderChannel.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EXIConfig.h b/src/codec/EXIConfig.h index b20bde5..6c3af6b 100644 --- a/src/codec/EXIConfig.h +++ b/src/codec/EXIConfig.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EXIHeaderDecoder.c b/src/codec/EXIHeaderDecoder.c index f93f552..6faf8cc 100644 --- a/src/codec/EXIHeaderDecoder.c +++ b/src/codec/EXIHeaderDecoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EXIHeaderDecoder.h b/src/codec/EXIHeaderDecoder.h index d29a9be..6510bf1 100644 --- a/src/codec/EXIHeaderDecoder.h +++ b/src/codec/EXIHeaderDecoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EXIHeaderEncoder.c b/src/codec/EXIHeaderEncoder.c index 64003f2..d37629e 100644 --- a/src/codec/EXIHeaderEncoder.c +++ b/src/codec/EXIHeaderEncoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EXIHeaderEncoder.h b/src/codec/EXIHeaderEncoder.h index c0ce7be..abae916 100644 --- a/src/codec/EXIHeaderEncoder.h +++ b/src/codec/EXIHeaderEncoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EXIOptions.h b/src/codec/EXIOptions.h index 282b3d8..f8d8f36 100644 --- a/src/codec/EXIOptions.h +++ b/src/codec/EXIOptions.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EXITypes.h b/src/codec/EXITypes.h index e8cc219..98a6dd6 100644 --- a/src/codec/EXITypes.h +++ b/src/codec/EXITypes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/EncoderChannel.h b/src/codec/EncoderChannel.h index bf91504..6d5b85b 100644 --- a/src/codec/EncoderChannel.h +++ b/src/codec/EncoderChannel.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/ErrorCodes.h b/src/codec/ErrorCodes.h index 4076c9a..368215d 100644 --- a/src/codec/ErrorCodes.h +++ b/src/codec/ErrorCodes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/MethodsBag.c b/src/codec/MethodsBag.c index 19ea920..cd34fd9 100644 --- a/src/codec/MethodsBag.c +++ b/src/codec/MethodsBag.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/MethodsBag.h b/src/codec/MethodsBag.h index de8199b..6f7413a 100644 --- a/src/codec/MethodsBag.h +++ b/src/codec/MethodsBag.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/codec/v2gEXIDatatypes.c b/src/codec/v2gEXIDatatypes.c index ce1a7cd..8836874 100644 --- a/src/codec/v2gEXIDatatypes.c +++ b/src/codec/v2gEXIDatatypes.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -38,6 +38,7 @@ #ifndef EXI_v2g_DATATYPES_C #define EXI_v2g_DATATYPES_C +#if DEPLOY_ISO_CODEC == SUPPORT_YES void init_v2gEXIDocument(struct v2gEXIDocument* exiDoc) { @@ -123,75 +124,16 @@ void init_v2gEXIDocument(struct v2gEXIDocument* exiDoc) { exiDoc->Object_isUsed = 0u; } -void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { - v2gPowerDeliveryReqType->ChargingProfile_isUsed = 0u; - v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; - v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; +void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType) { + v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 0u; } -void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { +void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { } -void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType) { - v2gMessageHeaderType->Notification_isUsed = 0u; - v2gMessageHeaderType->Signature_isUsed = 0u; -} - -void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType) { -} - -void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { -} - -void init_v2gCostType(struct v2gCostType* v2gCostType) { - v2gCostType->amountMultiplier_isUsed = 0u; -} - -void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { -} - -void init_v2gEntryType(struct v2gEntryType* v2gEntryType) { - v2gEntryType->TimeInterval_isUsed = 0u; - v2gEntryType->RelativeTimeInterval_isUsed = 0u; -} - -void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { -} - -void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { - v2gSignaturePropertiesType->Id_isUsed = 0u; - v2gSignaturePropertiesType->SignatureProperty.arrayLen = 0u; -} - -void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { -} - -void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType) { -} - -void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType) { - v2gConsumptionCostType->Cost.arrayLen = 0u; -} - -void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { -} - -void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType) { -} - -void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType) { - v2gServiceListType->Service.arrayLen = 0u; -} - -void init_v2gEVSEChargeParameterType(struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { -} - -void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { - v2gMeteringReceiptReqType->Id_isUsed = 0u; - v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; -} - -void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { +void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { + v2gServiceDiscoveryReqType->ServiceScope_isUsed = 0u; + v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; } void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType) { @@ -200,26 +142,335 @@ void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType) { v2gSignatureType->Object.arrayLen = 0u; } -void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { +void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType) { + v2gNotificationType->FaultMsg_isUsed = 0u; } void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { } -void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType) { - v2gSAScheduleListType->SAScheduleTuple.arrayLen = 0u; +void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { } -void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { - v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; +void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType) { + v2gSignaturePropertyType->Id_isUsed = 0u; +} + +void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType) { + v2gReferenceType->Id_isUsed = 0u; + v2gReferenceType->URI_isUsed = 0u; + v2gReferenceType->Type_isUsed = 0u; + v2gReferenceType->Transforms_isUsed = 0u; +} + +void init_v2gManifestType(struct v2gManifestType* v2gManifestType) { + v2gManifestType->Id_isUsed = 0u; + v2gManifestType->Reference.arrayLen = 0u; +} + +void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType) { + v2gSelectedServiceType->ParameterSetID_isUsed = 0u; +} + +void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType) { + v2gEVChargeParameterType->DepartureTime_isUsed = 0u; +} + +void init_v2gEVSEChargeParameterType(struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { +} + +void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType) { + v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; + v2gChargingStatusResType->MeterInfo_isUsed = 0u; + v2gChargingStatusResType->ReceiptRequired_isUsed = 0u; +} + +void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType) { +} + +void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { + v2gMeteringReceiptReqType->Id_isUsed = 0u; + v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; +} + +void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { + v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; + v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u; +} + +void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType) { + v2gServiceDetailResType->ServiceParameterList_isUsed = 0u; +} + +void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType) { + v2gCertificateChainType->Id_isUsed = 0u; + v2gCertificateChainType->SubCertificates_isUsed = 0u; +} + +void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { +} + +void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { + v2gMeteringReceiptResType->EVSEStatus_isUsed = 0u; + v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 0u; + v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 0u; +} + +void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + v2gPowerDeliveryReqType->ChargingProfile_isUsed = 0u; + v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; + v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; +} + +void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType) { + v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u; +} + +void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType) { +} + +void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType) { + v2gChargeServiceType->ServiceName_isUsed = 0u; + v2gChargeServiceType->ServiceScope_isUsed = 0u; +} + +void init_v2gParameterType(struct v2gParameterType* v2gParameterType) { + v2gParameterType->boolValue_isUsed = 0u; + v2gParameterType->byteValue_isUsed = 0u; + v2gParameterType->shortValue_isUsed = 0u; + v2gParameterType->intValue_isUsed = 0u; + v2gParameterType->physicalValue_isUsed = 0u; + v2gParameterType->stringValue_isUsed = 0u; +} + +void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType) { +} + +void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { +} + +void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType) { + v2gKeyValueType->DSAKeyValue_isUsed = 0u; + v2gKeyValueType->RSAKeyValue_isUsed = 0u; +} + +void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType) { + v2gSessionSetupResType->EVSETimeStamp_isUsed = 0u; +} + +void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType) { +} + +void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType) { + v2gX509DataType->X509IssuerSerial.arrayLen = 0u; + v2gX509DataType->X509SKI.arrayLen = 0u; + v2gX509DataType->X509SubjectName.arrayLen = 0u; + v2gX509DataType->X509Certificate.arrayLen = 0u; + v2gX509DataType->X509CRL.arrayLen = 0u; +} + +void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { +} + +void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType) { + v2gPaymentOptionListType->PaymentOption.arrayLen = 0u; +} + +void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType) { + v2gSignatureMethodType->HMACOutputLength_isUsed = 0u; +} + +void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { + v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 0u; + v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u; +} + +void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { +} + +void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { +} + +void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { + v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u; +} + +void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType) { +} + +void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { + v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u; + v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u; + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u; + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 0u; + v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u; + v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; +} + +void init_v2gServiceType(struct v2gServiceType* v2gServiceType) { + v2gServiceType->ServiceName_isUsed = 0u; + v2gServiceType->ServiceScope_isUsed = 0u; +} + +void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType) { +} + +void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType) { + v2gConsumptionCostType->Cost.arrayLen = 0u; +} + +void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType) { +} + +void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType) { +} + +void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { +} + +void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { + v2gSignaturePropertiesType->Id_isUsed = 0u; + v2gSignaturePropertiesType->SignatureProperty.arrayLen = 0u; +} + +void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType) { + v2gSelectedServiceListType->SelectedService.arrayLen = 0u; } void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { v2gServiceDiscoveryResType->ServiceList_isUsed = 0u; } -void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType) { - v2gServiceParameterListType->ParameterSet.arrayLen = 0u; +void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType) { +} + +void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType) { +} + +void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType) { + v2gSignedInfoType->Id_isUsed = 0u; + v2gSignedInfoType->Reference.arrayLen = 0u; +} + +void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType) { +} + +void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType) { + v2gServiceListType->Service.arrayLen = 0u; +} + +void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { +} + +void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { + v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; +} + +void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType) { + v2gSPKIDataType->SPKISexp.arrayLen = 0u; +} + +void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDemandResType) { + v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 0u; + v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 0u; + v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 0u; + v2gCurrentDemandResType->MeterInfo_isUsed = 0u; + v2gCurrentDemandResType->ReceiptRequired_isUsed = 0u; +} + +void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType) { + v2gKeyInfoType->Id_isUsed = 0u; + v2gKeyInfoType->KeyName.arrayLen = 0u; + v2gKeyInfoType->KeyValue.arrayLen = 0u; + v2gKeyInfoType->RetrievalMethod.arrayLen = 0u; + v2gKeyInfoType->X509Data.arrayLen = 0u; + v2gKeyInfoType->PGPData.arrayLen = 0u; + v2gKeyInfoType->SPKIData.arrayLen = 0u; + v2gKeyInfoType->MgmtData.arrayLen = 0u; +} + +void init_v2gObjectType(struct v2gObjectType* v2gObjectType) { + v2gObjectType->Id_isUsed = 0u; + v2gObjectType->MimeType_isUsed = 0u; + v2gObjectType->Encoding_isUsed = 0u; +} + +void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { + v2gSAScheduleTupleType->SalesTariff_isUsed = 0u; +} + +void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType) { + v2gSignatureValueType->Id_isUsed = 0u; +} + +void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { + v2gPowerDeliveryResType->EVSEStatus_isUsed = 0u; + v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 0u; + v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 0u; +} + +void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType) { + v2gSubCertificatesType->Certificate.arrayLen = 0u; +} + +void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType) { + v2gAuthorizationReqType->Id_isUsed = 0u; + v2gAuthorizationReqType->GenChallenge_isUsed = 0u; +} + +void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType) { + v2gChargingProfileType->ProfileEntry.arrayLen = 0u; +} + +void init_v2gEntryType(struct v2gEntryType* v2gEntryType) { + v2gEntryType->TimeInterval_isUsed = 0u; + v2gEntryType->RelativeTimeInterval_isUsed = 0u; +} + +void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType) { +} + +void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen = 0u; +} + +void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType) { +} + +void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { + v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 0u; + v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 0u; + v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 0u; + v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u; +} + +void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType) { + v2gParameterSetType->Parameter.arrayLen = 0u; +} + +void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { +} + +void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType) { + v2gMeterInfoType->MeterReading_isUsed = 0u; + v2gMeterInfoType->SigMeterReading_isUsed = 0u; + v2gMeterInfoType->MeterStatus_isUsed = 0u; + v2gMeterInfoType->TMeter_isUsed = 0u; +} + +void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { +} + +void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType) { + v2gRetrievalMethodType->URI_isUsed = 0u; + v2gRetrievalMethodType->Type_isUsed = 0u; + v2gRetrievalMethodType->Transforms_isUsed = 0u; +} + +void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType) { } void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { @@ -231,13 +482,39 @@ void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_ v2gDC_EVChargeParameterType->BulkSOC_isUsed = 0u; } -void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { - v2gServiceDiscoveryReqType->ServiceScope_isUsed = 0u; - v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; +void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { } -void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType) { - v2gSignatureValueType->Id_isUsed = 0u; +void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { + v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; +} + +void init_v2gRelativeTimeIntervalType(struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { + v2gRelativeTimeIntervalType->duration_isUsed = 0u; +} + +void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType) { +} + +void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType) { + v2gPGPDataType->PGPKeyID_isUsed = 0u; + v2gPGPDataType->PGPKeyPacket_isUsed = 0u; +} + +void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { + v2gCertificateUpdateResType->RetryCounter_isUsed = 0u; +} + +void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { +} + +void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType) { + v2gDSAKeyValueType->P_isUsed = 0u; + v2gDSAKeyValueType->Q_isUsed = 0u; + v2gDSAKeyValueType->G_isUsed = 0u; + v2gDSAKeyValueType->J_isUsed = 0u; + v2gDSAKeyValueType->Seed_isUsed = 0u; + v2gDSAKeyValueType->PgenCounter_isUsed = 0u; } void init_v2gBodyType(struct v2gBodyType* v2gBodyType) { @@ -278,292 +555,49 @@ void init_v2gBodyType(struct v2gBodyType* v2gBodyType) { v2gBodyType->WeldingDetectionRes_isUsed = 0u; } -void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { +void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { } -void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { - v2gMeteringReceiptResType->EVSEStatus_isUsed = 0u; - v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 0u; - v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 0u; -} - -void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType) { -} - -void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType) { -} - -void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType) { - v2gSignedInfoType->Id_isUsed = 0u; - v2gSignedInfoType->Reference.arrayLen = 0u; -} - -void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType) { - v2gAuthorizationReqType->Id_isUsed = 0u; - v2gAuthorizationReqType->GenChallenge_isUsed = 0u; -} - -void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType) { - v2gChargingProfileType->ProfileEntry.arrayLen = 0u; -} - -void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { -} - -void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType) { - v2gSelectedServiceType->ParameterSetID_isUsed = 0u; -} - -void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType) { - v2gSubCertificatesType->Certificate.arrayLen = 0u; -} - -void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType) { - v2gCertificateChainType->Id_isUsed = 0u; - v2gCertificateChainType->SubCertificates_isUsed = 0u; -} - -void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen = 0u; -} - -void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { - v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u; - v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u; - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u; - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 0u; - v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u; - v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; -} - -void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType) { - v2gSalesTariffType->Id_isUsed = 0u; - v2gSalesTariffType->SalesTariffDescription_isUsed = 0u; - v2gSalesTariffType->NumEPriceLevels_isUsed = 0u; - v2gSalesTariffType->SalesTariffEntry.arrayLen = 0u; -} - -void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType) { -} - -void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType) { -} - -void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType) { +void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType) { + v2gServiceParameterListType->ParameterSet.arrayLen = 0u; } void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType) { } -void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType) { -} - -void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { -} - -void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType) { - v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u; -} - -void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType) { - v2gNotificationType->FaultMsg_isUsed = 0u; -} - -void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType) { -} - -void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType) { - v2gChargeServiceType->ServiceName_isUsed = 0u; - v2gChargeServiceType->ServiceScope_isUsed = 0u; -} - -void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { - v2gPowerDeliveryResType->EVSEStatus_isUsed = 0u; - v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 0u; - v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 0u; -} - -void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType) { -} - -void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType) { - v2gX509DataType->X509IssuerSerial.arrayLen = 0u; - v2gX509DataType->X509SKI.arrayLen = 0u; - v2gX509DataType->X509SubjectName.arrayLen = 0u; - v2gX509DataType->X509Certificate.arrayLen = 0u; - v2gX509DataType->X509CRL.arrayLen = 0u; -} - -void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType) { +void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType) { + v2gSAScheduleListType->SAScheduleTuple.arrayLen = 0u; } void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType) { } -void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType) { - v2gPGPDataType->PGPKeyID_isUsed = 0u; - v2gPGPDataType->PGPKeyPacket_isUsed = 0u; +void init_v2gCostType(struct v2gCostType* v2gCostType) { + v2gCostType->amountMultiplier_isUsed = 0u; } -void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType) { -} - -void init_v2gTransformType(struct v2gTransformType* v2gTransformType) { - v2gTransformType->XPath.arrayLen = 0u; -} - -void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { -} - -void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType) { -} - -void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { -} - -void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { - v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; - v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u; -} - -void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType) { - v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; - v2gChargingStatusResType->MeterInfo_isUsed = 0u; - v2gChargingStatusResType->ReceiptRequired_isUsed = 0u; -} - -void init_v2gObjectType(struct v2gObjectType* v2gObjectType) { - v2gObjectType->Id_isUsed = 0u; - v2gObjectType->MimeType_isUsed = 0u; - v2gObjectType->Encoding_isUsed = 0u; -} - -void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType) { - v2gPaymentOptionListType->PaymentOption.arrayLen = 0u; -} - -void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType) { - v2gParameterSetType->Parameter.arrayLen = 0u; -} - -void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { - v2gAC_EVChargeParameterType->DepartureTime_isUsed = 0u; -} - -void init_v2gManifestType(struct v2gManifestType* v2gManifestType) { - v2gManifestType->Id_isUsed = 0u; - v2gManifestType->Reference.arrayLen = 0u; -} - -void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType) { - v2gServiceDetailResType->ServiceParameterList_isUsed = 0u; -} - -void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { - v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u; -} - -void init_v2gServiceType(struct v2gServiceType* v2gServiceType) { - v2gServiceType->ServiceName_isUsed = 0u; - v2gServiceType->ServiceScope_isUsed = 0u; -} - -void init_v2gParameterType(struct v2gParameterType* v2gParameterType) { - v2gParameterType->boolValue_isUsed = 0u; - v2gParameterType->byteValue_isUsed = 0u; - v2gParameterType->shortValue_isUsed = 0u; - v2gParameterType->intValue_isUsed = 0u; - v2gParameterType->physicalValue_isUsed = 0u; - v2gParameterType->stringValue_isUsed = 0u; -} - -void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType) { - v2gDSAKeyValueType->P_isUsed = 0u; - v2gDSAKeyValueType->Q_isUsed = 0u; - v2gDSAKeyValueType->G_isUsed = 0u; - v2gDSAKeyValueType->J_isUsed = 0u; - v2gDSAKeyValueType->Seed_isUsed = 0u; - v2gDSAKeyValueType->PgenCounter_isUsed = 0u; -} - -void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { -} - -void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType) { - v2gEVChargeParameterType->DepartureTime_isUsed = 0u; -} - -void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType) { - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 0u; -} - -void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - v2gSignaturePropertyType->Id_isUsed = 0u; -} - -void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { - v2gPMaxScheduleEntryType->TimeInterval_isUsed = 0u; - v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u; -} - -void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType) { - v2gKeyValueType->DSAKeyValue_isUsed = 0u; - v2gKeyValueType->RSAKeyValue_isUsed = 0u; -} - -void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType) { - v2gRetrievalMethodType->URI_isUsed = 0u; - v2gRetrievalMethodType->Type_isUsed = 0u; - v2gRetrievalMethodType->Transforms_isUsed = 0u; -} - -void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType) { +void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType) { + v2gMessageHeaderType->Notification_isUsed = 0u; + v2gMessageHeaderType->Signature_isUsed = 0u; } void init_v2gServiceDetailReqType(struct v2gServiceDetailReqType* v2gServiceDetailReqType) { } -void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType) { - v2gKeyInfoType->Id_isUsed = 0u; - v2gKeyInfoType->KeyName.arrayLen = 0u; - v2gKeyInfoType->KeyValue.arrayLen = 0u; - v2gKeyInfoType->RetrievalMethod.arrayLen = 0u; - v2gKeyInfoType->X509Data.arrayLen = 0u; - v2gKeyInfoType->PGPData.arrayLen = 0u; - v2gKeyInfoType->SPKIData.arrayLen = 0u; - v2gKeyInfoType->MgmtData.arrayLen = 0u; -} - -void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { -} - -void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType) { - v2gSelectedServiceListType->SelectedService.arrayLen = 0u; -} - -void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType) { - v2gMeterInfoType->MeterReading_isUsed = 0u; - v2gMeterInfoType->SigMeterReading_isUsed = 0u; - v2gMeterInfoType->MeterStatus_isUsed = 0u; - v2gMeterInfoType->TMeter_isUsed = 0u; -} - -void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType) { - v2gSPKIDataType->SPKISexp.arrayLen = 0u; -} - -void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { - v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 0u; - v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 0u; - v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u; -} - void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType) { v2gTransformsType->Transform.arrayLen = 0u; } +void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { +} + +void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType) { +} + +void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { + v2gAC_EVChargeParameterType->DepartureTime_isUsed = 0u; +} + void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { v2gSalesTariffEntryType->TimeInterval_isUsed = 0u; v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; @@ -571,64 +605,31 @@ void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariff v2gSalesTariffEntryType->ConsumptionCost.arrayLen = 0u; } -void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { +void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { + v2gPMaxScheduleEntryType->TimeInterval_isUsed = 0u; + v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u; } -void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType) { - v2gSessionSetupResType->EVSETimeStamp_isUsed = 0u; +void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType) { } -void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType) { - v2gSignatureMethodType->HMACOutputLength_isUsed = 0u; +void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType) { + v2gSalesTariffType->Id_isUsed = 0u; + v2gSalesTariffType->SalesTariffDescription_isUsed = 0u; + v2gSalesTariffType->NumEPriceLevels_isUsed = 0u; + v2gSalesTariffType->SalesTariffEntry.arrayLen = 0u; } -void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDemandResType) { - v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 0u; - v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 0u; - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 0u; - v2gCurrentDemandResType->MeterInfo_isUsed = 0u; - v2gCurrentDemandResType->ReceiptRequired_isUsed = 0u; +void init_v2gTransformType(struct v2gTransformType* v2gTransformType) { + v2gTransformType->XPath.arrayLen = 0u; } -void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { - v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 0u; - v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u; - v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u; -} - -void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType) { -} - -void init_v2gRelativeTimeIntervalType(struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { - v2gRelativeTimeIntervalType->duration_isUsed = 0u; -} - -void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { - v2gSAScheduleTupleType->SalesTariff_isUsed = 0u; -} - -void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { - v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; -} - -void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType) { -} - -void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType) { - v2gReferenceType->Id_isUsed = 0u; - v2gReferenceType->URI_isUsed = 0u; - v2gReferenceType->Type_isUsed = 0u; - v2gReferenceType->Transforms_isUsed = 0u; -} - -void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - v2gCertificateUpdateResType->RetryCounter_isUsed = 0u; +void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { } - +#endif /* DEPLOY_ISO_CODEC */ #endif diff --git a/src/codec/v2gEXIDatatypes.h b/src/codec/v2gEXIDatatypes.h index 5551f06..bcd987e 100644 --- a/src/codec/v2gEXIDatatypes.h +++ b/src/codec/v2gEXIDatatypes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -42,6 +42,11 @@ extern "C" { #endif +#define SUPPORT_YES 1 +#define SUPPORT_NO 2 +#define DEPLOY_ISO_CODEC SUPPORT_YES + +#if DEPLOY_ISO_CODEC == SUPPORT_YES #includeCode generated by EXIdizer
@@ -41,6 +41,8 @@ #ifndef EXI_v2g_DATATYPES_DECODER_C #define EXI_v2g_DATATYPES_DECODER_C +#if DEPLOY_ISO_CODEC == SUPPORT_YES + /** event-code */ static uint32_t eventCode; static int errn; @@ -48,112 +50,112 @@ static uint32_t uint32; /* Forward Declarations */ -static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); -static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); -static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); -static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); -static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); -static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); -static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); -static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); -static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); -static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); -static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); -static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); -static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); -static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); +static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); -static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); -static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); +static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); +static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); +static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); +static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); +static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); +static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); +static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); +static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); +static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); +static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); +static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); +static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); +static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); +static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); +static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); +static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); -static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); +static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); +static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); +static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); +static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); +static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); +static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); +static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); +static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); +static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); +static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); +static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); +static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); +static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); +static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); +static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); +static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); +static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); +static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); +static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); +static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); +static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); +static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); +static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); +static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); +static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); +static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); +static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); +static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); +static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); +static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); +static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); +static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); +static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); +static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); +static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); +static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); +static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); +static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); +static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); +static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); +static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); +static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); +static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); -static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); -static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); -static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); -static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); -static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); -static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); -static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); -static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); -static int decode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); -static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); -static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); -static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); -static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); -static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); -static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); -static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); -static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); -static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); -static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); -static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); -static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); -static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); -static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); -static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); -static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); -static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); -static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); -static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); -static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); -static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); -static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); -static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); -static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); -static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); -static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); -static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); -static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); -static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); -static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); -static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); -static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); -static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); -static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); -static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); -static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); -static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); -static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); -static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); -static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); +static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); +static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); +static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); +static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); +static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); +static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); +static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); +static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); +static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); +static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); +static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); +static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); static int decode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType); -static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); -static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); +static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); +static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); +static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); +static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); +static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); +static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); +static int decode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); +static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); +static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); +static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); +static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); +static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); +static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); +static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); +static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); +static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); +static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); +static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); +static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); +static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); +static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); /* Deviant data decoding (skip functions) */ static int decodeDeviationsCH(bitstream_t* stream) { @@ -171,34 +173,33 @@ static int decodeDeviationsCH(bitstream_t* stream) { } - /* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { int grammarID = 0; int done = 0; - init_v2gPowerDeliveryReqType(v2gPowerDeliveryReqType); + init_v2gProfileEntryType(v2gProfileEntryType); while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gPowerDeliveryReqType->ChargeProgress = (v2gchargeProgressType) uint32; + errn = decodeUnsignedInteger32(stream, &v2gProfileEntryType->ChargingProfileEntryStart); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 1; @@ -214,31 +215,13 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gPowerDeliveryReqType->SAScheduleTupleID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 2; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower); + grammarID = 2; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -247,28 +230,36 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 2: - /* 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); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile); - v2gPowerDeliveryReqType->ChargingProfile_isUsed = 1u; - grammarID = 3; + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &(uint32)); + v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse = (int8_t)(uint32 + 1); + v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 1: - errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 4; - break; - case 2: - errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 4; - break; - case 3: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -277,38 +268,13 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 3: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 4; - break; - case 1: - errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); - v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 4; - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -327,35 +293,56 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe 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_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { - int grammarID = 6; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { + int grammarID = 5; int done = 0; - init_v2gCertificateUpdateReqType(v2gCertificateUpdateReqType); + init_v2gContractSignatureEncryptedPrivateKeyType(v2gContractSignatureEncryptedPrivateKeyType); while(!done) { switch(grammarID) { + case 5: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); + if (errn == 0) { + errn = (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2) <= v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen >= 2) { + v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen = (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen, v2gContractSignatureEncryptedPrivateKeyType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 6; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; case 6: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + /* StartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gCertificateUpdateReqType->Id.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); if (errn == 0) { - errn = (v2gCertificateUpdateReqType->Id.charactersLen - 2) <= v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen) <= v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } if (errn == 0) { - if (v2gCertificateUpdateReqType->Id.charactersLen >= 2) { - v2gCertificateUpdateReqType->Id.charactersLen = (uint16_t)(v2gCertificateUpdateReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCertificateUpdateReqType->Id.charactersLen, v2gCertificateUpdateReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } + errn = decodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes); } - grammarID = 7; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -363,72 +350,13 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 7: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + case 3: + /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain); - grammarID = 8; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 8: - /* 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, &v2gCertificateUpdateReqType->eMAID.charactersLen); - if (errn == 0) { - errn = (v2gCertificateUpdateReqType->eMAID.charactersLen - 2) <= v2gCertificateUpdateReqType_eMAID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCertificateUpdateReqType->eMAID.charactersLen >= 2) { - v2gCertificateUpdateReqType->eMAID.charactersLen = (uint16_t)(v2gCertificateUpdateReqType->eMAID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCertificateUpdateReqType->eMAID.charactersLen, v2gCertificateUpdateReqType->eMAID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 9; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs); + done = 1; grammarID = 4; break; default: @@ -437,2862 +365,6 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { - int grammarID = 10; - int done = 0; - - init_v2gMessageHeaderType(v2gMessageHeaderType); - - while(!done) { - switch(grammarID) { - case 10: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gMessageHeaderType->SessionID.bytesLen); - if (errn == 0) { - errn = (v2gMessageHeaderType->SessionID.bytesLen) <= v2gMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gMessageHeaderType->SessionID.bytesLen, v2gMessageHeaderType->SessionID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification); - v2gMessageHeaderType->Notification_isUsed = 1u; - grammarID = 12; - break; - case 1: - errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); - v2gMessageHeaderType->Signature_isUsed = 1u; - grammarID = 4; - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 12: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); - v2gMessageHeaderType->Signature_isUsed = 1u; - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { - int grammarID = 13; - int done = 0; - - init_v2gBodyBaseType(v2gBodyBaseType); - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { - int grammarID = 14; - int done = 0; - - init_v2gWeldingDetectionResType(v2gWeldingDetectionResType); - - while(!done) { - switch(grammarID) { - case 14: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gWeldingDetectionResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 15: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus); - grammarID = 16; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 16: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { - int grammarID = 17; - int done = 0; - - init_v2gCostType(v2gCostType); - - while(!done) { - switch(grammarID) { - case 17: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gCostType->costKind = (v2gcostKindType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:MsgDataTypes}amount)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gCostType->amount); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 19; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 19: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); - v2gCostType->amountMultiplier = (int8_t)(uint32 -3); - v2gCostType->amountMultiplier_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { - int grammarID = 20; - int done = 0; - - init_v2gCertificateInstallationReqType(v2gCertificateInstallationReqType); - - while(!done) { - switch(grammarID) { - case 20: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->Id.charactersLen); - if (errn == 0) { - errn = (v2gCertificateInstallationReqType->Id.charactersLen - 2) <= v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCertificateInstallationReqType->Id.charactersLen >= 2) { - v2gCertificateInstallationReqType->Id.charactersLen = (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCertificateInstallationReqType->Id.charactersLen, v2gCertificateInstallationReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 21; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 21: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - if (errn == 0) { - errn = (v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 9; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { - int grammarID = 22; - int done = 0; - - init_v2gEntryType(v2gEntryType); - - while(!done) { - switch(grammarID) { - case 22: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval); - v2gEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 4; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gEntryType->TimeInterval); - v2gEntryType->TimeInterval_isUsed = 1u; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { - int grammarID = 23; - int done = 0; - - init_v2gCanonicalizationMethodType(v2gCanonicalizationMethodType); - - while(!done) { - switch(grammarID) { - case 23: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gCanonicalizationMethodType->Algorithm.charactersLen); - if (errn == 0) { - errn = (v2gCanonicalizationMethodType->Algorithm.charactersLen - 2) <= v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCanonicalizationMethodType->Algorithm.charactersLen >= 2) { - v2gCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.charactersLen, v2gCanonicalizationMethodType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 24; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 24: - /* 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 = 25; - break; - case 1: - done = 1; - grammarID = 5; - break; - case 2: - errn = decodeDeviationsCH(stream); - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 25: - /* 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 = 25; - break; - case 1: - done = 1; - grammarID = 5; - break; - case 2: - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { - int grammarID = 26; - int done = 0; - - init_v2gSignaturePropertiesType(v2gSignaturePropertiesType); - - while(!done) { - switch(grammarID) { - case 26: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertiesType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSignaturePropertiesType->Id.charactersLen - 2) <= v2gSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignaturePropertiesType->Id.charactersLen >= 2) { - v2gSignaturePropertiesType->Id.charactersLen = (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertiesType->Id.charactersLen, v2gSignaturePropertiesType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSignaturePropertiesType->Id_isUsed = 1u; - grammarID = 27; - break; - case 1: - if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 28; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 27: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 28; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 28: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 28; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { - int grammarID = 29; - int done = 0; - - init_v2gPaymentServiceSelectionReqType(v2gPaymentServiceSelectionReqType); - - while(!done) { - switch(grammarID) { - case 29: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - v2gPaymentServiceSelectionReqType->SelectedPaymentOption = (v2gpaymentOptionType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 30; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 30: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { - int grammarID = 31; - int done = 0; - - init_v2gAuthorizationResType(v2gAuthorizationResType); - - while(!done) { - switch(grammarID) { - case 31: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gAuthorizationResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 32; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 32: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gAuthorizationResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ -static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { - int grammarID = 33; - int done = 0; - - init_v2gConsumptionCostType(v2gConsumptionCostType); - - while(!done) { - switch(grammarID) { - case 33: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue); - grammarID = 34; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 34: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 35; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 35: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 36; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 36: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ -static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { - int grammarID = 37; - int done = 0; - - init_v2gCertificateInstallationResType(v2gCertificateInstallationResType); - - while(!done) { - switch(grammarID) { - case 37: - /* 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); - v2gCertificateInstallationResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 38; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 38: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain); - grammarID = 39; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 39: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain); - grammarID = 40; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 40: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey); - grammarID = 41; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey); - grammarID = 42; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { - int grammarID = 43; - int done = 0; - - init_v2gSessionStopResType(v2gSessionStopResType); - - while(!done) { - switch(grammarID) { - case 43: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gSessionStopResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ -static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { - int grammarID = 44; - int done = 0; - - init_v2gServiceListType(v2gServiceListType); - - while(!done) { - switch(grammarID) { - case 44: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 46; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 46: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 47; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 47: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 48; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 48: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 49; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 49: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 50; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 50: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 51; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 51: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { - errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { - int grammarID = 13; - int done = 0; - - init_v2gEVSEChargeParameterType(v2gEVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { - int grammarID = 52; - int done = 0; - - init_v2gMeteringReceiptReqType(v2gMeteringReceiptReqType); - - while(!done) { - switch(grammarID) { - case 52: - /* 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, &v2gMeteringReceiptReqType->Id.charactersLen); - if (errn == 0) { - errn = (v2gMeteringReceiptReqType->Id.charactersLen - 2) <= v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gMeteringReceiptReqType->Id.charactersLen >= 2) { - v2gMeteringReceiptReqType->Id.charactersLen = (uint16_t)(v2gMeteringReceiptReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gMeteringReceiptReqType->Id.charactersLen, v2gMeteringReceiptReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gMeteringReceiptReqType->Id_isUsed = 1u; - grammarID = 53; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gMeteringReceiptReqType->SessionID.bytesLen); - if (errn == 0) { - errn = (v2gMeteringReceiptReqType->SessionID.bytesLen) <= v2gMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytesLen, v2gMeteringReceiptReqType->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 = 54; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 53: - /* 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, &v2gMeteringReceiptReqType->SessionID.bytesLen); - if (errn == 0) { - errn = (v2gMeteringReceiptReqType->SessionID.bytesLen) <= v2gMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytesLen, v2gMeteringReceiptReqType->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 = 54; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 54: - /* 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)); - v2gMeteringReceiptReqType->SAScheduleTupleID = (uint8_t)(uint32 + 1); - v2gMeteringReceiptReqType->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 = 55; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = decode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 55: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { - int grammarID = 56; - int done = 0; - - init_v2gX509IssuerSerialType(v2gX509IssuerSerialType); - - while(!done) { - switch(grammarID) { - case 56: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509IssuerSerialType->X509IssuerName.charactersLen); - if (errn == 0) { - errn = (v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gX509IssuerSerialType->X509IssuerName.charactersLen >= 2) { - v2gX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.charactersLen, v2gX509IssuerSerialType->X509IssuerName.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 57; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 57: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gX509IssuerSerialType->X509SerialNumber); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { - int grammarID = 58; - int done = 0; - - init_v2gSignatureType(v2gSignatureType); - - while(!done) { - switch(grammarID) { - case 58: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignatureType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSignatureType->Id.charactersLen - 2) <= v2gSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignatureType->Id.charactersLen >= 2) { - v2gSignatureType->Id.charactersLen = (uint16_t)(v2gSignatureType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignatureType->Id.charactersLen, v2gSignatureType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSignatureType->Id_isUsed = 1u; - grammarID = 59; - break; - case 1: - errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 59: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 60: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue); - grammarID = 61; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 61: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo); - v2gSignatureType->KeyInfo_isUsed = 1u; - grammarID = 62; - break; - case 1: - if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { - errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 62; - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 62: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { - errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 62; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { - int grammarID = 13; - int done = 0; - - init_v2gEVPowerDeliveryParameterType(v2gEVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { - int grammarID = 63; - int done = 0; - - init_v2gAC_EVSEChargeParameterType(v2gAC_EVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 63: - /* 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_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus); - grammarID = 64; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 64: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage); - grammarID = 65; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 65: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType) { - int grammarID = 66; - int done = 0; - - init_v2gSAScheduleListType(v2gSAScheduleListType); - - while(!done) { - switch(grammarID) { - case 66: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSAScheduleListType->SAScheduleTuple.arrayLen < v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { - errn = decode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array[v2gSAScheduleListType->SAScheduleTuple.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 67; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 67: - /* 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 (v2gSAScheduleListType->SAScheduleTuple.arrayLen < v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { - errn = decode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array[v2gSAScheduleListType->SAScheduleTuple.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 68; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 68: - /* 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 (v2gSAScheduleListType->SAScheduleTuple.arrayLen < v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { - errn = decode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array[v2gSAScheduleListType->SAScheduleTuple.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { - int grammarID = 69; - int done = 0; - - init_v2gDC_EVPowerDeliveryParameterType(v2gDC_EVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { - case 69: - /* 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_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus); - grammarID = 70; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 70: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); - v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 71; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 71: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { - int grammarID = 72; - int done = 0; - - init_v2gServiceDiscoveryResType(v2gServiceDiscoveryResType); - - while(!done) { - switch(grammarID) { - case 72: - /* 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); - v2gServiceDiscoveryResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 73; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList); - grammarID = 74; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 74: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService); - grammarID = 75; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 75: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList); - v2gServiceDiscoveryResType->ServiceList_isUsed = 1u; - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { - int grammarID = 76; - int done = 0; - - init_v2gServiceParameterListType(v2gServiceParameterListType); - - while(!done) { - switch(grammarID) { - case 76: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 77; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 77: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 77; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { - int grammarID = 78; - int done = 0; - - init_v2gDC_EVChargeParameterType(v2gDC_EVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 78: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gDC_EVChargeParameterType->DepartureTime); - v2gDC_EVChargeParameterType->DepartureTime_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 79; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); - grammarID = 80; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); - grammarID = 80; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 80: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit); - grammarID = 81; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit); - v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 82; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 83; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 83; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity); - v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; - grammarID = 84; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); - v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 85; - break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 86; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 84: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); - v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 85; - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 86; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 85: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 86; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 86: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; default: errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; @@ -3306,14 +378,14 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ /* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { - int grammarID = 87; + int grammarID = 7; int done = 0; init_v2gServiceDiscoveryReqType(v2gServiceDiscoveryReqType); while(!done) { switch(grammarID) { - case 87: + case 7: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -3346,7 +418,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 88; + grammarID = 8; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -3369,7 +441,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -3377,7 +449,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ break; case 2: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3385,7 +457,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ } } break; - case 88: + case 8: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -3407,7 +479,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -3415,7 +487,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ break; case 1: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3423,14 +495,14 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3449,46 +521,40 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { - int grammarID = 89; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { + int grammarID = 9; int done = 0; - init_v2gSignatureValueType(v2gSignatureValueType); + init_v2gSignatureType(v2gSignatureType); while(!done) { switch(grammarID) { - case 89: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + case 9: + /* 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, &v2gSignatureValueType->Id.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gSignatureType->Id.charactersLen); if (errn == 0) { - errn = (v2gSignatureValueType->Id.charactersLen - 2) <= v2gSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gSignatureType->Id.charactersLen - 2) <= v2gSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gSignatureValueType->Id.charactersLen >= 2) { - v2gSignatureValueType->Id.charactersLen = (uint16_t)(v2gSignatureValueType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignatureValueType->Id.charactersLen, v2gSignatureValueType->Id.characters); + if (v2gSignatureType->Id.charactersLen >= 2) { + v2gSignatureType->Id.charactersLen = (uint16_t)(v2gSignatureType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignatureType->Id.charactersLen, v2gSignatureType->Id.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - v2gSignatureValueType->Id_isUsed = 1u; - grammarID = 90; + v2gSignatureType->Id_isUsed = 1u; + grammarID = 10; break; case 1: - errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); - } - grammarID = 4; + errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3496,20 +562,14 @@ static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignature } } break; - case 90: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ + case 10: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); - } - grammarID = 4; + errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); + grammarID = 11; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3517,14 +577,14 @@ static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignature } } break; - case 4: - /* Element[END_ELEMENT] */ + case 11: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 5; + errn = decode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue); + grammarID = 12; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3532,1031 +592,26 @@ static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignature } } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { - int grammarID = 91; - int done = 0; - - init_v2gBodyType(v2gBodyType); - - while(!done) { - switch(grammarID) { - case 91: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq); - v2gBodyType->AuthorizationReq_isUsed = 1u; - grammarID = 4; - break; - case 1: - errn = decode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes); - v2gBodyType->AuthorizationRes_isUsed = 1u; - grammarID = 4; - break; - case 2: - errn = decode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement); - v2gBodyType->BodyElement_isUsed = 1u; - grammarID = 4; - break; - case 3: - errn = decode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq); - v2gBodyType->CableCheckReq_isUsed = 1u; - grammarID = 4; - break; - case 4: - errn = decode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes); - v2gBodyType->CableCheckRes_isUsed = 1u; - grammarID = 4; - break; - case 5: - errn = decode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq); - v2gBodyType->CertificateInstallationReq_isUsed = 1u; - grammarID = 4; - break; - case 6: - errn = decode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes); - v2gBodyType->CertificateInstallationRes_isUsed = 1u; - grammarID = 4; - break; - case 7: - errn = decode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq); - v2gBodyType->CertificateUpdateReq_isUsed = 1u; - grammarID = 4; - break; - case 8: - errn = decode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes); - v2gBodyType->CertificateUpdateRes_isUsed = 1u; - grammarID = 4; - break; - case 9: - errn = decode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq); - v2gBodyType->ChargeParameterDiscoveryReq_isUsed = 1u; - grammarID = 4; - break; - case 10: - errn = decode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes); - v2gBodyType->ChargeParameterDiscoveryRes_isUsed = 1u; - grammarID = 4; - break; - case 11: - errn = decode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq); - v2gBodyType->ChargingStatusReq_isUsed = 1u; - grammarID = 4; - break; - case 12: - errn = decode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes); - v2gBodyType->ChargingStatusRes_isUsed = 1u; - grammarID = 4; - break; - case 13: - errn = decode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq); - v2gBodyType->CurrentDemandReq_isUsed = 1u; - grammarID = 4; - break; - case 14: - errn = decode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes); - v2gBodyType->CurrentDemandRes_isUsed = 1u; - grammarID = 4; - break; - case 15: - errn = decode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq); - v2gBodyType->MeteringReceiptReq_isUsed = 1u; - grammarID = 4; - break; - case 16: - errn = decode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes); - v2gBodyType->MeteringReceiptRes_isUsed = 1u; - grammarID = 4; - break; - case 17: - errn = decode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq); - v2gBodyType->PaymentDetailsReq_isUsed = 1u; - grammarID = 4; - break; - case 18: - errn = decode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes); - v2gBodyType->PaymentDetailsRes_isUsed = 1u; - grammarID = 4; - break; - case 19: - errn = decode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq); - v2gBodyType->PaymentServiceSelectionReq_isUsed = 1u; - grammarID = 4; - break; - case 20: - errn = decode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes); - v2gBodyType->PaymentServiceSelectionRes_isUsed = 1u; - grammarID = 4; - break; - case 21: - errn = decode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq); - v2gBodyType->PowerDeliveryReq_isUsed = 1u; - grammarID = 4; - break; - case 22: - errn = decode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes); - v2gBodyType->PowerDeliveryRes_isUsed = 1u; - grammarID = 4; - break; - case 23: - errn = decode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq); - v2gBodyType->PreChargeReq_isUsed = 1u; - grammarID = 4; - break; - case 24: - errn = decode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes); - v2gBodyType->PreChargeRes_isUsed = 1u; - grammarID = 4; - break; - case 25: - errn = decode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq); - v2gBodyType->ServiceDetailReq_isUsed = 1u; - grammarID = 4; - break; - case 26: - errn = decode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes); - v2gBodyType->ServiceDetailRes_isUsed = 1u; - grammarID = 4; - break; - case 27: - errn = decode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq); - v2gBodyType->ServiceDiscoveryReq_isUsed = 1u; - grammarID = 4; - break; - case 28: - errn = decode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes); - v2gBodyType->ServiceDiscoveryRes_isUsed = 1u; - grammarID = 4; - break; - case 29: - errn = decode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq); - v2gBodyType->SessionSetupReq_isUsed = 1u; - grammarID = 4; - break; - case 30: - errn = decode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes); - v2gBodyType->SessionSetupRes_isUsed = 1u; - grammarID = 4; - break; - case 31: - errn = decode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq); - v2gBodyType->SessionStopReq_isUsed = 1u; - grammarID = 4; - break; - case 32: - errn = decode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes); - v2gBodyType->SessionStopRes_isUsed = 1u; - grammarID = 4; - break; - case 33: - errn = decode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq); - v2gBodyType->WeldingDetectionReq_isUsed = 1u; - grammarID = 4; - break; - case 34: - errn = decode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes); - v2gBodyType->WeldingDetectionRes_isUsed = 1u; - grammarID = 4; - break; - case 35: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ -static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { - int grammarID = 92; - int done = 0; - - init_v2gPaymentDetailsResType(v2gPaymentDetailsResType); - - while(!done) { - switch(grammarID) { - case 92: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gPaymentDetailsResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 93; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 93: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsResType->GenChallenge.bytesLen); - if (errn == 0) { - errn = (v2gPaymentDetailsResType->GenChallenge.bytesLen) <= v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytesLen, v2gPaymentDetailsResType->GenChallenge.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 94; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gPaymentDetailsResType->EVSETimeStamp); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { - int grammarID = 95; - int done = 0; - - init_v2gMeteringReceiptResType(v2gMeteringReceiptResType); - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gMeteringReceiptResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 96: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + case 12: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus); - v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 1u; - grammarID = 4; + errn = decode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo); + v2gSignatureType->KeyInfo_isUsed = 1u; + grammarID = 13; break; case 1: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus); - v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 1u; - grammarID = 4; - break; - case 2: - errn = decode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus); - v2gMeteringReceiptResType->EVSEStatus_isUsed = 1u; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType) { - int grammarID = 97; - int done = 0; - - init_v2gRSAKeyValueType(v2gRSAKeyValueType); - - while(!done) { - switch(grammarID) { - case 97: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Modulus.bytesLen); - if (errn == 0) { - errn = (v2gRSAKeyValueType->Modulus.bytesLen) <= v2gRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gRSAKeyValueType->Modulus.bytesLen, v2gRSAKeyValueType->Modulus.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 98; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 98: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Exponent.bytesLen); - if (errn == 0) { - errn = (v2gRSAKeyValueType->Exponent.bytesLen) <= v2gRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gRSAKeyValueType->Exponent.bytesLen, v2gRSAKeyValueType->Exponent.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { - int grammarID = 99; - int done = 0; - - init_v2gSessionSetupReqType(v2gSessionSetupReqType); - - while(!done) { - switch(grammarID) { - case 99: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSessionSetupReqType->EVCCID.bytesLen); - if (errn == 0) { - errn = (v2gSessionSetupReqType->EVCCID.bytesLen) <= v2gSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytesLen, v2gSessionSetupReqType->EVCCID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { - int grammarID = 100; - int done = 0; - - init_v2gSignedInfoType(v2gSignedInfoType); - - while(!done) { - switch(grammarID) { - case 100: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignedInfoType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSignedInfoType->Id.charactersLen - 2) <= v2gSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignedInfoType->Id.charactersLen >= 2) { - v2gSignedInfoType->Id.charactersLen = (uint16_t)(v2gSignedInfoType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignedInfoType->Id.charactersLen, v2gSignedInfoType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSignedInfoType->Id_isUsed = 1u; - grammarID = 101; - break; - case 1: - errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); - grammarID = 102; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 101: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); - grammarID = 102; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 102: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod); - grammarID = 103; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 103: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); + if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { + errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 104; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 104: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 104; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { - int grammarID = 105; - int done = 0; - - init_v2gAuthorizationReqType(v2gAuthorizationReqType); - - while(!done) { - switch(grammarID) { - case 105: - /* 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, &v2gAuthorizationReqType->Id.charactersLen); - if (errn == 0) { - errn = (v2gAuthorizationReqType->Id.charactersLen - 2) <= v2gAuthorizationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gAuthorizationReqType->Id.charactersLen >= 2) { - v2gAuthorizationReqType->Id.charactersLen = (uint16_t)(v2gAuthorizationReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gAuthorizationReqType->Id.charactersLen, v2gAuthorizationReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gAuthorizationReqType->Id_isUsed = 1u; - grammarID = 106; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->GenChallenge.bytesLen); - if (errn == 0) { - errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); - } - v2gAuthorizationReqType->GenChallenge_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + grammarID = 13; break; case 2: done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 106: - /* 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, &v2gAuthorizationReqType->GenChallenge.bytesLen); - if (errn == 0) { - errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); - } - v2gAuthorizationReqType->GenChallenge_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { - int grammarID = 107; - int done = 0; - - init_v2gChargingProfileType(v2gChargingProfileType); - - while(!done) { - switch(grammarID) { - case 107: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 108; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 108: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 108; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { - int grammarID = 109; - int done = 0; - - init_v2gDiffieHellmanPublickeyType(v2gDiffieHellmanPublickeyType); - - while(!done) { - switch(grammarID) { - case 109: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->Id.charactersLen); - if (errn == 0) { - errn = (v2gDiffieHellmanPublickeyType->Id.charactersLen - 2) <= v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gDiffieHellmanPublickeyType->Id.charactersLen >= 2) { - v2gDiffieHellmanPublickeyType->Id.charactersLen = (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.charactersLen, v2gDiffieHellmanPublickeyType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 90; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 90: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gDiffieHellmanPublickeyType->CONTENT.bytesLen) <= v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen, v2gDiffieHellmanPublickeyType->CONTENT.bytes); - } grammarID = 4; break; default: @@ -4565,1984 +620,22 @@ static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD } } break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType) { - int grammarID = 110; - int done = 0; - - init_v2gSelectedServiceType(v2gSelectedServiceType); - - while(!done) { - switch(grammarID) { - case 110: - /* 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, &v2gSelectedServiceType->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 = 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}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, &v2gSelectedServiceType->ParameterSetID); - v2gSelectedServiceType->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 = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ -static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { - int grammarID = 112; - int done = 0; - - init_v2gSubCertificatesType(v2gSubCertificatesType); - - while(!done) { - switch(grammarID) { - case 112: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 113; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 114; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 114: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 115; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 115: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); - } - v2gSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { - int grammarID = 116; - int done = 0; - - init_v2gCertificateChainType(v2gCertificateChainType); - - while(!done) { - switch(grammarID) { - case 116: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Id.charactersLen); - if (errn == 0) { - errn = (v2gCertificateChainType->Id.charactersLen - 2) <= v2gCertificateChainType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCertificateChainType->Id.charactersLen >= 2) { - v2gCertificateChainType->Id.charactersLen = (uint16_t)(v2gCertificateChainType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCertificateChainType->Id.charactersLen, v2gCertificateChainType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gCertificateChainType->Id_isUsed = 1u; - grammarID = 117; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); - if (errn == 0) { - errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 118; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 117: - /* 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, &v2gCertificateChainType->Certificate.bytesLen); - if (errn == 0) { - errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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}SubCertificates), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates); - v2gCertificateChainType->SubCertificates_isUsed = 1u; - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ -static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { - int grammarID = 119; - int done = 0; - - init_v2gSupportedEnergyTransferModeType(v2gSupportedEnergyTransferModeType); - - while(!done) { - switch(grammarID) { - case 119: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 120; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 120: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 121; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 121: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 122; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 123; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 124; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 124: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { - int grammarID = 125; - int done = 0; - - init_v2gCurrentDemandReqType(v2gCurrentDemandReqType); - - while(!done) { - switch(grammarID) { - case 125: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus); - grammarID = 126; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 126: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent); - grammarID = 127; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit); - v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; - grammarID = 128; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); - v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 129; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 130; - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 131; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 132; - } 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}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); - v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 129; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 130; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 131; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 132; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 129: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 130; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 131; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 132; - } 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}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); - v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 131; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 132; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 131: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 132; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 132: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC); - v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; - grammarID = 133; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); - v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 134; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 133: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); - v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 134; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 134: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { - int grammarID = 135; - int done = 0; - - init_v2gSalesTariffType(v2gSalesTariffType); - - while(!done) { - switch(grammarID) { - case 135: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSalesTariffType->Id.charactersLen - 2) <= v2gSalesTariffType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSalesTariffType->Id.charactersLen >= 2) { - v2gSalesTariffType->Id.charactersLen = (uint16_t)(v2gSalesTariffType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSalesTariffType->Id.charactersLen, v2gSalesTariffType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSalesTariffType->Id_isUsed = 1u; - grammarID = 136; - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 137; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 136: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 137; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 137: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->SalesTariffDescription.charactersLen); - if (errn == 0) { - errn = (v2gSalesTariffType->SalesTariffDescription.charactersLen - 2) <= v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSalesTariffType->SalesTariffDescription.charactersLen >= 2) { - v2gSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.charactersLen, v2gSalesTariffType->SalesTariffDescription.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSalesTariffType->SalesTariffDescription_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 138; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 139; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 140; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 138: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 139; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 140; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 139: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 140; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 140: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 140; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { - int grammarID = 141; - int done = 0; - - init_v2gEMAIDType(v2gEMAIDType); - - while(!done) { - switch(grammarID) { - case 141: - /* 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, &v2gEMAIDType->Id.charactersLen); - if (errn == 0) { - errn = (v2gEMAIDType->Id.charactersLen - 2) <= v2gEMAIDType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gEMAIDType->Id.charactersLen >= 2) { - v2gEMAIDType->Id.charactersLen = (uint16_t)(v2gEMAIDType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gEMAIDType->Id.charactersLen, v2gEMAIDType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 142; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 142: - /* StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gEMAIDType->CONTENT.charactersLen); - if (errn == 0) { - errn = (v2gEMAIDType->CONTENT.charactersLen - 2) <= v2gEMAIDType_CONTENT_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gEMAIDType->CONTENT.charactersLen >= 2) { - v2gEMAIDType->CONTENT.charactersLen = (uint16_t)(v2gEMAIDType->CONTENT.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gEMAIDType->CONTENT.charactersLen, v2gEMAIDType->CONTENT.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType) { - int grammarID = 143; - int done = 0; - - init_v2gCableCheckReqType(v2gCableCheckReqType); - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gCableCheckReqType->DC_EVStatus); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { - int grammarID = 14; - int done = 0; - - init_v2gPreChargeResType(v2gPreChargeResType); - - while(!done) { - switch(grammarID) { - case 14: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gPreChargeResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 15: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus); - grammarID = 16; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 16: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType) { - int grammarID = 13; - int done = 0; - - init_v2gEVStatusType(v2gEVStatusType); - - while(!done) { - switch(grammarID) { case 13: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { - int grammarID = 144; - int done = 0; - - init_v2gPhysicalValueType(v2gPhysicalValueType); - - while(!done) { - switch(grammarID) { - case 144: - /* 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)); - v2gPhysicalValueType->Multiplier = (int8_t)(uint32 -3); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier) ? */ - 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: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); - v2gPhysicalValueType->Unit = (v2gunitSymbolType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit) ? */ - 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: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, &v2gPhysicalValueType->Value); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { - int grammarID = 109; - int done = 0; - - init_v2gContractSignatureEncryptedPrivateKeyType(v2gContractSignatureEncryptedPrivateKeyType); - - while(!done) { - switch(grammarID) { - case 109: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); - if (errn == 0) { - errn = (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2) <= v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen >= 2) { - v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen = (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen, v2gContractSignatureEncryptedPrivateKeyType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 90; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 90: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); - if (errn == 0) { - errn = (v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen) <= v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes); - } - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { - int grammarID = 147; - int done = 0; - - init_v2gPMaxScheduleType(v2gPMaxScheduleType); - - while(!done) { - switch(grammarID) { - case 147: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { - errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 148; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 148: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + /* 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 (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { - errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); + if (v2gSignatureType->Object.arrayLen < v2gSignatureType_Object_ARRAY_SIZE) { + errn = decode_v2gObjectType(stream, &v2gSignatureType->Object.array[v2gSignatureType->Object.arrayLen++]); } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 148; + grammarID = 13; break; case 1: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6563,14 +656,14 @@ static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxSchedul /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType) { - int grammarID = 149; + int grammarID = 14; int done = 0; init_v2gNotificationType(v2gNotificationType); while(!done) { switch(grammarID) { - case 149: + case 14: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6591,7 +684,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 150; + grammarID = 15; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6603,7 +696,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio } } break; - case 150: + case 15: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -6636,7 +729,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6644,7 +737,7 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio break; case 1: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6652,14 +745,14 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6678,23 +771,2399 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { - int grammarID = 13; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ +static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { + int grammarID = 16; int done = 0; - init_v2gChargingStatusReqType(v2gChargingStatusReqType); + init_v2gAC_EVSEChargeParameterType(v2gAC_EVSEChargeParameterType); while(!done) { switch(grammarID) { - case 13: + case 16: + /* 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_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus); + grammarID = 17; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 17: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage); + grammarID = 18; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 18: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { + int grammarID = 19; + int done = 0; + + init_v2gX509IssuerSerialType(v2gX509IssuerSerialType); + + while(!done) { + switch(grammarID) { + case 19: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509IssuerSerialType->X509IssuerName.charactersLen); + if (errn == 0) { + errn = (v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gX509IssuerSerialType->X509IssuerName.charactersLen >= 2) { + v2gX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.charactersLen, v2gX509IssuerSerialType->X509IssuerName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 20; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 20: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gX509IssuerSerialType->X509SerialNumber); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { + int grammarID = 21; + int done = 0; + + init_v2gSignaturePropertyType(v2gSignaturePropertyType); + + while(!done) { + switch(grammarID) { + case 21: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertyType->Id.charactersLen - 2) <= v2gSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertyType->Id.charactersLen >= 2) { + v2gSignaturePropertyType->Id.charactersLen = (uint16_t)(v2gSignaturePropertyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertyType->Id.charactersLen, v2gSignaturePropertyType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignaturePropertyType->Id_isUsed = 1u; + grammarID = 22; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertyType->Target.charactersLen >= 2) { + v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 23; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 22: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertyType->Target.charactersLen >= 2) { + v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 23; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 23: + /* 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 = 24; + break; + case 1: + errn = decodeDeviationsCH(stream); + grammarID = 25; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 25: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + grammarID = 25; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { + int grammarID = 26; + int done = 0; + + init_v2gReferenceType(v2gReferenceType); + + while(!done) { + switch(grammarID) { + case 26: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Id.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->Id.charactersLen - 2) <= v2gReferenceType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gReferenceType->Id.charactersLen >= 2) { + v2gReferenceType->Id.charactersLen = (uint16_t)(v2gReferenceType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->Id.charactersLen, v2gReferenceType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->Id_isUsed = 1u; + grammarID = 27; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gReferenceType->Type.charactersLen >= 2) { + v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->Type_isUsed = 1u; + grammarID = 28; + break; + case 2: + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gReferenceType->URI.charactersLen >= 2) { + v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->URI_isUsed = 1u; + grammarID = 29; + break; + case 3: + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; + grammarID = 30; + break; + case 4: + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 27: + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gReferenceType->Type.charactersLen >= 2) { + v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->Type_isUsed = 1u; + grammarID = 28; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gReferenceType->URI.charactersLen >= 2) { + v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->URI_isUsed = 1u; + grammarID = 29; + break; + case 2: + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; + grammarID = 30; + break; + case 3: + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 28: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gReferenceType->URI.charactersLen >= 2) { + v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gReferenceType->URI_isUsed = 1u; + grammarID = 29; + break; + case 1: + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; + grammarID = 30; + break; + case 2: + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 29: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); + v2gReferenceType->Transforms_isUsed = 1u; + grammarID = 30; + break; + case 1: + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 30: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); + grammarID = 31; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 31: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gReferenceType->DigestValue.bytesLen); + if (errn == 0) { + errn = (v2gReferenceType->DigestValue.bytesLen) <= v2gReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gReferenceType->DigestValue.bytesLen, v2gReferenceType->DigestValue.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = 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_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType) { + int grammarID = 32; + int done = 0; + + init_v2gManifestType(v2gManifestType); + + while(!done) { + switch(grammarID) { + case 32: + /* 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, &v2gManifestType->Id.charactersLen); + if (errn == 0) { + errn = (v2gManifestType->Id.charactersLen - 2) <= v2gManifestType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gManifestType->Id.charactersLen >= 2) { + v2gManifestType->Id.charactersLen = (uint16_t)(v2gManifestType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gManifestType->Id.charactersLen, v2gManifestType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gManifestType->Id_isUsed = 1u; + grammarID = 33; + break; + case 1: + if (v2gManifestType->Reference.arrayLen < v2gManifestType_Reference_ARRAY_SIZE) { + errn = decode_v2gReferenceType(stream, &v2gManifestType->Reference.array[v2gManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 34; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 33: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gManifestType->Reference.arrayLen < v2gManifestType_Reference_ARRAY_SIZE) { + errn = decode_v2gReferenceType(stream, &v2gManifestType->Reference.array[v2gManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 34; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 34: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gManifestType->Reference.arrayLen < v2gManifestType_Reference_ARRAY_SIZE) { + errn = decode_v2gReferenceType(stream, &v2gManifestType->Reference.array[v2gManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 34; + 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,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType) { + int grammarID = 35; + int done = 0; + + init_v2gSelectedServiceType(v2gSelectedServiceType); + + while(!done) { + switch(grammarID) { + case 35: + /* 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, &v2gSelectedServiceType->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 = 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}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, &v2gSelectedServiceType->ParameterSetID); + v2gSelectedServiceType->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,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { + int grammarID = 37; + int done = 0; + + init_v2gEVChargeParameterType(v2gEVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 37: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gEVChargeParameterType->DepartureTime); + v2gEVChargeParameterType->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { + int grammarID = 38; + int done = 0; + + init_v2gEVSEChargeParameterType(v2gEVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 38: /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { + int grammarID = 39; + int done = 0; + + init_v2gChargingStatusResType(v2gChargingStatusResType); + + while(!done) { + switch(grammarID) { + case 39: + /* 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); + v2gChargingStatusResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}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}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, &v2gChargingStatusResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gChargingStatusResType->EVSEID.charactersLen - 2) <= v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gChargingStatusResType->EVSEID.charactersLen >= 2) { + v2gChargingStatusResType->EVSEID.charactersLen = (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gChargingStatusResType->EVSEID.charactersLen, v2gChargingStatusResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 41; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 41: + /* 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)); + v2gChargingStatusResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 42; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 42: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent); + v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; + grammarID = 43; + break; + case 1: + errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); + v2gChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 44; + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); + v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 45; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 43: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); + v2gChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 44; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); + v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 45; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 44: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); + v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 45; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 45: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* 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_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { + int grammarID = 46; + int done = 0; + + init_v2gEVSEStatusType(v2gEVSEStatusType); + + while(!done) { + switch(grammarID) { + case 46: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gEVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 47; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 47: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gEVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { + int grammarID = 48; + int done = 0; + + init_v2gMeteringReceiptReqType(v2gMeteringReceiptReqType); + + while(!done) { + switch(grammarID) { + case 48: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gMeteringReceiptReqType->Id.charactersLen); + if (errn == 0) { + errn = (v2gMeteringReceiptReqType->Id.charactersLen - 2) <= v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gMeteringReceiptReqType->Id.charactersLen >= 2) { + v2gMeteringReceiptReqType->Id.charactersLen = (uint16_t)(v2gMeteringReceiptReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gMeteringReceiptReqType->Id.charactersLen, v2gMeteringReceiptReqType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gMeteringReceiptReqType->Id_isUsed = 1u; + grammarID = 49; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gMeteringReceiptReqType->SessionID.bytesLen); + if (errn == 0) { + errn = (v2gMeteringReceiptReqType->SessionID.bytesLen) <= v2gMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytesLen, v2gMeteringReceiptReqType->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 = 50; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 49: + /* 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, &v2gMeteringReceiptReqType->SessionID.bytesLen); + if (errn == 0) { + errn = (v2gMeteringReceiptReqType->SessionID.bytesLen) <= v2gMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytesLen, v2gMeteringReceiptReqType->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 = 50; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 50: + /* 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)); + v2gMeteringReceiptReqType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + v2gMeteringReceiptReqType->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 = 51; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 51: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo); + grammarID = 3; + 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_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { + int grammarID = 52; + int done = 0; + + init_v2gDC_EVSEChargeParameterType(v2gDC_EVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 52: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus); + grammarID = 53; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); + grammarID = 54; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 54: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); + grammarID = 55; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 55: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); + grammarID = 56; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 56: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); + grammarID = 57; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 57: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); + grammarID = 58; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 58: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); + v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; + grammarID = 59; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 60; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 59: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 60; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 60: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); + v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { + int grammarID = 61; + int done = 0; + + init_v2gServiceDetailResType(v2gServiceDetailResType); + + while(!done) { + switch(grammarID) { + case 61: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gServiceDetailResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 62; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 62: + /* 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, &v2gServiceDetailResType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 63; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 63: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList); + v2gServiceDetailResType->ServiceParameterList_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* 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,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { + int grammarID = 64; + int done = 0; + + init_v2gCertificateChainType(v2gCertificateChainType); + + while(!done) { + switch(grammarID) { + case 64: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Id.charactersLen); + if (errn == 0) { + errn = (v2gCertificateChainType->Id.charactersLen - 2) <= v2gCertificateChainType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCertificateChainType->Id.charactersLen >= 2) { + v2gCertificateChainType->Id.charactersLen = (uint16_t)(v2gCertificateChainType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCertificateChainType->Id.charactersLen, v2gCertificateChainType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gCertificateChainType->Id_isUsed = 1u; + grammarID = 65; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); + if (errn == 0) { + errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 66; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 65: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); + if (errn == 0) { + errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gCertificateChainType->Certificate.bytesLen, v2gCertificateChainType->Certificate.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 66; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 66: + /* 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_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates); + v2gCertificateChainType->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='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { + int grammarID = 67; + int done = 0; + + init_v2gCanonicalizationMethodType(v2gCanonicalizationMethodType); + + while(!done) { + switch(grammarID) { + case 67: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gCanonicalizationMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (v2gCanonicalizationMethodType->Algorithm.charactersLen - 2) <= v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCanonicalizationMethodType->Algorithm.charactersLen >= 2) { + v2gCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.charactersLen, v2gCanonicalizationMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 68; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 68: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { + int grammarID = 69; + int done = 0; + + init_v2gMeteringReceiptResType(v2gMeteringReceiptResType); + + while(!done) { + switch(grammarID) { + case 69: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gMeteringReceiptResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 70; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus); + v2gMeteringReceiptResType->AC_EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus); + v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus); + v2gMeteringReceiptResType->EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + int grammarID = 71; + int done = 0; + + init_v2gPowerDeliveryReqType(v2gPowerDeliveryReqType); + + while(!done) { + switch(grammarID) { + case 71: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gPowerDeliveryReqType->ChargeProgress = (v2gchargeProgressType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 72; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 72: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gPowerDeliveryReqType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 73; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile); + v2gPowerDeliveryReqType->ChargingProfile_isUsed = 1u; + grammarID = 74; + break; + case 1: + errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 74: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter); + v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { + int grammarID = 75; + int done = 0; + + init_v2gPMaxScheduleType(v2gPMaxScheduleType); + + while(!done) { + switch(grammarID) { + case 75: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { + errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 76; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 76: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen < v2gPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { + errn = decode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array[v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 76; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ +static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { + int grammarID = 77; + int done = 0; + + init_v2gSessionStopReqType(v2gSessionStopReqType); + + while(!done) { + switch(grammarID) { + case 77: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gSessionStopReqType->ChargingSession = (v2gchargingSessionType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6715,14 +3184,14 @@ static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargi /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType) { - int grammarID = 151; + int grammarID = 78; int done = 0; init_v2gChargeServiceType(v2gChargeServiceType); while(!done) { switch(grammarID) { - case 151: + case 78: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6742,7 +3211,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 152; + grammarID = 79; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6754,7 +3223,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ } } break; - case 152: + case 79: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -6787,7 +3256,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 153; + grammarID = 80; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6809,7 +3278,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 154; + grammarID = 81; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6821,7 +3290,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ } } break; - case 153: + case 80: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6842,7 +3311,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 154; + grammarID = 81; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6854,7 +3323,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ } } break; - case 154: + case 81: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -6887,7 +3356,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 155; + grammarID = 82; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6908,7 +3377,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 156; + grammarID = 83; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6920,7 +3389,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ } } break; - case 155: + case 82: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6940,7 +3409,7 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 156; + grammarID = 83; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6952,14 +3421,14 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ } } break; - case 156: + case 83: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode); - grammarID = 4; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6967,92 +3436,13 @@ static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServ } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { - int grammarID = 95; - int done = 0; - - init_v2gPowerDeliveryResType(v2gPowerDeliveryResType); - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gPowerDeliveryResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 96; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 96: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus); - v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; - grammarID = 4; - break; - case 1: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus); - v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; - grammarID = 4; - break; - case 2: - errn = decode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus); - v2gPowerDeliveryResType->EVSEStatus_isUsed = 1u; grammarID = 4; break; default: @@ -7061,21 +3451,6 @@ static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDe } } break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; default: errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; @@ -7087,555 +3462,35 @@ static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDe return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ -static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { - int grammarID = 157; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { + int grammarID = 84; int done = 0; - init_v2gEVSEStatusType(v2gEVSEStatusType); + init_v2gParameterType(v2gParameterType); while(!done) { switch(grammarID) { - case 157: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + case 84: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gEVSEStatusType->NotificationMaxDelay); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 158; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 158: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gEVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { - int grammarID = 159; - int done = 0; - - init_v2gX509DataType(v2gX509DataType); - - while(!done) { - switch(grammarID) { - case 159: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 160; - break; - case 1: - if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); - } - v2gX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { - v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); - } - v2gX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); - } - v2gX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } 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 = 160; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 160: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 160; - break; - case 1: - if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); - } - v2gX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { - v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); - } - v2gX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); - } - v2gX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 160; - } 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 = 160; - break; - case 6: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { - int grammarID = 161; - int done = 0; - - init_v2gPreChargeReqType(v2gPreChargeReqType); - - while(!done) { - switch(grammarID) { - case 161: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus); - grammarID = 162; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 162: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage); - grammarID = 163; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 163: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = 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_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType) { - int grammarID = 23; - int done = 0; - - init_v2gDigestMethodType(v2gDigestMethodType); - - while(!done) { - switch(grammarID) { - case 23: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gDigestMethodType->Algorithm.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gParameterType->Name.charactersLen); if (errn == 0) { - errn = (v2gDigestMethodType->Algorithm.charactersLen - 2) <= v2gDigestMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gParameterType->Name.charactersLen - 2) <= v2gParameterType_Name_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gDigestMethodType->Algorithm.charactersLen >= 2) { - v2gDigestMethodType->Algorithm.charactersLen = (uint16_t)(v2gDigestMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gDigestMethodType->Algorithm.charactersLen, v2gDigestMethodType->Algorithm.characters); + if (v2gParameterType->Name.charactersLen >= 2) { + v2gParameterType->Name.charactersLen = (uint16_t)(v2gParameterType->Name.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gParameterType->Name.charactersLen, v2gParameterType->Name.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 24; + grammarID = 85; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7643,128 +3498,134 @@ static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMetho } } break; - case 24: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 85: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 25; - break; - case 1: - done = 1; - grammarID = 5; - break; - case 2: - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 25: - /* 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 = 25; - break; - case 1: - done = 1; - grammarID = 5; - break; - case 2: - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { - int grammarID = 164; - int done = 0; - - init_v2gPGPDataType(v2gPGPDataType); - - while(!done) { - switch(grammarID) { - case 164: - /* 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]] */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyID.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyID.bytesLen) <= v2gPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyID.bytesLen, v2gPGPDataType->PGPKeyID.bytes); - } - v2gPGPDataType->PGPKeyID_isUsed = 1u; + errn = decodeBoolean(stream, &v2gParameterType->boolValue); + v2gParameterType->boolValue_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 165; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; case 1: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); - } - v2gPGPDataType->PGPKeyPacket_isUsed = 1u; + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gParameterType->byteValue = (int8_t)(uint32 -128); + v2gParameterType->byteValue_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 166; + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &v2gParameterType->shortValue); + v2gParameterType->shortValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger32(stream, &v2gParameterType->intValue); + v2gParameterType->intValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + errn = decode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue); + v2gParameterType->physicalValue_isUsed = 1u; + grammarID = 3; + break; + case 5: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gParameterType->stringValue.charactersLen); + if (errn == 0) { + errn = (v2gParameterType->stringValue.charactersLen - 2) <= v2gParameterType_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gParameterType->stringValue.charactersLen >= 2) { + v2gParameterType->stringValue.charactersLen = (uint16_t)(v2gParameterType->stringValue.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gParameterType->stringValue.charactersLen, v2gParameterType->stringValue.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gParameterType->stringValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7776,67 +3637,14 @@ static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2g } } break; - case 165: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); - } - v2gPGPDataType->PGPKeyPacket_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 166; - } 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 = 166; - break; - case 2: done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 166: - /* 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 = 166; - break; - case 1: - done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7857,268 +3665,20 @@ static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2g /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { - int grammarID = 13; + int grammarID = 38; int done = 0; init_v2gSASchedulesType(v2gSASchedulesType); while(!done) { switch(grammarID) { - case 13: + case 38: /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; - break; - default: - errn = 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_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType) { - int grammarID = 167; - int done = 0; - - init_v2gTransformType(v2gTransformType); - - while(!done) { - switch(grammarID) { - case 167: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gTransformType->Algorithm.charactersLen); - if (errn == 0) { - errn = (v2gTransformType->Algorithm.charactersLen - 2) <= v2gTransformType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gTransformType->Algorithm.charactersLen >= 2) { - v2gTransformType->Algorithm.charactersLen = (uint16_t)(v2gTransformType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gTransformType->Algorithm.charactersLen, v2gTransformType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 168; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 168: - /* 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 (v2gTransformType->XPath.arrayLen < v2gTransformType_XPath_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2) <= v2gTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen >= 2) { - v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen = (uint16_t)(v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gTransformType->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 = 169; - } 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 = 169; - break; - case 2: - done = 1; - grammarID = 5; - break; - case 3: - grammarID = 169; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 169: - /* 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 (v2gTransformType->XPath.arrayLen < v2gTransformType_XPath_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen); - if (errn == 0) { - errn = (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2) <= v2gTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen >= 2) { - v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen = (uint16_t)(v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gTransformType->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 = 169; - } 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 = 169; - break; - case 2: - done = 1; - grammarID = 5; - break; - case 3: - grammarID = 169; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { - int grammarID = 170; - int done = 0; - - init_v2gPaymentDetailsReqType(v2gPaymentDetailsReqType); - - while(!done) { - switch(grammarID) { - case 170: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsReqType->eMAID.charactersLen); - if (errn == 0) { - errn = (v2gPaymentDetailsReqType->eMAID.charactersLen - 2) <= v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gPaymentDetailsReqType->eMAID.charactersLen >= 2) { - v2gPaymentDetailsReqType->eMAID.charactersLen = (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.charactersLen, v2gPaymentDetailsReqType->eMAID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain); grammarID = 4; break; default: @@ -8127,154 +3687,6 @@ static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymen } } break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { - int grammarID = 172; - int done = 0; - - init_v2gDC_EVStatusType(v2gDC_EVStatusType); - - while(!done) { - switch(grammarID) { - case 172: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gDC_EVStatusType->EVReady); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 173; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 173: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - v2gDC_EVStatusType->EVErrorCode = (v2gDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 174; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 174: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - v2gDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; default: errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; @@ -8288,14 +3700,14 @@ static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusT /* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { - int grammarID = 43; + int grammarID = 86; int done = 0; init_v2gPaymentServiceSelectionResType(v2gPaymentServiceSelectionResType); while(!done) { switch(grammarID) { - case 43: + case 86: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -8316,7 +3728,7 @@ static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8328,14 +3740,14 @@ static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8354,118 +3766,37 @@ static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { - int grammarID = 175; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { + int grammarID = 87; int done = 0; - init_v2gDC_EVSEChargeParameterType(v2gDC_EVSEChargeParameterType); + init_v2gKeyValueType(v2gKeyValueType); while(!done) { switch(grammarID) { - case 175: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 87: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus); - grammarID = 176; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 176: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); - grammarID = 177; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); - grammarID = 178; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 178: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); - grammarID = 179; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 179: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); - grammarID = 180; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 180: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); - grammarID = 181; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 181: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); - v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; - grammarID = 182; + errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); + v2gKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 88; break; case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 183; + errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); + v2gKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 88; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 88; + break; + case 3: + grammarID = 89; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8473,34 +3804,17 @@ static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gD } } break; - case 182: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 183; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 183: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + case 88: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); - v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; + done = 1; grammarID = 4; break; case 1: - done = 1; - grammarID = 5; + grammarID = 88; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8508,14 +3822,28 @@ static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gD } } break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 89: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 5; + errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); + v2gKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 88; + break; + case 1: + errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); + v2gKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 88; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 88; + break; + case 3: + grammarID = 89; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8534,16 +3862,16 @@ static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gD return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { - int grammarID = 184; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { + int grammarID = 90; int done = 0; - init_v2gChargingStatusResType(v2gChargingStatusResType); + init_v2gSessionSetupResType(v2gSessionSetupResType); while(!done) { switch(grammarID) { - case 184: + case 90: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -8554,7 +3882,7 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gChargingStatusResType->ResponseCode = (v2gresponseCodeType) uint32; + v2gSessionSetupResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -8564,7 +3892,7 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 185; + grammarID = 91; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8576,7 +3904,7 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 185: + case 91: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -8586,14 +3914,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargingStatusResType->EVSEID.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gSessionSetupResType->EVSEID.charactersLen); if (errn == 0) { - errn = (v2gChargingStatusResType->EVSEID.charactersLen - 2) <= v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gSessionSetupResType->EVSEID.charactersLen - 2) <= v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gChargingStatusResType->EVSEID.charactersLen >= 2) { - v2gChargingStatusResType->EVSEID.charactersLen = (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gChargingStatusResType->EVSEID.charactersLen, v2gChargingStatusResType->EVSEID.characters); + if (v2gSessionSetupResType->EVSEID.charactersLen >= 2) { + v2gSessionSetupResType->EVSEID.charactersLen = (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSessionSetupResType->EVSEID.charactersLen, v2gSessionSetupResType->EVSEID.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; @@ -8608,7 +3936,7 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 186; + grammarID = 92; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8620,157 +3948,35 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 186: - /* 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)); - v2gChargingStatusResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 187; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 187: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent); - v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; - grammarID = 188; - break; - case 1: - errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); - v2gChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 189; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); - v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 190; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 188: - /* 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)] */ + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); - v2gChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 189; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); - v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; + errn = decodeInteger64(stream, &v2gSessionSetupResType->EVSETimeStamp); + v2gSessionSetupResType->EVSETimeStamp_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 190; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 189: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargingStatusResType->ReceiptRequired); - v2gChargingStatusResType->ReceiptRequired_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 190; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; case 1: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + done = 1; grammarID = 4; break; default: @@ -8779,29 +3985,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 190: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8820,82 +4011,267 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { - int grammarID = 191; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { + int grammarID = 93; int done = 0; - init_v2gObjectType(v2gObjectType); + init_v2gAuthorizationResType(v2gAuthorizationResType); while(!done) { switch(grammarID) { - case 191: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + case 93: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gAuthorizationResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 94; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gAuthorizationResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { + int grammarID = 95; + int done = 0; + + init_v2gX509DataType(v2gX509DataType); + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->Encoding.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->Encoding.charactersLen - 2) <= v2gObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } - if (errn == 0) { - if (v2gObjectType->Encoding.charactersLen >= 2) { - v2gObjectType->Encoding.charactersLen = (uint16_t)(v2gObjectType->Encoding.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->Encoding.charactersLen, v2gObjectType->Encoding.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gObjectType->Encoding_isUsed = 1u; - grammarID = 192; + grammarID = 96; break; case 1: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); + } + v2gX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } - if (errn == 0) { - if (v2gObjectType->Id.charactersLen >= 2) { - v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - v2gObjectType->Id_isUsed = 1u; - grammarID = 193; break; case 2: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } - if (errn == 0) { - if (v2gObjectType->MimeType.charactersLen >= 2) { - v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - v2gObjectType->MimeType_isUsed = 1u; - grammarID = 24; break; case 3: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 25; + if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); + } + v2gX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 4: - done = 1; - grammarID = 5; + if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); + } + v2gX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 5: - grammarID = 25; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 96; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8903,56 +4279,161 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } } break; - case 192: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + case 96: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + if (v2gX509DataType->X509IssuerSerial.arrayLen < v2gX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array[v2gX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } - if (errn == 0) { - if (v2gObjectType->Id.charactersLen >= 2) { - v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gObjectType->Id_isUsed = 1u; - grammarID = 193; + grammarID = 96; break; case 1: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + if (v2gX509DataType->X509SKI.arrayLen < v2gX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen) <= v2gX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytesLen, v2gX509DataType->X509SKI.array[v2gX509DataType->X509SKI.arrayLen].bytes); + } + v2gX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; } - if (errn == 0) { - if (v2gObjectType->MimeType.charactersLen >= 2) { - v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - v2gObjectType->MimeType_isUsed = 1u; - grammarID = 24; break; case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 25; + if (v2gX509DataType->X509SubjectName.arrayLen < v2gX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= v2gX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].charactersLen, v2gX509DataType->X509SubjectName.array[v2gX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 3: - done = 1; - grammarID = 5; + if (v2gX509DataType->X509Certificate.arrayLen < v2gX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen) <= v2gX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytesLen, v2gX509DataType->X509Certificate.array[v2gX509DataType->X509Certificate.arrayLen].bytes); + } + v2gX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 4: - grammarID = 25; + if (v2gX509DataType->X509CRL.arrayLen < v2gX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen) <= v2gX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytesLen, v2gX509DataType->X509CRL.array[v2gX509DataType->X509CRL.arrayLen].bytes); + } + v2gX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 96; + break; + case 6: + done = 1; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8960,39 +4441,46 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } } break; - case 193: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + 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_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { + int grammarID = 97; + int done = 0; + + init_v2gCertificateUpdateReqType(v2gCertificateUpdateReqType); + + while(!done) { + switch(grammarID) { + case 97: + /* 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, &v2gObjectType->MimeType.charactersLen); + errn = decodeUnsignedInteger16(stream, &v2gCertificateUpdateReqType->Id.charactersLen); if (errn == 0) { - errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (v2gCertificateUpdateReqType->Id.charactersLen - 2) <= v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (v2gObjectType->MimeType.charactersLen >= 2) { - v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + if (v2gCertificateUpdateReqType->Id.charactersLen >= 2) { + v2gCertificateUpdateReqType->Id.charactersLen = (uint16_t)(v2gCertificateUpdateReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCertificateUpdateReqType->Id.charactersLen, v2gCertificateUpdateReqType->Id.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - v2gObjectType->MimeType_isUsed = 1u; - grammarID = 24; - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 25; - break; - case 2: - done = 1; - grammarID = 5; - break; - case 3: - grammarID = 25; + grammarID = 98; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9000,22 +4488,14 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } } break; - case 24: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 98: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 25; - break; - case 1: - done = 1; - grammarID = 5; - break; - case 2: - grammarID = 25; + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain); + grammarID = 99; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9023,22 +4503,73 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } } break; - case 25: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 99: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 25; + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCertificateUpdateReqType->eMAID.charactersLen); + if (errn == 0) { + errn = (v2gCertificateUpdateReqType->eMAID.charactersLen - 2) <= v2gCertificateUpdateReqType_eMAID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCertificateUpdateReqType->eMAID.charactersLen >= 2) { + v2gCertificateUpdateReqType->eMAID.charactersLen = (uint16_t)(v2gCertificateUpdateReqType->eMAID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCertificateUpdateReqType->eMAID.charactersLen, v2gCertificateUpdateReqType->eMAID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 100; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; - case 1: + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 100: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->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 = 5; - break; - case 2: - grammarID = 25; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9059,14 +4590,14 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType) { - int grammarID = 194; + int grammarID = 101; int done = 0; init_v2gPaymentOptionListType(v2gPaymentOptionListType); while(!done) { switch(grammarID) { - case 194: + case 101: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9092,7 +4623,7 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 195; + grammarID = 102; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9104,7 +4635,7 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen } } break; - case 195: + case 102: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -9130,7 +4661,7 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9138,232 +4669,6 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen break; case 1: done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { - int grammarID = 196; - int done = 0; - - init_v2gParameterSetType(v2gParameterSetType); - - while(!done) { - switch(grammarID) { - case 196: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gParameterSetType->ParameterSetID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 197; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 197: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 198; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 198: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 198; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ -static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { - int grammarID = 199; - int done = 0; - - init_v2gAC_EVChargeParameterType(v2gAC_EVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 199: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gAC_EVChargeParameterType->DepartureTime); - v2gAC_EVChargeParameterType->DepartureTime_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 200; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); - grammarID = 201; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 200: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); - grammarID = 201; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 201: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage); - grammarID = 202; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxCurrent); - grammarID = 203; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 203: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMinCurrent); grammarID = 4; break; default: @@ -9372,14 +4677,14 @@ static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_ } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9398,61 +4703,33 @@ static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_ 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_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType) { - int grammarID = 204; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { + int grammarID = 103; int done = 0; - init_v2gManifestType(v2gManifestType); + init_v2gSignatureMethodType(v2gSignatureMethodType); while(!done) { switch(grammarID) { - case 204: - /* 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, &v2gManifestType->Id.charactersLen); - if (errn == 0) { - errn = (v2gManifestType->Id.charactersLen - 2) <= v2gManifestType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gManifestType->Id.charactersLen >= 2) { - v2gManifestType->Id.charactersLen = (uint16_t)(v2gManifestType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gManifestType->Id.charactersLen, v2gManifestType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gManifestType->Id_isUsed = 1u; - grammarID = 205; - break; - case 1: - if (v2gManifestType->Reference.arrayLen < v2gManifestType_Reference_ARRAY_SIZE) { - errn = decode_v2gReferenceType(stream, &v2gManifestType->Reference.array[v2gManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 104; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 205: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + case 103: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gManifestType->Reference.arrayLen < v2gManifestType_Reference_ARRAY_SIZE) { - errn = decode_v2gReferenceType(stream, &v2gManifestType->Reference.array[v2gManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &v2gSignatureMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (v2gSignatureMethodType->Algorithm.charactersLen - 2) <= v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignatureMethodType->Algorithm.charactersLen >= 2) { + v2gSignatureMethodType->Algorithm.charactersLen = (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignatureMethodType->Algorithm.charactersLen, v2gSignatureMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } } grammarID = 104; break; @@ -9463,21 +4740,111 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v } break; case 104: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + /* 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, &v2gSignatureMethodType->HMACOutputLength); + v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 24; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + grammarID = 105; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gManifestType->Reference.arrayLen < v2gManifestType_Reference_ARRAY_SIZE) { - errn = decode_v2gReferenceType(stream, &v2gManifestType->Reference.array[v2gManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 104; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; break; case 1: done = 1; - grammarID = 5; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 105: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gSignatureMethodType->HMACOutputLength); + v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 24; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + grammarID = 105; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9496,16 +4863,200 @@ static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { - int grammarID = 206; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { + int grammarID = 106; int done = 0; - init_v2gServiceDetailResType(v2gServiceDetailResType); + init_v2gChargeParameterDiscoveryReqType(v2gChargeParameterDiscoveryReqType); while(!done) { switch(grammarID) { - case 206: + case 106: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); + v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 107; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 108; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 107: + /* Element[START_ELEMENT({urn:iso:15118:2: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); + v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 108; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 108: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter); + v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter); + v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter); + v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { + int grammarID = 38; + int done = 0; + + init_v2gEVPowerDeliveryParameterType(v2gEVPowerDeliveryParameterType); + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ +static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { + int grammarID = 109; + int done = 0; + + init_v2gCertificateInstallationResType(v2gCertificateInstallationResType); + + while(!done) { + switch(grammarID) { + case 109: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9516,7 +5067,7 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gServiceDetailResType->ResponseCode = (v2gresponseCodeType) uint32; + v2gCertificateInstallationResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -9526,7 +5077,7 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 207; + grammarID = 110; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9538,31 +5089,14 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } } break; - case 207: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + case 110: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ 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, &v2gServiceDetailResType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 208; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain); + grammarID = 111; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9570,19 +5104,14 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } } break; - case 208: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 111: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList); - v2gServiceDetailResType->ServiceParameterList_isUsed = 1u; - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; + errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain); + grammarID = 112; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9590,14 +5119,59 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } } break; - case 4: + case 112: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey); + grammarID = 113; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 113: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey); + grammarID = 114; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 114: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9618,14 +5192,14 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { - int grammarID = 209; + int grammarID = 115; int done = 0; init_v2gListOfRootCertificateIDsType(v2gListOfRootCertificateIDsType); while(!done) { switch(grammarID) { - case 209: + case 115: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9636,7 +5210,7 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 210; + grammarID = 116; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9644,7 +5218,7 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } } break; - case 210: + case 116: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -9655,11 +5229,547 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 210; + grammarID = 116; break; case 1: done = 1; - grammarID = 5; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { + int grammarID = 117; + int done = 0; + + init_v2gDC_EVStatusType(v2gDC_EVStatusType); + + while(!done) { + switch(grammarID) { + case 117: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVStatusType->EVReady); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 118; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 118: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + v2gDC_EVStatusType->EVErrorCode = (v2gDC_EVErrorCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 119; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { + int grammarID = 120; + int done = 0; + + init_v2gCurrentDemandReqType(v2gCurrentDemandReqType); + + while(!done) { + switch(grammarID) { + case 120: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus); + grammarID = 121; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 121: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent); + grammarID = 122; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 122: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit); + v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; + grammarID = 123; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); + v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 124; + break; + case 2: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 125; + break; + case 3: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 126; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 127; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 123: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); + v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 124; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 125; + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 126; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 127; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 124: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); + v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 125; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 126; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 127; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 125: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->BulkChargingComplete); + v2gCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 126; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 127; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 126: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 127; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 127: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC); + v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; + grammarID = 128; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); + v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 129; + break; + case 2: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 128: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); + v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 129; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 129: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -9680,14 +5790,14 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType) { - int grammarID = 211; + int grammarID = 130; int done = 0; init_v2gServiceType(v2gServiceType); while(!done) { switch(grammarID) { - case 211: + case 130: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9707,7 +5817,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 212; + grammarID = 131; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9719,7 +5829,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 212: + case 131: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -9752,7 +5862,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 213; + grammarID = 132; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9774,7 +5884,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 214; + grammarID = 133; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9786,7 +5896,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 213: + case 132: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9807,7 +5917,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 214; + grammarID = 133; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9819,7 +5929,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 214: + case 133: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -9852,7 +5962,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 215; + grammarID = 134; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9873,7 +5983,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9885,7 +5995,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 215: + case 134: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -9905,7 +6015,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -9917,689 +6027,13 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ -static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { - int grammarID = 216; - int done = 0; - - init_v2gParameterType(v2gParameterType); - - while(!done) { - switch(grammarID) { - case 216: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gParameterType->Name.charactersLen); - if (errn == 0) { - errn = (v2gParameterType->Name.charactersLen - 2) <= v2gParameterType_Name_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gParameterType->Name.charactersLen >= 2) { - v2gParameterType->Name.charactersLen = (uint16_t)(v2gParameterType->Name.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gParameterType->Name.charactersLen, v2gParameterType->Name.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 217; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 217: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gParameterType->boolValue); - v2gParameterType->boolValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gParameterType->byteValue = (int8_t)(uint32 -128); - v2gParameterType->byteValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gParameterType->shortValue); - v2gParameterType->shortValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger32(stream, &v2gParameterType->intValue); - v2gParameterType->intValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - errn = decode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue); - v2gParameterType->physicalValue_isUsed = 1u; - grammarID = 4; - break; - case 5: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gParameterType->stringValue.charactersLen); - if (errn == 0) { - errn = (v2gParameterType->stringValue.charactersLen - 2) <= v2gParameterType_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gParameterType->stringValue.charactersLen >= 2) { - v2gParameterType->stringValue.charactersLen = (uint16_t)(v2gParameterType->stringValue.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gParameterType->stringValue.charactersLen, v2gParameterType->stringValue.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gParameterType->stringValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { - int grammarID = 218; - int done = 0; - - init_v2gDSAKeyValueType(v2gDSAKeyValueType); - - while(!done) { - switch(grammarID) { - case 218: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->P.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->P.bytesLen) <= v2gDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->P.bytesLen, v2gDSAKeyValueType->P.bytes); - } - v2gDSAKeyValueType->P_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 219; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); - } - v2gDSAKeyValueType->G_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 220; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 221; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 219: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Q.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Q.bytesLen) <= v2gDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Q.bytesLen, v2gDSAKeyValueType->Q.bytes); - } - v2gDSAKeyValueType->Q_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 222; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 222: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); - } - v2gDSAKeyValueType->G_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 220; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 221; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 220: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 221; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 221: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->J.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->J.bytesLen) <= v2gDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->J.bytesLen, v2gDSAKeyValueType->J.bytes); - } - v2gDSAKeyValueType->J_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 223; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Seed.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); - } - v2gDSAKeyValueType->Seed_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 224; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 223: - /* 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, &v2gDSAKeyValueType->Seed.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); - } - v2gDSAKeyValueType->Seed_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 224; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 224: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->PgenCounter.bytesLen); - if (errn == 0) { - errn = (v2gDSAKeyValueType->PgenCounter.bytesLen) <= v2gDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytesLen, v2gDSAKeyValueType->PgenCounter.bytes); - } - v2gDSAKeyValueType->PgenCounter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_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_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { - int grammarID = 225; - int done = 0; - - init_v2gAnonType_V2G_Message(v2gAnonType_V2G_Message); - - while(!done) { - switch(grammarID) { - case 225: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header); - grammarID = 226; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 226: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body); grammarID = 4; break; default: @@ -10608,21 +6042,6 @@ static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonTyp } } break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; default: errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; @@ -10634,674 +6053,17 @@ static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonTyp return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { - int grammarID = 227; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { + int grammarID = 86; int done = 0; - init_v2gEVChargeParameterType(v2gEVChargeParameterType); + init_v2gSessionStopResType(v2gSessionStopResType); while(!done) { switch(grammarID) { - case 227: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gEVChargeParameterType->DepartureTime); - v2gEVChargeParameterType->DepartureTime_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { - int grammarID = 228; - int done = 0; - - init_v2gProfileEntryType(v2gProfileEntryType); - - while(!done) { - switch(grammarID) { - case 228: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gProfileEntryType->ChargingProfileEntryStart); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 229; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower); - grammarID = 230; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 230: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &(uint32)); - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse = (int8_t)(uint32 + 1); - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - int grammarID = 231; - int done = 0; - - init_v2gSignaturePropertyType(v2gSignaturePropertyType); - - while(!done) { - switch(grammarID) { - case 231: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Id.charactersLen); - if (errn == 0) { - errn = (v2gSignaturePropertyType->Id.charactersLen - 2) <= v2gSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignaturePropertyType->Id.charactersLen >= 2) { - v2gSignaturePropertyType->Id.charactersLen = (uint16_t)(v2gSignaturePropertyType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertyType->Id.charactersLen, v2gSignaturePropertyType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gSignaturePropertyType->Id_isUsed = 1u; - grammarID = 232; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); - if (errn == 0) { - errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignaturePropertyType->Target.charactersLen >= 2) { - v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 233; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 232: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertyType->Target.charactersLen); - if (errn == 0) { - errn = (v2gSignaturePropertyType->Target.charactersLen - 2) <= v2gSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignaturePropertyType->Target.charactersLen >= 2) { - v2gSignaturePropertyType->Target.charactersLen = (uint16_t)(v2gSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignaturePropertyType->Target.charactersLen, v2gSignaturePropertyType->Target.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 233; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 233: - /* 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 = 25; - break; - case 1: - grammarID = 234; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 25: - /* 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 = 25; - break; - case 1: - done = 1; - grammarID = 5; - break; - case 2: - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 234: - /* 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 = 25; - break; - case 1: - grammarID = 234; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { - int grammarID = 235; - int done = 0; - - init_v2gPMaxScheduleEntryType(v2gPMaxScheduleEntryType); - - while(!done) { - switch(grammarID) { - case 235: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval); - v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 236; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval); - v2gPMaxScheduleEntryType->TimeInterval_isUsed = 1u; - grammarID = 236; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax); - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { - int grammarID = 237; - int done = 0; - - init_v2gKeyValueType(v2gKeyValueType); - - while(!done) { - switch(grammarID) { - case 237: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); - v2gKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 238; - break; - case 1: - errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); - v2gKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 238; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 238; - break; - case 3: - grammarID = 239; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 238: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - case 1: - grammarID = 238; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 239: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue); - v2gKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 238; - break; - case 1: - errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); - v2gKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 238; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 238; - break; - case 3: - grammarID = 239; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { - int grammarID = 240; - int done = 0; - - init_v2gRetrievalMethodType(v2gRetrievalMethodType); - - while(!done) { - switch(grammarID) { - case 240: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->Type.charactersLen); - if (errn == 0) { - errn = (v2gRetrievalMethodType->Type.charactersLen - 2) <= v2gRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gRetrievalMethodType->Type.charactersLen >= 2) { - v2gRetrievalMethodType->Type.charactersLen = (uint16_t)(v2gRetrievalMethodType->Type.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gRetrievalMethodType->Type.charactersLen, v2gRetrievalMethodType->Type.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gRetrievalMethodType->Type_isUsed = 1u; - grammarID = 241; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); - if (errn == 0) { - errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gRetrievalMethodType->URI.charactersLen >= 2) { - v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gRetrievalMethodType->URI_isUsed = 1u; - grammarID = 242; - break; - case 2: - errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); - v2gRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 4; - break; - case 3: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 241: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); - if (errn == 0) { - errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gRetrievalMethodType->URI.charactersLen >= 2) { - v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gRetrievalMethodType->URI_isUsed = 1u; - grammarID = 242; - break; - case 1: - errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); - v2gRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 4; - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 242: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); - v2gRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ -static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { - int grammarID = 243; - int done = 0; - - init_v2gSessionStopReqType(v2gSessionStopReqType); - - while(!done) { - switch(grammarID) { - case 243: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ + case 86: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -11310,18 +6072,18 @@ static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionSt errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - v2gSessionStopReqType->ChargingSession = (v2gchargingSessionType) uint32; + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gSessionStopResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11333,14 +6095,14 @@ static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionSt } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11359,36 +6121,477 @@ static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionSt return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { - int grammarID = 244; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ +static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { + int grammarID = 135; int done = 0; - init_v2gServiceDetailReqType(v2gServiceDetailReqType); + init_v2gConsumptionCostType(v2gConsumptionCostType); while(!done) { switch(grammarID) { - case 244: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + case 135: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue); + grammarID = 136; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 136: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 137; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 137: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 138; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 138: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gConsumptionCostType->Cost.arrayLen < v2gConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array[v2gConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { + int grammarID = 38; + int done = 0; + + init_v2gChargingStatusReqType(v2gChargingStatusReqType); + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { + int grammarID = 139; + int done = 0; + + init_v2gPreChargeReqType(v2gPreChargeReqType); + + while(!done) { + switch(grammarID) { + case 139: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus); + grammarID = 140; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 140: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage); + grammarID = 141; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 141: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { + int grammarID = 142; + int done = 0; + + init_v2gWeldingDetectionReqType(v2gWeldingDetectionReqType); + + while(!done) { + switch(grammarID) { + case 142: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { + int grammarID = 143; + int done = 0; + + init_v2gSignaturePropertiesType(v2gSignaturePropertiesType); + + while(!done) { + switch(grammarID) { + case 143: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignaturePropertiesType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignaturePropertiesType->Id.charactersLen - 2) <= v2gSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignaturePropertiesType->Id.charactersLen >= 2) { + v2gSignaturePropertiesType->Id.charactersLen = (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignaturePropertiesType->Id.charactersLen, v2gSignaturePropertiesType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignaturePropertiesType->Id_isUsed = 1u; + grammarID = 144; + break; + case 1: + if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 144: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 145: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSignaturePropertiesType->SignatureProperty.arrayLen < v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array[v2gSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { + int grammarID = 146; + int done = 0; + + init_v2gSelectedServiceListType(v2gSelectedServiceListType); + + while(!done) { + switch(grammarID) { + case 146: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 147; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 147: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 147; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { + int grammarID = 148; + int done = 0; + + init_v2gServiceDiscoveryResType(v2gServiceDiscoveryResType); + + while(!done) { + switch(grammarID) { + case 148: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceDetailReqType->ServiceID); + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gServiceDiscoveryResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 149; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11400,14 +6603,1587 @@ static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gService } } break; - case 4: + case 149: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList); + grammarID = 150; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 150: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService); + grammarID = 151; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 151: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList); + v2gServiceDiscoveryResType->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 = 5; + 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_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { + int grammarID = 152; + int done = 0; + + init_v2gEMAIDType(v2gEMAIDType); + + while(!done) { + switch(grammarID) { + case 152: + /* 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, &v2gEMAIDType->Id.charactersLen); + if (errn == 0) { + errn = (v2gEMAIDType->Id.charactersLen - 2) <= v2gEMAIDType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gEMAIDType->Id.charactersLen >= 2) { + v2gEMAIDType->Id.charactersLen = (uint16_t)(v2gEMAIDType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gEMAIDType->Id.charactersLen, v2gEMAIDType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 153; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 153: + /* StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gEMAIDType->CONTENT.charactersLen); + if (errn == 0) { + errn = (v2gEMAIDType->CONTENT.charactersLen - 2) <= v2gEMAIDType_CONTENT_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gEMAIDType->CONTENT.charactersLen >= 2) { + v2gEMAIDType->CONTENT.charactersLen = (uint16_t)(v2gEMAIDType->CONTENT.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gEMAIDType->CONTENT.charactersLen, v2gEMAIDType->CONTENT.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 3; + 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_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { + int grammarID = 38; + int done = 0; + + init_v2gIntervalType(v2gIntervalType); + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { + int grammarID = 154; + int done = 0; + + init_v2gSignedInfoType(v2gSignedInfoType); + + while(!done) { + switch(grammarID) { + case 154: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignedInfoType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignedInfoType->Id.charactersLen - 2) <= v2gSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignedInfoType->Id.charactersLen >= 2) { + v2gSignedInfoType->Id.charactersLen = (uint16_t)(v2gSignedInfoType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignedInfoType->Id.charactersLen, v2gSignedInfoType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignedInfoType->Id_isUsed = 1u; + grammarID = 155; + break; + case 1: + errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); + grammarID = 156; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 155: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); + grammarID = 156; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 156: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod); + grammarID = 157; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 157: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 34; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 34: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSignedInfoType->Reference.arrayLen < v2gSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array[v2gSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 34; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType) { + int grammarID = 142; + int done = 0; + + init_v2gCableCheckReqType(v2gCableCheckReqType); + + while(!done) { + switch(grammarID) { + case 142: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gCableCheckReqType->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,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ +static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { + int grammarID = 158; + int done = 0; + + init_v2gServiceListType(v2gServiceListType); + + while(!done) { + switch(grammarID) { + case 158: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 159; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 159: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 160; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 160: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 161; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 161: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 162; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 162: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 163; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 163: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 164; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 164: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 165; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 165: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceListType->Service.arrayLen < v2gServiceListType_Service_ARRAY_SIZE) { + errn = decode_v2gServiceType(stream, &v2gServiceListType->Service.array[v2gServiceListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ +static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { + int grammarID = 166; + int done = 0; + + init_v2gAC_EVSEStatusType(v2gAC_EVSEStatusType); + + while(!done) { + switch(grammarID) { + case 166: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gAC_EVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 167; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 167: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gAC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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:MsgDataTypes}RCD)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gAC_EVSEStatusType->RCD); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { + int grammarID = 169; + int done = 0; + + init_v2gDC_EVSEStatusType(v2gDC_EVSEStatusType); + + while(!done) { + switch(grammarID) { + case 169: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDC_EVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 170; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 170: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gDC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gDC_EVSEStatusType->EVSEIsolationStatus = (v2gisolationLevelType) uint32; + v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 172; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } 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:MsgDataTypes}EVSEStatusCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { + int grammarID = 173; + int done = 0; + + init_v2gSPKIDataType(v2gSPKIDataType); + + while(!done) { + switch(grammarID) { + case 173: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); + } + v2gSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 174; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 174: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); + } + v2gSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 174; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 175; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 175: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); + } + v2gSPKIDataType->SPKISexp.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 174; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType) { + int grammarID = 176; + int done = 0; + + init_v2gCurrentDemandResType(v2gCurrentDemandResType); + + while(!done) { + switch(grammarID) { + case 176: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gCurrentDemandResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 177; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 177: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gCurrentDemandResType->DC_EVSEStatus); + grammarID = 178; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 178: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentVoltage); + grammarID = 179; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 179: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentCurrent); + grammarID = 180; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 180: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSECurrentLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 181; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 181: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEVoltageLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 182; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 182: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEPowerLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 183; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 183: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumVoltageLimit); + v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; + grammarID = 184; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); + v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 185; + break; + case 2: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); + v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 186; + break; + case 3: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 184: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); + v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 185; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); + v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 186; + break; + case 2: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 185: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); + v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 186; + break; + case 1: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 186: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); + if (errn == 0) { + errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { + v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 187; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 187: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gCurrentDemandResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 188; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 188: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo); + v2gCurrentDemandResType->MeterInfo_isUsed = 1u; + grammarID = 189; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); + v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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 189: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); + v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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; @@ -11428,14 +8204,14 @@ static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gService /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType) { - int grammarID = 245; + int grammarID = 190; int done = 0; init_v2gKeyInfoType(v2gKeyInfoType); while(!done) { switch(grammarID) { - case 245: + case 190: /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -11455,7 +8231,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } v2gKeyInfoType->Id_isUsed = 1u; - grammarID = 246; + grammarID = 191; break; case 1: if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { @@ -11489,7 +8265,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11501,7 +8277,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 3: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -11509,7 +8285,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 4: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -11517,7 +8293,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 5: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -11525,7 +8301,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 6: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -11533,7 +8309,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 7: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -11567,7 +8343,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11576,10 +8352,10 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g case 8: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 247; + grammarID = 192; break; case 9: - grammarID = 248; + grammarID = 193; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11587,7 +8363,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - case 246: + case 191: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -11624,7 +8400,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11636,7 +8412,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 2: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -11644,7 +8420,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 3: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -11652,7 +8428,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 4: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -11660,7 +8436,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 5: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -11668,7 +8444,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 6: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -11702,7 +8478,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11711,10 +8487,10 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g case 7: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 247; + grammarID = 192; break; case 8: - grammarID = 248; + grammarID = 193; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11722,7 +8498,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - case 247: + case 192: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -11759,7 +8535,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11771,7 +8547,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 2: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -11779,7 +8555,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 3: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -11787,7 +8563,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 4: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -11795,7 +8571,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 5: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -11803,7 +8579,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 6: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -11837,7 +8613,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11846,14 +8622,14 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g case 7: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 247; + grammarID = 192; break; case 8: done = 1; - grammarID = 5; + grammarID = 4; break; case 9: - grammarID = 247; + grammarID = 192; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11861,7 +8637,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - case 248: + case 193: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -11898,7 +8674,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11910,7 +8686,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 2: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -11918,7 +8694,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 3: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -11926,7 +8702,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 4: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -11934,7 +8710,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 5: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -11942,7 +8718,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 247; + grammarID = 192; break; case 6: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -11976,7 +8752,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 247; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11985,10 +8761,10 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g case 7: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 247; + grammarID = 192; break; case 8: - grammarID = 248; + grammarID = 193; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12007,36 +8783,274 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ -static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { - int grammarID = 249; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { + int grammarID = 194; int done = 0; - init_v2gAC_EVSEStatusType(v2gAC_EVSEStatusType); + init_v2gObjectType(v2gObjectType); while(!done) { switch(grammarID) { - case 249: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + case 194: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->Encoding.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->Encoding.charactersLen - 2) <= v2gObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->Encoding.charactersLen >= 2) { + v2gObjectType->Encoding.charactersLen = (uint16_t)(v2gObjectType->Encoding.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->Encoding.charactersLen, v2gObjectType->Encoding.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->Encoding_isUsed = 1u; + grammarID = 195; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->Id.charactersLen >= 2) { + v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->Id_isUsed = 1u; + grammarID = 196; + break; + case 2: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->MimeType.charactersLen >= 2) { + v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->MimeType_isUsed = 1u; + grammarID = 68; + break; + case 3: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 4: + done = 1; + grammarID = 4; + break; + case 5: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 195: + /* 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, &v2gObjectType->Id.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->Id.charactersLen >= 2) { + v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->Id_isUsed = 1u; + grammarID = 196; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->MimeType.charactersLen >= 2) { + v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->MimeType_isUsed = 1u; + grammarID = 68; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 3: + done = 1; + grammarID = 4; + break; + case 4: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 196: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (v2gObjectType->MimeType.charactersLen - 2) <= v2gObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gObjectType->MimeType.charactersLen >= 2) { + v2gObjectType->MimeType.charactersLen = (uint16_t)(v2gObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gObjectType->MimeType.charactersLen, v2gObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gObjectType->MimeType_isUsed = 1u; + grammarID = 68; + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 68: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { + int grammarID = 197; + int done = 0; + + init_v2gSAScheduleTupleType(v2gSAScheduleTupleType); + + while(!done) { + switch(grammarID) { + case 197: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gAC_EVSEStatusType->NotificationMaxDelay); + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSAScheduleTupleType->SAScheduleTupleID = (uint8_t)(uint32 + 1); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 250; + grammarID = 198; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12048,8 +9062,789 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta } } break; - case 250: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + case 198: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule); + grammarID = 199; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 199: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff); + v2gSAScheduleTupleType->SalesTariff_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { + int grammarID = 200; + int done = 0; + + init_v2gSignatureValueType(v2gSignatureValueType); + + while(!done) { + switch(grammarID) { + case 200: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSignatureValueType->Id.charactersLen - 2) <= v2gSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSignatureValueType->Id.charactersLen >= 2) { + v2gSignatureValueType->Id.charactersLen = (uint16_t)(v2gSignatureValueType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSignatureValueType->Id.charactersLen, v2gSignatureValueType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSignatureValueType->Id_isUsed = 1u; + grammarID = 6; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); + } + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 6: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (v2gSignatureValueType->CONTENT.bytesLen) <= v2gSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSignatureValueType->CONTENT.bytesLen, v2gSignatureValueType->CONTENT.bytes); + } + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { + int grammarID = 69; + int done = 0; + + init_v2gPowerDeliveryResType(v2gPowerDeliveryResType); + + while(!done) { + switch(grammarID) { + case 69: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gPowerDeliveryResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 70; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus); + v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus); + v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus); + v2gPowerDeliveryResType->EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* 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_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { + int grammarID = 201; + int done = 0; + + init_v2gSubCertificatesType(v2gSubCertificatesType); + + while(!done) { + switch(grammarID) { + case 201: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 202; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 202: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 203; + } 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 203: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 204; + } 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 204: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSubCertificatesType->Certificate.arrayLen < v2gSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen) <= v2gSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytesLen, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType->Certificate.arrayLen].bytes); + } + v2gSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + 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_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { + int grammarID = 205; + int done = 0; + + init_v2gAuthorizationReqType(v2gAuthorizationReqType); + + while(!done) { + switch(grammarID) { + case 205: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->Id.charactersLen); + if (errn == 0) { + errn = (v2gAuthorizationReqType->Id.charactersLen - 2) <= v2gAuthorizationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gAuthorizationReqType->Id.charactersLen >= 2) { + v2gAuthorizationReqType->Id.charactersLen = (uint16_t)(v2gAuthorizationReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gAuthorizationReqType->Id.charactersLen, v2gAuthorizationReqType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gAuthorizationReqType->Id_isUsed = 1u; + grammarID = 206; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gAuthorizationReqType->GenChallenge.bytesLen); + if (errn == 0) { + errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); + } + v2gAuthorizationReqType->GenChallenge_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 206: + /* 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, &v2gAuthorizationReqType->GenChallenge.bytesLen); + if (errn == 0) { + errn = (v2gAuthorizationReqType->GenChallenge.bytesLen) <= v2gAuthorizationReqType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytesLen, v2gAuthorizationReqType->GenChallenge.bytes); + } + v2gAuthorizationReqType->GenChallenge_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + 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-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { + int grammarID = 207; + int done = 0; + + init_v2gChargingProfileType(v2gChargingProfileType); + + while(!done) { + switch(grammarID) { + case 207: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 208; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 208: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gChargingProfileType->ProfileEntry.arrayLen < v2gChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array[v2gChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 208; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { + int grammarID = 209; + int done = 0; + + init_v2gEntryType(v2gEntryType); + + while(!done) { + switch(grammarID) { + case 209: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval); + v2gEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_v2gIntervalType(stream, &v2gEntryType->TimeInterval); + v2gEntryType->TimeInterval_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { + int grammarID = 210; + int done = 0; + + init_v2gCableCheckResType(v2gCableCheckResType); + + while(!done) { + switch(grammarID) { + case 210: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gCableCheckResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 211; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 211: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus); + grammarID = 94; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -12059,17 +9854,17 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gAC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; + v2gCableCheckResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 251; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12081,46 +9876,14 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta } } break; - case 251: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gAC_EVSEStatusType->RCD); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12139,27 +9902,46 @@ static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSESta return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { - int grammarID = 252; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ +static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { + int grammarID = 212; int done = 0; - init_v2gSelectedServiceListType(v2gSelectedServiceListType); + init_v2gSupportedEnergyTransferModeType(v2gSupportedEnergyTransferModeType); while(!done) { switch(grammarID) { - case 252: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ + case 212: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 253; + 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 = 213; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12167,22 +9949,708 @@ static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele } } break; - case 253: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ + case 213: + /* 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 (v2gSelectedServiceListType->SelectedService.arrayLen < v2gSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array[v2gSelectedServiceListType->SelectedService.arrayLen++]); + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 253; + 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 = 214; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; case 1: done = 1; - grammarID = 5; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 214: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 215; + } 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 215: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 216; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 216: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 217; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen < v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen] = (v2gEnergyTransferModeType) uint32; + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* 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,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { + int grammarID = 218; + int done = 0; + + init_v2gPhysicalValueType(v2gPhysicalValueType); + + while(!done) { + switch(grammarID) { + case 218: + /* 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)); + v2gPhysicalValueType->Multiplier = (int8_t)(uint32 -3); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 219; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 219: + /* 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); + v2gPhysicalValueType->Unit = (v2gunitSymbolType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 220; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 220: + /* 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, &v2gPhysicalValueType->Value); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { + int grammarID = 221; + int done = 0; + + init_v2gChargeParameterDiscoveryResType(v2gChargeParameterDiscoveryResType); + + while(!done) { + switch(grammarID) { + case 221: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gChargeParameterDiscoveryResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 222; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 222: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gChargeParameterDiscoveryResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 223; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList); + v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; + grammarID = 224; + break; + case 1: + errn = decode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules); + v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; + grammarID = 224; + break; + case 2: + errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 3: + errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 4: + errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 224: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); + v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + 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-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { + int grammarID = 225; + int done = 0; + + init_v2gParameterSetType(v2gParameterSetType); + + while(!done) { + switch(grammarID) { + case 225: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &v2gParameterSetType->ParameterSetID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 226; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 226: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 227; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 227: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gParameterSetType->Parameter.arrayLen < v2gParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array[v2gParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 227; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { + int grammarID = 228; + int done = 0; + + init_v2gPaymentDetailsReqType(v2gPaymentDetailsReqType); + + while(!done) { + switch(grammarID) { + case 228: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsReqType->eMAID.charactersLen); + if (errn == 0) { + errn = (v2gPaymentDetailsReqType->eMAID.charactersLen - 2) <= v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gPaymentDetailsReqType->eMAID.charactersLen >= 2) { + v2gPaymentDetailsReqType->eMAID.charactersLen = (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.charactersLen, v2gPaymentDetailsReqType->eMAID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 229; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 229: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12203,14 +10671,14 @@ static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType) { - int grammarID = 254; + int grammarID = 230; int done = 0; init_v2gMeterInfoType(v2gMeterInfoType); while(!done) { switch(grammarID) { - case 254: + case 230: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12242,7 +10710,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 255; + grammarID = 231; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12254,7 +10722,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 255: + case 231: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -12275,7 +10743,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 256; + grammarID = 232; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12303,7 +10771,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 257; + grammarID = 233; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12325,7 +10793,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 258; + grammarID = 234; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12347,7 +10815,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12355,7 +10823,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 4: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12363,7 +10831,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 256: + case 232: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -12390,7 +10858,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 257; + grammarID = 233; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12412,7 +10880,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 258; + grammarID = 234; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12434,7 +10902,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12442,7 +10910,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 3: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12450,7 +10918,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 257: + case 233: /* 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) { @@ -12471,7 +10939,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 258; + grammarID = 234; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12493,7 +10961,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12501,7 +10969,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 2: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12509,7 +10977,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 258: + case 234: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12530,7 +10998,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12538,7 +11006,7 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* break; case 1: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12546,14 +11014,14 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12572,44 +11040,1131 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { - int grammarID = 259; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { + int grammarID = 235; int done = 0; - init_v2gSPKIDataType(v2gSPKIDataType); + init_v2gPaymentServiceSelectionReqType(v2gPaymentServiceSelectionReqType); while(!done) { switch(grammarID) { - case 259: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + case 235: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); - } - v2gSPKIDataType->SPKISexp.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gPaymentServiceSelectionReqType->SelectedPaymentOption = (v2gpaymentOptionType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } 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) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 236; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 236: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { + int grammarID = 237; + int done = 0; + + init_v2gRetrievalMethodType(v2gRetrievalMethodType); + + while(!done) { + switch(grammarID) { + case 237: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->Type.charactersLen); + if (errn == 0) { + errn = (v2gRetrievalMethodType->Type.charactersLen - 2) <= v2gRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gRetrievalMethodType->Type.charactersLen >= 2) { + v2gRetrievalMethodType->Type.charactersLen = (uint16_t)(v2gRetrievalMethodType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gRetrievalMethodType->Type.charactersLen, v2gRetrievalMethodType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gRetrievalMethodType->Type_isUsed = 1u; + grammarID = 238; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gRetrievalMethodType->URI.charactersLen >= 2) { + v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gRetrievalMethodType->URI_isUsed = 1u; + grammarID = 239; + break; + case 2: + errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); + v2gRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 3; + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 238: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (v2gRetrievalMethodType->URI.charactersLen - 2) <= v2gRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gRetrievalMethodType->URI.charactersLen >= 2) { + v2gRetrievalMethodType->URI.charactersLen = (uint16_t)(v2gRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gRetrievalMethodType->URI.charactersLen, v2gRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gRetrievalMethodType->URI_isUsed = 1u; + grammarID = 239; + break; + case 1: + errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); + v2gRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 3; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 239: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms); + v2gRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { + int grammarID = 240; + int done = 0; + + init_v2gSessionSetupReqType(v2gSessionSetupReqType); + + while(!done) { + switch(grammarID) { + case 240: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSessionSetupReqType->EVCCID.bytesLen); + if (errn == 0) { + errn = (v2gSessionSetupReqType->EVCCID.bytesLen) <= v2gSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytesLen, v2gSessionSetupReqType->EVCCID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { + int grammarID = 241; + int done = 0; + + init_v2gDC_EVChargeParameterType(v2gDC_EVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 241: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gDC_EVChargeParameterType->DepartureTime); + v2gDC_EVChargeParameterType->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 242; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); + grammarID = 243; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 242: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus); + grammarID = 243; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 243: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit); + grammarID = 244; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 244: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit); + v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 245; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 246; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 245: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 246; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 246: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity); + v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; + grammarID = 247; + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); + v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 248; + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 249; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 247: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); + v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 248; + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 249; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 248: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 249; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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 249: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + v2gDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* 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_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { + int grammarID = 250; + int done = 0; + + init_v2gAnonType_V2G_Message(v2gAnonType_V2G_Message); + + while(!done) { + switch(grammarID) { + case 250: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header); + grammarID = 251; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 251: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body); + grammarID = 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_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +static int decode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { + int grammarID = 252; + int done = 0; + + init_v2gDC_EVPowerDeliveryParameterType(v2gDC_EVPowerDeliveryParameterType); + + while(!done) { + switch(grammarID) { + case 252: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus); + grammarID = 253; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 253: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); + v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 254; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 254: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { + int grammarID = 255; + int done = 0; + + init_v2gRelativeTimeIntervalType(v2gRelativeTimeIntervalType); + + while(!done) { + switch(grammarID) { + case 255: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->start); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 256; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 256: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->duration); + v2gRelativeTimeIntervalType->duration_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType) { + int grammarID = 257; + int done = 0; + + init_v2gRSAKeyValueType(v2gRSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 257: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Modulus.bytesLen); + if (errn == 0) { + errn = (v2gRSAKeyValueType->Modulus.bytesLen) <= v2gRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gRSAKeyValueType->Modulus.bytesLen, v2gRSAKeyValueType->Modulus.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 258; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 258: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gRSAKeyValueType->Exponent.bytesLen); + if (errn == 0) { + errn = (v2gRSAKeyValueType->Exponent.bytesLen) <= v2gRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gRSAKeyValueType->Exponent.bytesLen, v2gRSAKeyValueType->Exponent.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { + int grammarID = 259; + int done = 0; + + init_v2gPGPDataType(v2gPGPDataType); + + while(!done) { + switch(grammarID) { + case 259: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyID.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyID.bytesLen) <= v2gPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyID.bytesLen, v2gPGPDataType->PGPKeyID.bytes); + } + v2gPGPDataType->PGPKeyID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 260; @@ -12618,6 +12173,34 @@ static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v } } break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); + } + v2gPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 261; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -12625,37 +12208,33 @@ static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v } break; case 260: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + /* 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: - if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); - } - v2gSPKIDataType->SPKISexp.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); + } + v2gPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } 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) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 260; + grammarID = 261; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12668,7 +12247,7 @@ static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v break; case 2: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12677,45 +12256,18 @@ static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v } break; case 261: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (v2gSPKIDataType->SPKISexp.arrayLen < v2gSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen) <= v2gSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytesLen, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType->SPKISexp.arrayLen].bytes); - } - v2gSPKIDataType->SPKISexp.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 260; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 261; break; case 1: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12734,12 +12286,12 @@ static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ +static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { int grammarID = 262; int done = 0; - init_v2gChargeParameterDiscoveryResType(v2gChargeParameterDiscoveryResType); + init_v2gCertificateUpdateResType(v2gCertificateUpdateResType); while(!done) { switch(grammarID) { @@ -12754,7 +12306,7 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gChargeParameterDiscoveryResType->ResponseCode = (v2gresponseCodeType) uint32; + v2gCertificateUpdateResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -12777,7 +12329,154 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } break; case 263: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain); + grammarID = 264; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 264: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain); + grammarID = 265; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 265: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey); + grammarID = 266; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 266: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey); + grammarID = 267; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 267: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID); + grammarID = 268; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 268: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &v2gCertificateUpdateResType->RetryCounter); + v2gCertificateUpdateResType->RetryCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ +static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { + int grammarID = 269; + int done = 0; + + init_v2gPaymentDetailsResType(v2gPaymentDetailsResType); + + while(!done) { + switch(grammarID) { + case 269: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -12786,18 +12485,18 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gChargeParameterDiscoveryResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gPaymentDetailsResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 264; + grammarID = 270; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12809,35 +12508,37 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } } break; - case 264: - /* 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); + case 270: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList); - v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; - grammarID = 265; - break; - case 1: - errn = decode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules); - v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; - grammarID = 265; - break; - case 2: - errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; - grammarID = 4; - break; - case 3: - errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; - grammarID = 4; - break; - case 4: - errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; - grammarID = 4; + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsResType->GenChallenge.bytesLen); + if (errn == 0) { + errn = (v2gPaymentDetailsResType->GenChallenge.bytesLen) <= v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytesLen, v2gPaymentDetailsResType->GenChallenge.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 271; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12845,25 +12546,31 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } } break; - case 265: - /* 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); + case 271: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; - grammarID = 4; - break; - case 1: - errn = decode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; - grammarID = 4; - break; - case 2: - errn = decode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter); - v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; - grammarID = 4; + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gPaymentDetailsResType->EVSETimeStamp); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12871,14 +12578,1392 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } } break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { + int grammarID = 272; + int done = 0; + + init_v2gDSAKeyValueType(v2gDSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 272: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->P.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->P.bytesLen) <= v2gDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->P.bytesLen, v2gDSAKeyValueType->P.bytes); + } + v2gDSAKeyValueType->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 273; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); + } + v2gDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 274; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 275; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 273: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Q.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Q.bytesLen) <= v2gDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Q.bytesLen, v2gDSAKeyValueType->Q.bytes); + } + v2gDSAKeyValueType->Q_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 276; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 276: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->G.bytesLen) <= v2gDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->G.bytesLen, v2gDSAKeyValueType->G.bytes); + } + v2gDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 274; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 275; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 274: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Y.bytesLen) <= v2gDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Y.bytesLen, v2gDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 275; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 275: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->J.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->J.bytesLen) <= v2gDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->J.bytesLen, v2gDSAKeyValueType->J.bytes); + } + v2gDSAKeyValueType->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 277; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); + } + v2gDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 278; + } 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 277: + /* 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, &v2gDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->Seed.bytesLen) <= v2gDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->Seed.bytesLen, v2gDSAKeyValueType->Seed.bytes); + } + v2gDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 278; + } 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 278: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gDSAKeyValueType->PgenCounter.bytesLen); + if (errn == 0) { + errn = (v2gDSAKeyValueType->PgenCounter.bytesLen) <= v2gDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytesLen, v2gDSAKeyValueType->PgenCounter.bytes); + } + v2gDSAKeyValueType->PgenCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { + int grammarID = 279; + int done = 0; + + init_v2gBodyType(v2gBodyType); + + while(!done) { + switch(grammarID) { + case 279: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq); + v2gBodyType->AuthorizationReq_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes); + v2gBodyType->AuthorizationRes_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement); + v2gBodyType->BodyElement_isUsed = 1u; + grammarID = 3; + break; + case 3: + errn = decode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq); + v2gBodyType->CableCheckReq_isUsed = 1u; + grammarID = 3; + break; + case 4: + errn = decode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes); + v2gBodyType->CableCheckRes_isUsed = 1u; + grammarID = 3; + break; + case 5: + errn = decode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq); + v2gBodyType->CertificateInstallationReq_isUsed = 1u; + grammarID = 3; + break; + case 6: + errn = decode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes); + v2gBodyType->CertificateInstallationRes_isUsed = 1u; + grammarID = 3; + break; + case 7: + errn = decode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq); + v2gBodyType->CertificateUpdateReq_isUsed = 1u; + grammarID = 3; + break; + case 8: + errn = decode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes); + v2gBodyType->CertificateUpdateRes_isUsed = 1u; + grammarID = 3; + break; + case 9: + errn = decode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq); + v2gBodyType->ChargeParameterDiscoveryReq_isUsed = 1u; + grammarID = 3; + break; + case 10: + errn = decode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes); + v2gBodyType->ChargeParameterDiscoveryRes_isUsed = 1u; + grammarID = 3; + break; + case 11: + errn = decode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq); + v2gBodyType->ChargingStatusReq_isUsed = 1u; + grammarID = 3; + break; + case 12: + errn = decode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes); + v2gBodyType->ChargingStatusRes_isUsed = 1u; + grammarID = 3; + break; + case 13: + errn = decode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq); + v2gBodyType->CurrentDemandReq_isUsed = 1u; + grammarID = 3; + break; + case 14: + errn = decode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes); + v2gBodyType->CurrentDemandRes_isUsed = 1u; + grammarID = 3; + break; + case 15: + errn = decode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq); + v2gBodyType->MeteringReceiptReq_isUsed = 1u; + grammarID = 3; + break; + case 16: + errn = decode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes); + v2gBodyType->MeteringReceiptRes_isUsed = 1u; + grammarID = 3; + break; + case 17: + errn = decode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq); + v2gBodyType->PaymentDetailsReq_isUsed = 1u; + grammarID = 3; + break; + case 18: + errn = decode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes); + v2gBodyType->PaymentDetailsRes_isUsed = 1u; + grammarID = 3; + break; + case 19: + errn = decode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq); + v2gBodyType->PaymentServiceSelectionReq_isUsed = 1u; + grammarID = 3; + break; + case 20: + errn = decode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes); + v2gBodyType->PaymentServiceSelectionRes_isUsed = 1u; + grammarID = 3; + break; + case 21: + errn = decode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq); + v2gBodyType->PowerDeliveryReq_isUsed = 1u; + grammarID = 3; + break; + case 22: + errn = decode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes); + v2gBodyType->PowerDeliveryRes_isUsed = 1u; + grammarID = 3; + break; + case 23: + errn = decode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq); + v2gBodyType->PreChargeReq_isUsed = 1u; + grammarID = 3; + break; + case 24: + errn = decode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes); + v2gBodyType->PreChargeRes_isUsed = 1u; + grammarID = 3; + break; + case 25: + errn = decode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq); + v2gBodyType->ServiceDetailReq_isUsed = 1u; + grammarID = 3; + break; + case 26: + errn = decode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes); + v2gBodyType->ServiceDetailRes_isUsed = 1u; + grammarID = 3; + break; + case 27: + errn = decode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq); + v2gBodyType->ServiceDiscoveryReq_isUsed = 1u; + grammarID = 3; + break; + case 28: + errn = decode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes); + v2gBodyType->ServiceDiscoveryRes_isUsed = 1u; + grammarID = 3; + break; + case 29: + errn = decode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq); + v2gBodyType->SessionSetupReq_isUsed = 1u; + grammarID = 3; + break; + case 30: + errn = decode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes); + v2gBodyType->SessionSetupRes_isUsed = 1u; + grammarID = 3; + break; + case 31: + errn = decode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq); + v2gBodyType->SessionStopReq_isUsed = 1u; + grammarID = 3; + break; + case 32: + errn = decode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes); + v2gBodyType->SessionStopRes_isUsed = 1u; + grammarID = 3; + break; + case 33: + errn = decode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq); + v2gBodyType->WeldingDetectionReq_isUsed = 1u; + grammarID = 3; + break; + case 34: + errn = decode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes); + v2gBodyType->WeldingDetectionRes_isUsed = 1u; + grammarID = 3; + break; + case 35: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { + int grammarID = 280; + int done = 0; + + init_v2gCertificateInstallationReqType(v2gCertificateInstallationReqType); + + while(!done) { + switch(grammarID) { + case 280: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->Id.charactersLen); + if (errn == 0) { + errn = (v2gCertificateInstallationReqType->Id.charactersLen - 2) <= v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gCertificateInstallationReqType->Id.charactersLen >= 2) { + v2gCertificateInstallationReqType->Id.charactersLen = (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gCertificateInstallationReqType->Id.charactersLen, v2gCertificateInstallationReqType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 281; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 281: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 100; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 100: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { + int grammarID = 282; + int done = 0; + + init_v2gServiceParameterListType(v2gServiceParameterListType); + + while(!done) { + switch(grammarID) { + case 282: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 283; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 283: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gServiceParameterListType->ParameterSet.arrayLen < v2gServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array[v2gServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 283; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType) { + int grammarID = 38; + int done = 0; + + init_v2gEVStatusType(v2gEVStatusType); + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ +static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType) { + int grammarID = 284; + int done = 0; + + init_v2gSAScheduleListType(v2gSAScheduleListType); + + while(!done) { + switch(grammarID) { + case 284: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSAScheduleListType->SAScheduleTuple.arrayLen < v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { + errn = decode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array[v2gSAScheduleListType->SAScheduleTuple.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 285; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 285: + /* 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 (v2gSAScheduleListType->SAScheduleTuple.arrayLen < v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { + errn = decode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array[v2gSAScheduleListType->SAScheduleTuple.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}SAScheduleTuple), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSAScheduleListType->SAScheduleTuple.arrayLen < v2gSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { + errn = decode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array[v2gSAScheduleListType->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='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType) { + int grammarID = 67; + int done = 0; + + init_v2gDigestMethodType(v2gDigestMethodType); + + while(!done) { + switch(grammarID) { + case 67: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gDigestMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (v2gDigestMethodType->Algorithm.charactersLen - 2) <= v2gDigestMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gDigestMethodType->Algorithm.charactersLen >= 2) { + v2gDigestMethodType->Algorithm.charactersLen = (uint16_t)(v2gDigestMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gDigestMethodType->Algorithm.charactersLen, v2gDigestMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 68; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 68: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 24; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 24; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { + int grammarID = 287; + int done = 0; + + init_v2gCostType(v2gCostType); + + while(!done) { + switch(grammarID) { + case 287: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gCostType->costKind = (v2gcostKindType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 288; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 288: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gCostType->amount); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 289; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 289: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + v2gCostType->amountMultiplier = (int8_t)(uint32 -3); + v2gCostType->amountMultiplier_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { + int grammarID = 290; + int done = 0; + + init_v2gMessageHeaderType(v2gMessageHeaderType); + + while(!done) { + switch(grammarID) { + case 290: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gMessageHeaderType->SessionID.bytesLen); + if (errn == 0) { + errn = (v2gMessageHeaderType->SessionID.bytesLen) <= v2gMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gMessageHeaderType->SessionID.bytesLen, v2gMessageHeaderType->SessionID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 291; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 291: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification); + v2gMessageHeaderType->Notification_isUsed = 1u; + grammarID = 292; + break; + case 1: + errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); + v2gMessageHeaderType->Signature_isUsed = 1u; + grammarID = 3; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 292: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); + v2gMessageHeaderType->Signature_isUsed = 1u; + grammarID = 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_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { + int grammarID = 293; + int done = 0; + + init_v2gServiceDetailReqType(v2gServiceDetailReqType); + + while(!done) { + switch(grammarID) { + case 293: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gServiceDetailReqType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12899,14 +13984,14 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType) { - int grammarID = 266; + int grammarID = 294; int done = 0; init_v2gTransformsType(v2gTransformsType); while(!done) { switch(grammarID) { - case 266: + case 294: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12917,7 +14002,7 @@ static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsTyp } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 267; + grammarID = 295; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12925,7 +14010,7 @@ static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsTyp } } break; - case 267: + case 295: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12936,216 +14021,10 @@ static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsTyp } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 267; + grammarID = 295; break; case 1: done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ -static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { - int grammarID = 268; - int done = 0; - - init_v2gSalesTariffEntryType(v2gSalesTariffEntryType); - - while(!done) { - switch(grammarID) { - case 268: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval); - v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 269; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval); - v2gSalesTariffEntryType->TimeInterval_isUsed = 1u; - grammarID = 269; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 269: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); - v2gSalesTariffEntryType->EPriceLevel_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 270; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 271; - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 270: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 271; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 271: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 272; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 272: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 4; - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { - int grammarID = 143; - int done = 0; - - init_v2gWeldingDetectionReqType(v2gWeldingDetectionReqType); - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus); grammarID = 4; break; default: @@ -13154,21 +14033,6 @@ static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeld } } break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; default: errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; @@ -13180,997 +14044,12 @@ static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeld return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { - int grammarID = 273; - int done = 0; - - init_v2gSessionSetupResType(v2gSessionSetupResType); - - while(!done) { - switch(grammarID) { - case 273: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gSessionSetupResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 274; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 274: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gSessionSetupResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gSessionSetupResType->EVSEID.charactersLen - 2) <= v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSessionSetupResType->EVSEID.charactersLen >= 2) { - v2gSessionSetupResType->EVSEID.charactersLen = (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSessionSetupResType->EVSEID.charactersLen, v2gSessionSetupResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 275; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 275: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gSessionSetupResType->EVSETimeStamp); - v2gSessionSetupResType->EVSETimeStamp_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { - int grammarID = 276; - int done = 0; - - init_v2gSignatureMethodType(v2gSignatureMethodType); - - while(!done) { - switch(grammarID) { - case 276: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gSignatureMethodType->Algorithm.charactersLen); - if (errn == 0) { - errn = (v2gSignatureMethodType->Algorithm.charactersLen - 2) <= v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gSignatureMethodType->Algorithm.charactersLen >= 2) { - v2gSignatureMethodType->Algorithm.charactersLen = (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gSignatureMethodType->Algorithm.charactersLen, v2gSignatureMethodType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 277; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 277: - /* 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, &v2gSignatureMethodType->HMACOutputLength); - v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 25; - } 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 = 25; - break; - case 2: - done = 1; - grammarID = 5; - break; - case 3: - grammarID = 278; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 25: - /* 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 = 25; - break; - case 1: - done = 1; - grammarID = 5; - break; - case 2: - grammarID = 25; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 278: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gSignatureMethodType->HMACOutputLength); - v2gSignatureMethodType->HMACOutputLength_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 25; - } 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 = 25; - break; - case 2: - done = 1; - grammarID = 5; - break; - case 3: - grammarID = 278; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType) { - int grammarID = 279; - int done = 0; - - init_v2gCurrentDemandResType(v2gCurrentDemandResType); - - while(!done) { - switch(grammarID) { - case 279: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gCurrentDemandResType->ResponseCode = (v2gresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - 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}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gCurrentDemandResType->DC_EVSEStatus); - grammarID = 281; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 281: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentVoltage); - grammarID = 282; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 282: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentCurrent); - grammarID = 283; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 283: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSECurrentLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 284; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 284: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEVoltageLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 285; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 285: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->EVSEPowerLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 286; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 286: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumVoltageLimit); - v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; - grammarID = 287; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); - v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 288; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 289; - break; - case 3: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 290; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 287: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); - v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 288; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 289; - break; - case 2: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 290; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 288: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 289; - break; - case 1: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 290; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 289: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCurrentDemandResType->EVSEID.charactersLen); - if (errn == 0) { - errn = (v2gCurrentDemandResType->EVSEID.charactersLen - 2) <= v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gCurrentDemandResType->EVSEID.charactersLen >= 2) { - v2gCurrentDemandResType->EVSEID.charactersLen = (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gCurrentDemandResType->EVSEID.charactersLen, v2gCurrentDemandResType->EVSEID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 290; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 290: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gCurrentDemandResType->SAScheduleTupleID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo); - v2gCurrentDemandResType->MeterInfo_isUsed = 1u; - grammarID = 292; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); - v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 292: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gCurrentDemandResType->ReceiptRequired); - v2gCurrentDemandResType->ReceiptRequired_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { - int grammarID = 293; - int done = 0; - - init_v2gChargeParameterDiscoveryReqType(v2gChargeParameterDiscoveryReqType); - - while(!done) { - switch(grammarID) { - case 293: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); - v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 294; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 295; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 294: - /* Element[START_ELEMENT({urn:iso:15118:2:2013: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); - v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode = (v2gEnergyTransferModeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 295; - } 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}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter); - v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; - grammarID = 4; - break; - case 1: - errn = decode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter); - v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; - grammarID = 4; - break; - case 2: - errn = decode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter); - v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { int grammarID = 296; int done = 0; - init_v2gCableCheckResType(v2gCableCheckResType); + init_v2gWeldingDetectionResType(v2gWeldingDetectionResType); while(!done) { switch(grammarID) { @@ -14185,7 +14064,7 @@ static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheck if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gCableCheckResType->ResponseCode = (v2gresponseCodeType) uint32; + v2gWeldingDetectionResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -14213,8 +14092,8 @@ static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheck if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus); - grammarID = 32; + errn = decode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus); + grammarID = 298; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14222,99 +14101,14 @@ static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheck } } break; - case 32: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gCableCheckResType->EVSEProcessing = (v2gEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { - int grammarID = 298; - int done = 0; - - init_v2gRelativeTimeIntervalType(v2gRelativeTimeIntervalType); - - while(!done) { - switch(grammarID) { case 298: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->start); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 299; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage); + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14322,155 +14116,15 @@ static int decode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRel } } break; - case 299: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gRelativeTimeIntervalType->duration); - v2gRelativeTimeIntervalType->duration_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { - int grammarID = 300; - int done = 0; - - init_v2gSAScheduleTupleType(v2gSAScheduleTupleType); - - while(!done) { - switch(grammarID) { - case 300: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gSAScheduleTupleType->SAScheduleTupleID = (uint8_t)(uint32 + 1); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 301; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 301: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule); - grammarID = 302; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 302: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff); - v2gSAScheduleTupleType->SalesTariff_isUsed = 1u; grammarID = 4; break; - case 1: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -14488,510 +14142,16 @@ static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSASchedu return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { - int grammarID = 303; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { + int grammarID = 296; int done = 0; - init_v2gDC_EVSEStatusType(v2gDC_EVSEStatusType); + init_v2gPreChargeResType(v2gPreChargeResType); while(!done) { switch(grammarID) { - case 303: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gDC_EVSEStatusType->NotificationMaxDelay); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 304; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 304: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - v2gDC_EVSEStatusType->EVSENotification = (v2gEVSENotificationType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 305; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 305: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - v2gDC_EVSEStatusType->EVSEIsolationStatus = (v2gisolationLevelType) uint32; - v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 306; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 306: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - v2gDC_EVSEStatusType->EVSEStatusCode = (v2gDC_EVSEStatusCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { - int grammarID = 13; - int done = 0; - - init_v2gIntervalType(v2gIntervalType); - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { - int grammarID = 307; - int done = 0; - - init_v2gReferenceType(v2gReferenceType); - - while(!done) { - switch(grammarID) { - case 307: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Id.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->Id.charactersLen - 2) <= v2gReferenceType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->Id.charactersLen >= 2) { - v2gReferenceType->Id.charactersLen = (uint16_t)(v2gReferenceType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->Id.charactersLen, v2gReferenceType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->Id_isUsed = 1u; - grammarID = 308; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->Type.charactersLen >= 2) { - v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->Type_isUsed = 1u; - grammarID = 309; - break; - case 2: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->URI.charactersLen >= 2) { - v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->URI_isUsed = 1u; - grammarID = 310; - break; - case 3: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 311; - break; - case 4: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 312; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 308: - /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->Type.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->Type.charactersLen - 2) <= v2gReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->Type.charactersLen >= 2) { - v2gReferenceType->Type.charactersLen = (uint16_t)(v2gReferenceType->Type.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->Type.charactersLen, v2gReferenceType->Type.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->Type_isUsed = 1u; - grammarID = 309; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->URI.charactersLen >= 2) { - v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->URI_isUsed = 1u; - grammarID = 310; - break; - case 2: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 311; - break; - case 3: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 312; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 309: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->URI.charactersLen); - if (errn == 0) { - errn = (v2gReferenceType->URI.charactersLen - 2) <= v2gReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gReferenceType->URI.charactersLen >= 2) { - v2gReferenceType->URI.charactersLen = (uint16_t)(v2gReferenceType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gReferenceType->URI.charactersLen, v2gReferenceType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gReferenceType->URI_isUsed = 1u; - grammarID = 310; - break; - case 1: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 311; - break; - case 2: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 312; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 310: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 311; - break; - case 1: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 312; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 311: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 312; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 312: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gReferenceType->DigestValue.bytesLen); - if (errn == 0) { - errn = (v2gReferenceType->DigestValue.bytesLen) <= v2gReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gReferenceType->DigestValue.bytesLen, v2gReferenceType->DigestValue.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 4; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 4: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 5; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - int grammarID = 313; - int done = 0; - - init_v2gCertificateUpdateResType(v2gCertificateUpdateResType); - - while(!done) { - switch(grammarID) { - case 313: + case 296: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -15002,7 +14162,7 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - v2gCertificateUpdateResType->ResponseCode = (v2gresponseCodeType) uint32; + v2gPreChargeResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -15012,7 +14172,7 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 314; + grammarID = 297; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -15024,14 +14184,674 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer } } break; - case 314: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + case 297: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain); - grammarID = 315; + errn = decode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus); + grammarID = 298; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 298: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ +static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { + int grammarID = 299; + int done = 0; + + init_v2gAC_EVChargeParameterType(v2gAC_EVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 299: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &v2gAC_EVChargeParameterType->DepartureTime); + v2gAC_EVChargeParameterType->DepartureTime_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 300; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); + grammarID = 301; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 300: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); + grammarID = 301; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 301: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage); + grammarID = 302; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 302: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxCurrent); + grammarID = 303; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 303: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMinCurrent); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ +static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { + int grammarID = 304; + int done = 0; + + init_v2gSalesTariffEntryType(v2gSalesTariffEntryType); + + while(!done) { + switch(grammarID) { + case 304: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval); + v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 305; + break; + case 1: + errn = decode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval); + v2gSalesTariffEntryType->TimeInterval_isUsed = 1u; + grammarID = 305; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 305: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); + v2gSalesTariffEntryType->EPriceLevel_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 306; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 307; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 306: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 307; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 307: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 308; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 308: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gSalesTariffEntryType->ConsumptionCost.arrayLen < v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array[v2gSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { + int grammarID = 309; + int done = 0; + + init_v2gPMaxScheduleEntryType(v2gPMaxScheduleEntryType); + + while(!done) { + switch(grammarID) { + case 309: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval); + v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 310; + break; + case 1: + errn = decode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval); + v2gPMaxScheduleEntryType->TimeInterval_isUsed = 1u; + grammarID = 310; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 310: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { + int grammarID = 38; + int done = 0; + + init_v2gBodyBaseType(v2gBodyBaseType); + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { + int grammarID = 311; + int done = 0; + + init_v2gSalesTariffType(v2gSalesTariffType); + + while(!done) { + switch(grammarID) { + case 311: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->Id.charactersLen); + if (errn == 0) { + errn = (v2gSalesTariffType->Id.charactersLen - 2) <= v2gSalesTariffType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSalesTariffType->Id.charactersLen >= 2) { + v2gSalesTariffType->Id.charactersLen = (uint16_t)(v2gSalesTariffType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSalesTariffType->Id.charactersLen, v2gSalesTariffType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSalesTariffType->Id_isUsed = 1u; + grammarID = 312; + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 313; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 312: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->SalesTariffID = (uint8_t)(uint32 + 1); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 313; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 313: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gSalesTariffType->SalesTariffDescription.charactersLen); + if (errn == 0) { + errn = (v2gSalesTariffType->SalesTariffDescription.charactersLen - 2) <= v2gSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gSalesTariffType->SalesTariffDescription.charactersLen >= 2) { + v2gSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.charactersLen, v2gSalesTariffType->SalesTariffDescription.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gSalesTariffType->SalesTariffDescription_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 314; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 315; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 316; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 314: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + v2gSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + v2gSalesTariffType->NumEPriceLevels_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 315; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 316; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15040,12 +14860,16 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer } break; case 315: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain); + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } grammarID = 316; break; default: @@ -15055,13 +14879,21 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer } break; case 316: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey); - grammarID = 317; + if (v2gSalesTariffType->SalesTariffEntry.arrayLen < v2gSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array[v2gSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 316; + break; + case 1: + done = 1; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15069,13 +14901,45 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer } } 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_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType) { + int grammarID = 317; + int done = 0; + + init_v2gTransformType(v2gTransformType); + + while(!done) { + switch(grammarID) { case 317: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey); + errn = decodeUnsignedInteger16(stream, &v2gTransformType->Algorithm.charactersLen); + if (errn == 0) { + errn = (v2gTransformType->Algorithm.charactersLen - 2) <= v2gTransformType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gTransformType->Algorithm.charactersLen >= 2) { + v2gTransformType->Algorithm.charactersLen = (uint16_t)(v2gTransformType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gTransformType->Algorithm.charactersLen, v2gTransformType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } grammarID = 318; break; default: @@ -15085,12 +14949,58 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer } break; case 318: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + /* 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: - errn = decode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID); + if (v2gTransformType->XPath.arrayLen < v2gTransformType_XPath_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2) <= v2gTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen >= 2) { + v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen = (uint16_t)(v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gTransformType->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 = 319; + } 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 = 319; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: grammarID = 319; break; default: @@ -15100,35 +15010,59 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer } break; case 319: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* 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: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gCertificateUpdateResType->RetryCounter); - v2gCertificateUpdateResType->RetryCounter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + if (v2gTransformType->XPath.arrayLen < v2gTransformType_XPath_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen); + if (errn == 0) { + errn = (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2) <= v2gTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen >= 2) { + v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen = (uint16_t)(v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].charactersLen, v2gTransformType->XPath.array[v2gTransformType->XPath.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gTransformType->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({urn:iso:15118:2:2013:MsgBody}RetryCounter) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 4; + grammarID = 319; } 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 = 319; + break; + case 2: done = 1; - grammarID = 5; + grammarID = 4; + break; + case 3: + grammarID = 319; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15136,14 +15070,82 @@ static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer } } break; - case 4: + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { + int grammarID = 5; + int done = 0; + + init_v2gDiffieHellmanPublickeyType(v2gDiffieHellmanPublickeyType); + + while(!done) { + switch(grammarID) { + case 5: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->Id.charactersLen); + if (errn == 0) { + errn = (v2gDiffieHellmanPublickeyType->Id.charactersLen - 2) <= v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gDiffieHellmanPublickeyType->Id.charactersLen >= 2) { + v2gDiffieHellmanPublickeyType->Id.charactersLen = (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.charactersLen, v2gDiffieHellmanPublickeyType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 6; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 6: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); + if (errn == 0) { + errn = (v2gDiffieHellmanPublickeyType->CONTENT.bytesLen) <= v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen, v2gDiffieHellmanPublickeyType->CONTENT.bytes); + } + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 5; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15642,6 +15644,7 @@ int decode_v2gExiDocument(bitstream_t* stream, struct v2gEXIDocument* exiDoc) { return errn; } +#endif /* DEPLOY_ISO_CODEC */ #endif diff --git a/src/codec/v2gEXIDatatypesDecoder.h b/src/codec/v2gEXIDatatypesDecoder.h index f07dddb..442c4db 100644 --- a/src/codec/v2gEXIDatatypesDecoder.h +++ b/src/codec/v2gEXIDatatypesDecoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -42,6 +42,7 @@ extern "C" { #endif +#if DEPLOY_ISO_CODEC == SUPPORT_YES #includeCode generated by EXIdizer
@@ -41,119 +41,121 @@ #ifndef EXI_v2g_DATATYPES_ENCODER_C #define EXI_v2g_DATATYPES_ENCODER_C +#if DEPLOY_ISO_CODEC == SUPPORT_YES + static int errn; /* Forward Declarations */ -static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); -static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); -static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); -static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); -static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); -static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); -static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); -static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); -static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); -static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); -static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); -static int encode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); -static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); -static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); +static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); -static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); -static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); +static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); +static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); +static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); +static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); +static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); +static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); +static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); +static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); +static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); +static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); +static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); +static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); +static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); +static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); +static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); +static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); -static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); +static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); +static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); +static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); +static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); +static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); +static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); +static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); +static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); +static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); +static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); +static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); +static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); +static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); +static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); +static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); +static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); +static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); +static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); +static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); +static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); +static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); +static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); +static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); +static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); +static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); +static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); +static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); +static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); +static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); +static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); +static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); +static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); +static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); +static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); +static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); +static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); +static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); +static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); +static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); +static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); +static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); +static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); +static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); static int encode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); -static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); -static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); -static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); -static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); -static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); -static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); -static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); -static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); -static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); -static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); -static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); -static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); -static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); -static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); -static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); -static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); -static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); -static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); -static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); -static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); -static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); -static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); -static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); -static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType); -static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); -static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); -static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); -static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); -static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); -static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); -static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); -static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); -static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); -static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); -static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); -static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); -static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); -static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); -static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); -static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); -static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); -static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); -static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); -static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); -static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); -static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); -static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); -static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); -static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); +static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); +static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); +static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); +static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); +static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); +static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); +static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); +static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); +static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); +static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); +static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); +static int encode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); static int encode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType); -static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); -static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); +static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); +static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); +static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); +static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); +static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); +static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); +static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); +static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); +static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); +static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); +static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); +static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); +static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); +static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); +static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); +static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); +static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); +static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); +static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); +static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); +static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); - /* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { int grammarID = 0; int done = 0; @@ -161,14 +163,14 @@ static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gPowerDeliveryReqType->ChargeProgress); + errn = encodeUnsignedInteger32(stream, v2gProfileEntryType->ChargingProfileEntryStart); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -179,17 +181,11 @@ static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gPowerDeliveryReqType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower ); } grammarID = 2; } else { @@ -197,4499 +193,41 @@ static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( v2gPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ + if ( v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile ); + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, (uint32_t)(v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } grammarID = 3; - } else if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 4; - } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 4; } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); + errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 3: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 4; - } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { - int grammarID = 6; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 6: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateUpdateReqType->Id.characters, v2gCertificateUpdateReqType->Id.charactersLen); - } - } - grammarID = 7; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 7: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain ); - } - grammarID = 8; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 8: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->eMAID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateUpdateReqType->eMAID.characters, v2gCertificateUpdateReqType->eMAID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 9; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs ); - } grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { - int grammarID = 10; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 10: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMessageHeaderType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMessageHeaderType->SessionID.bytes, v2gMessageHeaderType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 11; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 11: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( v2gMessageHeaderType->Notification_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification ); - } - grammarID = 12; - } else if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 12: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { - int grammarID = 14; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 14: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gWeldingDetectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 15: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus ); - } - grammarID = 16; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 16: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { - int grammarID = 17; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 17: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gCostType->costKind); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 18; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 18: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gCostType->amount); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 19: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ - if ( v2gCostType->amountMultiplier_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gCostType->amountMultiplier + 3)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { - int grammarID = 20; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 20: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateInstallationReqType->Id.characters, v2gCertificateInstallationReqType->Id.charactersLen); - } - } - grammarID = 21; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 21: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 9; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { - int grammarID = 22; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 22: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - if ( v2gEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval ); - } - grammarID = 4; - } else if ( v2gEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gEntryType->TimeInterval ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { - int grammarID = 23; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 23: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.characters, v2gCanonicalizationMethodType->Algorithm.charactersLen); - } - } - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 25: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { - int grammarID = 26; - int done = 0; - - unsigned int v2gSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 26: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - if ( v2gSignaturePropertiesType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertiesType->Id.characters, v2gSignaturePropertiesType->Id.charactersLen); - } - } - grammarID = 27; - } else if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 28; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 27: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 28; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 28: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ - if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 28; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { - int grammarID = 29; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 29: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentServiceSelectionReqType->SelectedPaymentOption); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 30; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 30: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { - int grammarID = 31; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 31: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gAuthorizationResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 32; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 32: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gAuthorizationResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ -static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { - int grammarID = 33; - int done = 0; - - unsigned int v2gConsumptionCostType_Cost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 33: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue ); - } - grammarID = 34; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 34: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ - if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 35; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 35: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 36; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 36: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ - if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { - int grammarID = 37; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 37: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateInstallationResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 38; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 38: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain ); - } - grammarID = 39; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 39: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain ); - } - grammarID = 40; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 40: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey ); - } - grammarID = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey ); - } - grammarID = 42; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { - int grammarID = 43; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 43: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionStopResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ -static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { - int grammarID = 44; - int done = 0; - - unsigned int v2gServiceListType_Service_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 44: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 45: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 46; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 46: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 47; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 47: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 48; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 48: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 49; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 49: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 50; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 50: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 51; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 51: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ - if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { - int grammarID = 52; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 52: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ - if ( v2gMeteringReceiptReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gMeteringReceiptReqType->Id.characters, v2gMeteringReceiptReqType->Id.charactersLen); - } - } - grammarID = 53; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 54; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 53: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 54; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 54: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ - if ( v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gMeteringReceiptReqType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 55; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 55: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { - int grammarID = 56; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 56: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.characters, v2gX509IssuerSerialType->X509IssuerName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 57; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 57: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gX509IssuerSerialType->X509SerialNumber); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { - int grammarID = 58; - int done = 0; - - unsigned int v2gSignatureType_Object_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 58: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( v2gSignatureType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignatureType->Id.characters, v2gSignatureType->Id.charactersLen); - } - } - grammarID = 59; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); - } - grammarID = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 59: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); - } - grammarID = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 60: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue ); - } - grammarID = 61; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 61: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if ( v2gSignatureType->KeyInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo ); - } - grammarID = 62; - } else if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); - } - grammarID = 62; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 62: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); - } - grammarID = 62; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ -static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { - int grammarID = 63; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 63: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus ); - } - grammarID = 64; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 64: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage ); - } - grammarID = 65; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 65: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ -static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType) { - int grammarID = 66; - int done = 0; - - unsigned int v2gSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 66: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */ - if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 67; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 67: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ - if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 68; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 68: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ - if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { - int grammarID = 69; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 69: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus ); - } - grammarID = 70; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 70: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ - if ( v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 71: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { - int grammarID = 72; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 72: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 73; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList ); - } - grammarID = 74; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 74: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService ); - } - grammarID = 75; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 75: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ - if ( v2gServiceDiscoveryResType->ServiceList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { - int grammarID = 76; - int done = 0; - - unsigned int v2gServiceParameterListType_ParameterSet_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 76: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ - if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 77; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 77: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ - if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 77; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { - int grammarID = 78; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 78: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - if ( v2gDC_EVChargeParameterType->DepartureTime_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gDC_EVChargeParameterType->DepartureTime); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 79; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); - } - grammarID = 80; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); - } - grammarID = 80; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 80: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit ); - } - grammarID = 81; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit ); - } - grammarID = 82; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 83; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 82: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 83; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 83: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity ); - } - grammarID = 84; - } else if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 85; - } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 86; - } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 84: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 85; - } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 86; - } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 85: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 86; - } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 86: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { - int grammarID = 87; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 87: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( v2gServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gServiceDiscoveryReqType->ServiceScope.characters, v2gServiceDiscoveryReqType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 88; - } else if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 88: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { - int grammarID = 89; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 89: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - if ( v2gSignatureValueType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignatureValueType->Id.characters, v2gSignatureValueType->Id.charactersLen); - } - } - grammarID = 90; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 90: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { - int grammarID = 91; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 91: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ - if ( v2gBodyType->AuthorizationReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 0); - if(errn == 0) { - errn = encode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq ); - } - grammarID = 4; - } else if ( v2gBodyType->AuthorizationRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 1); - if(errn == 0) { - errn = encode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes ); - } - grammarID = 4; - } else if ( v2gBodyType->BodyElement_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 2); - if(errn == 0) { - errn = encode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement ); - } - grammarID = 4; - } else if ( v2gBodyType->CableCheckReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 3); - if(errn == 0) { - errn = encode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq ); - } - grammarID = 4; - } else if ( v2gBodyType->CableCheckRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 4); - if(errn == 0) { - errn = encode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes ); - } - grammarID = 4; - } else if ( v2gBodyType->CertificateInstallationReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 5); - if(errn == 0) { - errn = encode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq ); - } - grammarID = 4; - } else if ( v2gBodyType->CertificateInstallationRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 6); - if(errn == 0) { - errn = encode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes ); - } - grammarID = 4; - } else if ( v2gBodyType->CertificateUpdateReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 7); - if(errn == 0) { - errn = encode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq ); - } - grammarID = 4; - } else if ( v2gBodyType->CertificateUpdateRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 8); - if(errn == 0) { - errn = encode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes ); - } - grammarID = 4; - } else if ( v2gBodyType->ChargeParameterDiscoveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 9); - if(errn == 0) { - errn = encode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq ); - } - grammarID = 4; - } else if ( v2gBodyType->ChargeParameterDiscoveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 10); - if(errn == 0) { - errn = encode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes ); - } - grammarID = 4; - } else if ( v2gBodyType->ChargingStatusReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 11); - if(errn == 0) { - errn = encode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq ); - } - grammarID = 4; - } else if ( v2gBodyType->ChargingStatusRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 12); - if(errn == 0) { - errn = encode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes ); - } - grammarID = 4; - } else if ( v2gBodyType->CurrentDemandReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 13); - if(errn == 0) { - errn = encode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq ); - } - grammarID = 4; - } else if ( v2gBodyType->CurrentDemandRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 14); - if(errn == 0) { - errn = encode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes ); - } - grammarID = 4; - } else if ( v2gBodyType->MeteringReceiptReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 15); - if(errn == 0) { - errn = encode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq ); - } - grammarID = 4; - } else if ( v2gBodyType->MeteringReceiptRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 16); - if(errn == 0) { - errn = encode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes ); - } - grammarID = 4; - } else if ( v2gBodyType->PaymentDetailsReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 17); - if(errn == 0) { - errn = encode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq ); - } - grammarID = 4; - } else if ( v2gBodyType->PaymentDetailsRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 18); - if(errn == 0) { - errn = encode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes ); - } - grammarID = 4; - } else if ( v2gBodyType->PaymentServiceSelectionReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 19); - if(errn == 0) { - errn = encode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq ); - } - grammarID = 4; - } else if ( v2gBodyType->PaymentServiceSelectionRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 20); - if(errn == 0) { - errn = encode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes ); - } - grammarID = 4; - } else if ( v2gBodyType->PowerDeliveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 21); - if(errn == 0) { - errn = encode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq ); - } - grammarID = 4; - } else if ( v2gBodyType->PowerDeliveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 22); - if(errn == 0) { - errn = encode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes ); - } - grammarID = 4; - } else if ( v2gBodyType->PreChargeReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 23); - if(errn == 0) { - errn = encode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq ); - } - grammarID = 4; - } else if ( v2gBodyType->PreChargeRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 24); - if(errn == 0) { - errn = encode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes ); - } - grammarID = 4; - } else if ( v2gBodyType->ServiceDetailReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 25); - if(errn == 0) { - errn = encode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq ); - } - grammarID = 4; - } else if ( v2gBodyType->ServiceDetailRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 26); - if(errn == 0) { - errn = encode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes ); - } - grammarID = 4; - } else if ( v2gBodyType->ServiceDiscoveryReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 27); - if(errn == 0) { - errn = encode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq ); - } - grammarID = 4; - } else if ( v2gBodyType->ServiceDiscoveryRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 28); - if(errn == 0) { - errn = encode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes ); - } - grammarID = 4; - } else if ( v2gBodyType->SessionSetupReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 29); - if(errn == 0) { - errn = encode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq ); - } - grammarID = 4; - } else if ( v2gBodyType->SessionSetupRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 30); - if(errn == 0) { - errn = encode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes ); - } - grammarID = 4; - } else if ( v2gBodyType->SessionStopReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 31); - if(errn == 0) { - errn = encode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq ); - } - grammarID = 4; - } else if ( v2gBodyType->SessionStopRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 32); - if(errn == 0) { - errn = encode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes ); - } - grammarID = 4; - } else if ( v2gBodyType->WeldingDetectionReq_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 33); - if(errn == 0) { - errn = encode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq ); - } - grammarID = 4; - } else if ( v2gBodyType->WeldingDetectionRes_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 6, 34); - if(errn == 0) { - errn = encode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 6, 35); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { - int grammarID = 92; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 92: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentDetailsResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 93; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 93: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsResType->GenChallenge.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytes, v2gPaymentDetailsResType->GenChallenge.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 94; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 94: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gPaymentDetailsResType->EVSETimeStamp); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { - int grammarID = 95; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gMeteringReceiptResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 96: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ - if ( v2gMeteringReceiptResType->AC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus ); - } - grammarID = 4; - } else if ( v2gMeteringReceiptResType->DC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus ); - } - grammarID = 4; - } else if ( v2gMeteringReceiptResType->EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType) { - int grammarID = 97; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 97: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRSAKeyValueType->Modulus.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gRSAKeyValueType->Modulus.bytes, v2gRSAKeyValueType->Modulus.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 98; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 98: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRSAKeyValueType->Exponent.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gRSAKeyValueType->Exponent.bytes, v2gRSAKeyValueType->Exponent.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { - int grammarID = 99; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 99: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupReqType->EVCCID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytes, v2gSessionSetupReqType->EVCCID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { - int grammarID = 100; - int done = 0; - - unsigned int v2gSignedInfoType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 100: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( v2gSignedInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignedInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignedInfoType->Id.characters, v2gSignedInfoType->Id.charactersLen); - } - } - grammarID = 101; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); - } - grammarID = 102; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 101: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); - } - grammarID = 102; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 102: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod ); - } - grammarID = 103; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 103: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 104; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 104: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 104; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { - int grammarID = 105; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 105: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ - if ( v2gAuthorizationReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gAuthorizationReqType->Id.characters, v2gAuthorizationReqType->Id.charactersLen); - } - } - grammarID = 106; - } else if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 106: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ - if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { - int grammarID = 107; - int done = 0; - - unsigned int v2gChargingProfileType_ProfileEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 107: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ - if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 108; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 108: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 108; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { - int grammarID = 109; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 109: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.characters, v2gDiffieHellmanPublickeyType->Id.charactersLen); - } - } - grammarID = 90; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 90: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytes, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType) { - int grammarID = 110; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 110: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gSelectedServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 111; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 111: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID), END_ELEMENT] */ - if ( v2gSelectedServiceType->ParameterSetID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gSelectedServiceType->ParameterSetID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ -static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { - int grammarID = 112; - int done = 0; - - unsigned int v2gSubCertificatesType_Certificate_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 112: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 113; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 114; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 114: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 115; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 115: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ - if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); - v2gSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { - int grammarID = 116; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 116: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - if ( v2gCertificateChainType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCertificateChainType->Id.characters, v2gCertificateChainType->Id.charactersLen); - } - } - grammarID = 117; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 118; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 117: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 118; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 118: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), END_ELEMENT] */ - if ( v2gCertificateChainType->SubCertificates_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ -static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { - int grammarID = 119; - int done = 0; - - unsigned int v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 119: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 120; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 120: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 121; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 121: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 122; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 123; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 124; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 124: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ - if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { - int grammarID = 125; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 125: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus ); - } - grammarID = 126; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 126: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent ); - } - grammarID = 127; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit ); - } - grammarID = 128; - } else if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 129; - } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 130; - } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 131; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 132; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 128: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 129; - } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 130; - } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 131; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 132; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 129: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 130; - } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 131; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 132; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 130: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 131; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 132; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 131: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 132; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 132: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC ); - } - grammarID = 133; - } else if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 134; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 133: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 134; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 134: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { - int grammarID = 135; - int done = 0; - - unsigned int v2gSalesTariffType_SalesTariffEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 135: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ - if ( v2gSalesTariffType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSalesTariffType->Id.characters, v2gSalesTariffType->Id.charactersLen); - } - } - grammarID = 136; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 137; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 136: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 137; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 137: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - if ( v2gSalesTariffType->SalesTariffDescription_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.characters, v2gSalesTariffType->SalesTariffDescription.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 138; - } else if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 139; - } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 140; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 138: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 139; - } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 140; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 139: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ - if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 140; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 140: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 140; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { - int grammarID = 141; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 141: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gEMAIDType->Id.characters, v2gEMAIDType->Id.charactersLen); - } - } - grammarID = 142; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 142: - /* StartTag[CHARACTERS[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->CONTENT.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gEMAIDType->CONTENT.characters, v2gEMAIDType->CONTENT.charactersLen); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType) { - int grammarID = 143; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gCableCheckReqType->DC_EVStatus ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { - int grammarID = 14; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 14: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPreChargeResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 15: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus ); - } - grammarID = 16; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 16: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { - int grammarID = 144; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 144: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gPhysicalValueType->Multiplier + 3)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 145; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 145: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gPhysicalValueType->Unit); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 146; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 146: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gPhysicalValueType->Value); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; default: errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; @@ -4703,13 +241,13 @@ static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalVa /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { - int grammarID = 109; + int grammarID = 5; int done = 0; while(!done) { switch(grammarID) { - case 109: + case 5: /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4720,12 +258,12 @@ static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea errn = encodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.characters, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); } } - grammarID = 90; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 90: + case 6: /* StartTag[CHARACTERS[BINARY_BASE64]] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4735,19 +273,19 @@ static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea errn = encodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); } } - grammarID = 4; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: + case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -4763,41 +301,194 @@ static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { - int grammarID = 147; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { + int grammarID = 7; int done = 0; - unsigned int v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 147: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ - if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); + case 7: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( v2gServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gServiceDiscoveryReqType->ServiceScope.characters, v2gServiceDiscoveryReqType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 148; + grammarID = 8; + } else if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 148: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ - if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + case 8: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 148; + grammarID = 3; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType) { + int grammarID = 9; + int done = 0; + + unsigned int v2gSignatureType_Object_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( v2gSignatureType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignatureType->Id.characters, v2gSignatureType->Id.charactersLen); + } + } + grammarID = 10; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 10: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); + } + grammarID = 11; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignatureValueType(stream, &v2gSignatureType->SignatureValue ); + } + grammarID = 12; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 12: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if ( v2gSignatureType->KeyInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gKeyInfoType(stream, &v2gSignatureType->KeyInfo ); + } + grammarID = 13; + } else if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); + } + grammarID = 13; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 13: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if (v2gSignatureType_Object_currArrayIndex < v2gSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gObjectType(stream, &v2gSignatureType->Object.array [v2gSignatureType_Object_currArrayIndex++]); + } + grammarID = 13; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -4815,13 +506,13 @@ static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxSchedul /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType) { - int grammarID = 149; + int grammarID = 14; int done = 0; while(!done) { switch(grammarID) { - case 149: + case 14: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4834,12 +525,12 @@ static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 150; + grammarID = 15; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 150: + case 15: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ if ( v2gNotificationType->FaultMsg_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -4856,298 +547,96 @@ static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 4; + grammarID = 3; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: + case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ -static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType) { - int grammarID = 151; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 151: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gChargeServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 152; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 152: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( v2gChargeServiceType->ServiceName_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gChargeServiceType->ServiceName.characters, v2gChargeServiceType->ServiceName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 153; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 154; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 153: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 154; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 154: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( v2gChargeServiceType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gChargeServiceType->ServiceScope.characters, v2gChargeServiceType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 155; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 156; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 155: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 156; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 156: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode ); - } grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ +static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { + int grammarID = 16; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 16: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gAC_EVSEChargeParameterType->AC_EVSEStatus ); + } + grammarID = 17; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 17: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENominalVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSENominalVoltage ); + } + grammarID = 18; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 18: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { - int grammarID = 95; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 95: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPowerDeliveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 96; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 96: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ - if ( v2gPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus ); - } - grammarID = 4; - } else if ( v2gPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus ); - } - grammarID = 4; - } else if ( v2gPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus ); - } grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; default: errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; break; @@ -5159,648 +648,16 @@ static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDe return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ -static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { - int grammarID = 157; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { + int grammarID = 19; int done = 0; while(!done) { switch(grammarID) { - case 157: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gEVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 158; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 158: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gEVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { - int grammarID = 159; - int done = 0; - - unsigned int v2gX509DataType_X509IssuerSerial_currArrayIndex = 0; - unsigned int v2gX509DataType_X509SKI_currArrayIndex = 0; - unsigned int v2gX509DataType_X509SubjectName_currArrayIndex = 0; - unsigned int v2gX509DataType_X509Certificate_currArrayIndex = 0; - unsigned int v2gX509DataType_X509CRL_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 159: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); - } - grammarID = 160; - } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); - v2gX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); - v2gX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); - v2gX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); - v2gX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 160; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 160: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); - } - grammarID = 160; - } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); - v2gX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); - v2gX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); - v2gX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); - v2gX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 160; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 160; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 6); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { - int grammarID = 161; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 161: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus ); - } - grammarID = 162; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 162: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage ); - } - grammarID = 163; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 163: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType) { - int grammarID = 23; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 23: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDigestMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gDigestMethodType->Algorithm.characters, v2gDigestMethodType->Algorithm.charactersLen); - } - } - grammarID = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 25: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { - int grammarID = 164; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 164: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - if ( v2gPGPDataType->PGPKeyID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPGPDataType->PGPKeyID.bytes, v2gPGPDataType->PGPKeyID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 165; - } else if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 166; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 165: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 166; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 166; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 166: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 166; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType) { - int grammarID = 167; - int done = 0; - - unsigned int v2gTransformType_XPath_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 167: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gTransformType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gTransformType->Algorithm.characters, v2gTransformType->Algorithm.charactersLen); - } - } - grammarID = 168; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 168: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (v2gTransformType_XPath_currArrayIndex < v2gTransformType->XPath.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].characters, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen); - v2gTransformType_XPath_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 169; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 169; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 169; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 169: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (v2gTransformType_XPath_currArrayIndex < v2gTransformType->XPath.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].characters, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen); - v2gTransformType_XPath_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 169; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 169; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 169; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { - int grammarID = 170; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 170: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + case 19: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { @@ -5808,1857 +665,45 @@ static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymen errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509IssuerSerialType->X509IssuerName.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.characters, v2gPaymentDetailsReqType->eMAID.charactersLen); + errn = encodeCharacters(stream, v2gX509IssuerSerialType->X509IssuerName.characters, v2gX509IssuerSerialType->X509IssuerName.charactersLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 171; + grammarID = 20; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 171: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { - int grammarID = 172; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 172: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gDC_EVStatusType->EVReady); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 173; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 173: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 174; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 174: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVStatusType->EVRESSSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { - int grammarID = 43; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 43: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentServiceSelectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { - int grammarID = 175; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 175: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus ); - } - grammarID = 176; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 176: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); - } - grammarID = 177; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); - } - grammarID = 178; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 178: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); - } - grammarID = 179; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 179: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); - } - grammarID = 180; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 180: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); - } - grammarID = 181; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 181: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); - } - grammarID = 182; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 183; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 182: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 183; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 183: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ - if ( v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { - int grammarID = 184; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 184: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gChargingStatusResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 185; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 185: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gChargingStatusResType->EVSEID.characters, v2gChargingStatusResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 186; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 186: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gChargingStatusResType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 187; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 187: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( v2gChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent ); - } - grammarID = 188; - } else if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); - } - grammarID = 189; - } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 190; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 188: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); - } - grammarID = 189; - } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 190; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 189: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 190; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 190: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { - int grammarID = 191; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 191: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gObjectType->Encoding_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Encoding.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->Encoding.characters, v2gObjectType->Encoding.charactersLen); - } - } - grammarID = 192; - } else if ( v2gObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); - } - } - grammarID = 193; - } else if ( v2gObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); - } - } - grammarID = 24; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 192: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); - } - } - grammarID = 193; - } else if ( v2gObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); - } - } - grammarID = 24; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 193: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); - } - } - grammarID = 24; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 25: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ -static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType) { - int grammarID = 194; - int done = 0; - - unsigned int v2gPaymentOptionListType_PaymentOption_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 194: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ - if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 195; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 195: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ - if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { - int grammarID = 196; - int done = 0; - - unsigned int v2gParameterSetType_Parameter_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 196: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ + case 20: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeInteger16(stream, v2gParameterSetType->ParameterSetID); + errn = encodeInteger64(stream, v2gX509IssuerSerialType->X509SerialNumber); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 197; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 197: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ - if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 198; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 198: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ - if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 198; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ -static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { - int grammarID = 199; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 199: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ - if ( v2gAC_EVChargeParameterType->DepartureTime_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gAC_EVChargeParameterType->DepartureTime); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 200; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount ); - } - grammarID = 201; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 200: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount ); - } - grammarID = 201; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 201: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage ); - } - grammarID = 202; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxCurrent ); - } - grammarID = 203; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 203: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMinCurrent ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: + case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType) { - int grammarID = 204; - int done = 0; - - unsigned int v2gManifestType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 204: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if ( v2gManifestType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gManifestType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gManifestType->Id.characters, v2gManifestType->Id.charactersLen); - } - } - grammarID = 205; - } else if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); - } - grammarID = 104; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 205: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); - } - grammarID = 104; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 104: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); - } - grammarID = 104; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { - int grammarID = 206; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 206: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDetailResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 207; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 207: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceDetailResType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 208; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 208: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ - if ( v2gServiceDetailResType->ServiceParameterList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList ); - } grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { - int grammarID = 209; - int done = 0; - - unsigned int v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 209: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */ - if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); - } - grammarID = 210; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 210: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), END_ELEMENT] */ - if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); - } - grammarID = 210; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType) { - int grammarID = 211; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 211: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 212; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 212: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( v2gServiceType->ServiceName_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gServiceType->ServiceName.characters, v2gServiceType->ServiceName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 213; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 214; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 213: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 214; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( v2gServiceType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gServiceType->ServiceScope.characters, v2gServiceType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 215; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 215: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gServiceType->FreeService); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ -static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { - int grammarID = 216; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 216: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->Name.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gParameterType->Name.characters, v2gParameterType->Name.charactersLen); - } - } - grammarID = 217; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 217: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ - if ( v2gParameterType->boolValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gParameterType->boolValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if ( v2gParameterType->byteValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gParameterType->byteValue + 128)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if ( v2gParameterType->shortValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gParameterType->shortValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if ( v2gParameterType->intValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger32(stream, v2gParameterType->intValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if ( v2gParameterType->physicalValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue ); - } - grammarID = 4; - } else if ( v2gParameterType->stringValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 5); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->stringValue.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gParameterType->stringValue.characters, v2gParameterType->stringValue.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { - int grammarID = 218; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 218: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( v2gDSAKeyValueType->P_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->P.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->P.bytes, v2gDSAKeyValueType->P.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 219; - } else if ( v2gDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 220; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 221; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 219: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - if ( v2gDSAKeyValueType->Q_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Q.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Q.bytes, v2gDSAKeyValueType->Q.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 222; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 222: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( v2gDSAKeyValueType->G_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 220; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 221; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 220: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 221; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 221: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( v2gDSAKeyValueType->J_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->J.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->J.bytes, v2gDSAKeyValueType->J.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 223; - } else if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 224; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 223: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ - if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 224; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 224: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - if ( v2gDSAKeyValueType->PgenCounter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->PgenCounter.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytes, v2gDSAKeyValueType->PgenCounter.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDef":Header,"urn:iso:15118:2:2013:MsgDef":Body)', derivedBy='RESTRICTION'. */ -static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { - int grammarID = 225; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 225: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header ); - } - grammarID = 226; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 226: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { - int grammarID = 227; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 227: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ - if ( v2gEVChargeParameterType->DepartureTime_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gEVChargeParameterType->DepartureTime); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType) { - int grammarID = 228; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 228: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gProfileEntryType->ChargingProfileEntryStart); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 229; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower ); - } - grammarID = 230; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 230: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ - if ( v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, (uint32_t)(v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -7676,13 +721,13 @@ static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntr /* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - int grammarID = 231; + int grammarID = 21; int done = 0; while(!done) { switch(grammarID) { - case 231: + case 21: /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ if ( v2gSignaturePropertyType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -7693,7 +738,7 @@ static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat errn = encodeCharacters(stream, v2gSignaturePropertyType->Id.characters, v2gSignaturePropertyType->Id.charactersLen); } } - grammarID = 232; + grammarID = 22; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -7703,12 +748,12 @@ static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); } } - grammarID = 233; + grammarID = 23; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 232: + case 22: /* StartTag[ATTRIBUTE[STRING](Target)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -7719,2591 +764,49 @@ static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); } } - grammarID = 233; + grammarID = 23; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 233: + case 23: /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; + grammarID = 24; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 234; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 25: + case 24: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; + grammarID = 24; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; + grammarID = 24; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 234: + case 25: /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 234; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { - int grammarID = 235; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 235: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - if ( v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval ); - } - grammarID = 236; - } else if ( v2gPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval ); - } - grammarID = 236; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { - int grammarID = 237; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 237: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); - } - grammarID = 238; - } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); - } - grammarID = 238; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 238; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 239; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 238: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 238; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 239: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); - } - grammarID = 238; - } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); - } - grammarID = 238; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 238; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 239; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { - int grammarID = 240; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 240: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( v2gRetrievalMethodType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gRetrievalMethodType->Type.characters, v2gRetrievalMethodType->Type.charactersLen); - } - } - grammarID = 241; - } else if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 242; - } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 241: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 242; - } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 242: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ -static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { - int grammarID = 243; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 243: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, v2gSessionStopReqType->ChargingSession); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { - int grammarID = 244; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 244: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceDetailReqType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType) { - int grammarID = 245; - int done = 0; - - unsigned int v2gKeyInfoType_KeyName_currArrayIndex = 0; - unsigned int v2gKeyInfoType_KeyValue_currArrayIndex = 0; - unsigned int v2gKeyInfoType_RetrievalMethod_currArrayIndex = 0; - unsigned int v2gKeyInfoType_X509Data_currArrayIndex = 0; - unsigned int v2gKeyInfoType_PGPData_currArrayIndex = 0; - unsigned int v2gKeyInfoType_SPKIData_currArrayIndex = 0; - unsigned int v2gKeyInfoType_MgmtData_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 245: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( v2gKeyInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->Id.characters, v2gKeyInfoType->Id.charactersLen); - } - } - grammarID = 246; - } else if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 7); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 247; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 248; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 246: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 247; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 248; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 247: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 247; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 4, 8); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 247; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 248: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); - v2gKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 247; - } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); - v2gKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 247; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 247; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 248; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ -static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { - int grammarID = 249; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 249: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gAC_EVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 250; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 250: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gAC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 251; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 251: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gAC_EVSEStatusType->RCD); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { - int grammarID = 252; - int done = 0; - - unsigned int v2gSelectedServiceListType_SelectedService_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 252: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ - if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 253; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 253: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ - if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 253; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType) { - int grammarID = 254; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 254: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->MeterID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gMeterInfoType->MeterID.characters, v2gMeterInfoType->MeterID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 255; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 255: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->MeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger64(stream, v2gMeterInfoType->MeterReading); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 256; - } else if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 257; - } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 258; - } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 256: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 257; - } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 258; - } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 257: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 258; - } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 258: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { - int grammarID = 259; - int done = 0; - - unsigned int v2gSPKIDataType_SPKISexp_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 259: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - v2gSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 260; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 260: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - v2gSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 260; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 261; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 261: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ - if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - v2gSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 260; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { - int grammarID = 262; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 262: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gChargeParameterDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 263; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 263: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeParameterDiscoveryResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 264; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 264: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ - if ( v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList ); - } - grammarID = 265; - } else if ( v2gChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules ); - } - grammarID = 265; - } else if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); - } - grammarID = 4; - } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); - } - grammarID = 4; - } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 265: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ - if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); - } - grammarID = 4; - } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); - } - grammarID = 4; - } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType) { - int grammarID = 266; - int done = 0; - - unsigned int v2gTransformsType_Transform_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 266: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); - } - grammarID = 267; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 267: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ - if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); - } - grammarID = 267; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ -static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { - int grammarID = 268; - int done = 0; - - unsigned int v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 268: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - if ( v2gSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval ); - } - grammarID = 269; - } else if ( v2gSalesTariffEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval ); - } - grammarID = 269; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 269: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if ( v2gSalesTariffEntryType->EPriceLevel_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffEntryType->EPriceLevel - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 270; - } else if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 271; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 270: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 271; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 271: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 272; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 272: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { - int grammarID = 143; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { - int grammarID = 273; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 273: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionSetupResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 274; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 274: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSessionSetupResType->EVSEID.characters, v2gSessionSetupResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 275; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 275: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ - if ( v2gSessionSetupResType->EVSETimeStamp_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gSessionSetupResType->EVSETimeStamp); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { - int grammarID = 276; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 276: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignatureMethodType->Algorithm.characters, v2gSignatureMethodType->Algorithm.charactersLen); - } - } - grammarID = 277; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 277: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 25; + grammarID = 24; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 278; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 25: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 278: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 25; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 25; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 278; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType) { - int grammarID = 279; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 279: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCurrentDemandResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 280; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 280: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gCurrentDemandResType->DC_EVSEStatus ); - } - grammarID = 281; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 281: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentVoltage ); - } - grammarID = 282; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 282: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentCurrent ); - } - grammarID = 283; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 283: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandResType->EVSECurrentLimitAchieved); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 284; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 284: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandResType->EVSEVoltageLimitAchieved); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 285; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 285: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandResType->EVSEPowerLimitAchieved); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 286; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 286: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumVoltageLimit ); - } - grammarID = 287; - } else if ( v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit ); - } - grammarID = 288; - } else if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); - } - grammarID = 289; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 290; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 287: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit ); - } - grammarID = 288; - } else if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); - } - grammarID = 289; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 290; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 288: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); - } - grammarID = 289; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 290; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 289: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 290; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 290: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gCurrentDemandResType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 291; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 291: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ - if ( v2gCurrentDemandResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo ); - } - grammarID = 292; - } else if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 292: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ - if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { - int grammarID = 293; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 293: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ - if ( v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 294; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 295; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 294: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 295; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 295: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ - if ( v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter ); - } - grammarID = 4; - } else if ( v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter ); - } - grammarID = 4; - } else if ( v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter ); - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { - int grammarID = 296; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 296: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCableCheckResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 297; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 297: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus ); - } - grammarID = 32; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 32: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gCableCheckResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { - int grammarID = 298; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 298: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->start); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 299; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 299: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ - if ( v2gRelativeTimeIntervalType->duration_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->duration); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { - int grammarID = 300; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 300: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSAScheduleTupleType->SAScheduleTupleID - 1)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 301; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 301: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule ); - } - grammarID = 302; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 302: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ - if ( v2gSAScheduleTupleType->SalesTariff_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff ); - } - grammarID = 4; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ -static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { - int grammarID = 303; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 303: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gDC_EVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 304; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 304: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gDC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 305; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 305: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ - if ( v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, v2gDC_EVSEStatusType->EVSEIsolationStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 306; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 306: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 4: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { - int grammarID = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10321,13 +824,13 @@ static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { - int grammarID = 307; + int grammarID = 26; int done = 0; while(!done) { switch(grammarID) { - case 307: + case 26: /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( v2gReferenceType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -10338,7 +841,7 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* errn = encodeCharacters(stream, v2gReferenceType->Id.characters, v2gReferenceType->Id.charactersLen); } } - grammarID = 308; + grammarID = 27; } else if ( v2gReferenceType->Type_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { @@ -10348,7 +851,7 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); } } - grammarID = 309; + grammarID = 28; } else if ( v2gReferenceType->URI_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { @@ -10358,24 +861,24 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); } } - grammarID = 310; + grammarID = 29; } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); } - grammarID = 311; + grammarID = 30; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 3, 4); if(errn == 0) { errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 312; + grammarID = 31; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 308: + case 27: /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( v2gReferenceType->Type_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -10386,7 +889,7 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); } } - grammarID = 309; + grammarID = 28; } else if ( v2gReferenceType->URI_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { @@ -10396,24 +899,24 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); } } - grammarID = 310; + grammarID = 29; } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); } - grammarID = 311; + grammarID = 30; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 312; + grammarID = 31; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 309: + case 28: /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( v2gReferenceType->URI_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -10424,54 +927,54 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); } } - grammarID = 310; + grammarID = 29; } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); } - grammarID = 311; + grammarID = 30; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 312; + grammarID = 31; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 310: + case 29: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( v2gReferenceType->Transforms_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); } - grammarID = 311; + grammarID = 30; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 312; + grammarID = 31; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 311: + case 30: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); } - grammarID = 312; + grammarID = 31; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 312: + case 31: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -10487,19 +990,7528 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 4; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: + case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType) { + int grammarID = 32; + int done = 0; + + unsigned int v2gManifestType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 32: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if ( v2gManifestType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gManifestType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gManifestType->Id.characters, v2gManifestType->Id.charactersLen); + } + } + grammarID = 33; + } else if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); + } + grammarID = 34; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 33: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); + } + grammarID = 34; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 34: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (v2gManifestType_Reference_currArrayIndex < v2gManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gManifestType->Reference.array [v2gManifestType_Reference_currArrayIndex++]); + } + grammarID = 34; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType) { + int grammarID = 35; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 35: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gSelectedServiceType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 36; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 36: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID), END_ELEMENT] */ + if ( v2gSelectedServiceType->ParameterSetID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gSelectedServiceType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType) { + int grammarID = 37; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 37: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ + if ( v2gEVChargeParameterType->DepartureTime_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gEVChargeParameterType->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { + int grammarID = 38; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType) { + int grammarID = 39; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 39: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gChargingStatusResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 40; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 40: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargingStatusResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gChargingStatusResType->EVSEID.characters, v2gChargingStatusResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 41; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 41: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gChargingStatusResType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 42; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 42: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( v2gChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent ); + } + grammarID = 43; + } else if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); + } + grammarID = 44; + } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 45; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 43: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); + } + grammarID = 44; + } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 45; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 44: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 45; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 45: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ +static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType) { + int grammarID = 46; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 46: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gEVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 47; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 47: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gEVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { + int grammarID = 48; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 48: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ + if ( v2gMeteringReceiptReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gMeteringReceiptReqType->Id.characters, v2gMeteringReceiptReqType->Id.charactersLen); + } + } + grammarID = 49; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 50; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 49: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeteringReceiptReqType->SessionID.bytes, v2gMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 50; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 50: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ + if ( v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gMeteringReceiptReqType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 51; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 51: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { + int grammarID = 52; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 52: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus ); + } + grammarID = 53; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); + } + grammarID = 54; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 54: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumPowerLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); + } + grammarID = 55; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 55: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); + } + grammarID = 56; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 56: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); + } + grammarID = 57; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 57: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); + } + grammarID = 58; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); + } + grammarID = 59; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 60; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 59: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 60; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 60: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + if ( v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType) { + int grammarID = 61; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 61: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDetailResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 62; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 62: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gServiceDetailResType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 63; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 63: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ + if ( v2gServiceDetailResType->ServiceParameterList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType) { + int grammarID = 64; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 64: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + if ( v2gCertificateChainType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateChainType->Id.characters, v2gCertificateChainType->Id.charactersLen); + } + } + grammarID = 65; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 66; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 65: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateChainType->Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gCertificateChainType->Certificate.bytes, v2gCertificateChainType->Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 66; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 66: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SubCertificates), END_ELEMENT] */ + if ( v2gCertificateChainType->SubCertificates_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSubCertificatesType(stream, &v2gCertificateChainType->SubCertificates ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { + int grammarID = 67; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 67: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCanonicalizationMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.characters, v2gCanonicalizationMethodType->Algorithm.charactersLen); + } + } + grammarID = 68; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 68: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { + int grammarID = 69; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 69: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gMeteringReceiptResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 70; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + if ( v2gMeteringReceiptResType->AC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gMeteringReceiptResType->AC_EVSEStatus ); + } + grammarID = 3; + } else if ( v2gMeteringReceiptResType->DC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gMeteringReceiptResType->DC_EVSEStatus ); + } + grammarID = 3; + } else if ( v2gMeteringReceiptResType->EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVSEStatusType(stream, &v2gMeteringReceiptResType->EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + int grammarID = 71; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 71: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gPowerDeliveryReqType->ChargeProgress); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 72; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 72: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gPowerDeliveryReqType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 73; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( v2gPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile ); + } + grammarID = 74; + } else if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 74: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType) { + int grammarID = 75; + int done = 0; + + unsigned int v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 75: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ + if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 76; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 76: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + if (v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 76; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ +static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType) { + int grammarID = 77; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 77: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gSessionStopReqType->ChargingSession); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ +static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType) { + int grammarID = 78; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 78: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gChargeServiceType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 79; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 79: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( v2gChargeServiceType->ServiceName_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gChargeServiceType->ServiceName.characters, v2gChargeServiceType->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 80; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 81; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 80: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 81; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 81: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( v2gChargeServiceType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gChargeServiceType->ServiceScope.characters, v2gChargeServiceType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 82; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 83; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 82: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargeServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 83; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType) { + int grammarID = 84; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 84: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Name)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->Name.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gParameterType->Name.characters, v2gParameterType->Name.charactersLen); + } + } + grammarID = 85; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 85: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ + if ( v2gParameterType->boolValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gParameterType->boolValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( v2gParameterType->byteValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gParameterType->byteValue + 128)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( v2gParameterType->shortValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gParameterType->shortValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( v2gParameterType->intValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger32(stream, v2gParameterType->intValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( v2gParameterType->physicalValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue ); + } + grammarID = 3; + } else if ( v2gParameterType->stringValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 5); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gParameterType->stringValue.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gParameterType->stringValue.characters, v2gParameterType->stringValue.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { + int grammarID = 38; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { + int grammarID = 86; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 86: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentServiceSelectionResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType) { + int grammarID = 87; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 87: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); + } + grammarID = 88; + } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); + } + grammarID = 88; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 88; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 89; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 88: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 88; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 89: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( v2gKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); + } + grammarID = 88; + } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); + } + grammarID = 88; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 88; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 89; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType) { + int grammarID = 90; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 90: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionSetupResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 91; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 91: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSessionSetupResType->EVSEID.characters, v2gSessionSetupResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 92; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ + if ( v2gSessionSetupResType->EVSETimeStamp_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gSessionSetupResType->EVSETimeStamp); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType) { + int grammarID = 93; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 93: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gAuthorizationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 94; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gAuthorizationResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType) { + int grammarID = 95; + int done = 0; + + unsigned int v2gX509DataType_X509IssuerSerial_currArrayIndex = 0; + unsigned int v2gX509DataType_X509SKI_currArrayIndex = 0; + unsigned int v2gX509DataType_X509SubjectName_currArrayIndex = 0; + unsigned int v2gX509DataType_X509Certificate_currArrayIndex = 0; + unsigned int v2gX509DataType_X509CRL_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 96; + } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); + v2gX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); + v2gX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); + v2gX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); + v2gX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 96; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 96: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (v2gX509DataType_X509IssuerSerial_currArrayIndex < v2gX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gX509DataType->X509IssuerSerial.array [v2gX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 96; + } else if (v2gX509DataType_X509SKI_currArrayIndex < v2gX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytes, v2gX509DataType->X509SKI.array[v2gX509DataType_X509SKI_currArrayIndex].bytesLen); + v2gX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (v2gX509DataType_X509SubjectName_currArrayIndex < v2gX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].characters, v2gX509DataType->X509SubjectName.array[v2gX509DataType_X509SubjectName_currArrayIndex].charactersLen); + v2gX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (v2gX509DataType_X509Certificate_currArrayIndex < v2gX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytes, v2gX509DataType->X509Certificate.array[v2gX509DataType_X509Certificate_currArrayIndex].bytesLen); + v2gX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (v2gX509DataType_X509CRL_currArrayIndex < v2gX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytes, v2gX509DataType->X509CRL.array[v2gX509DataType_X509CRL_currArrayIndex].bytesLen); + v2gX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 96; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 6); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { + int grammarID = 97; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 97: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateUpdateReqType->Id.characters, v2gCertificateUpdateReqType->Id.charactersLen); + } + } + grammarID = 98; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 98: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain ); + } + grammarID = 99; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 99: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateUpdateReqType->eMAID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateUpdateReqType->eMAID.characters, v2gCertificateUpdateReqType->eMAID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 100; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 100: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ +static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType) { + int grammarID = 101; + int done = 0; + + unsigned int v2gPaymentOptionListType_PaymentOption_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 101: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ + if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 102; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 102: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ + if (v2gPaymentOptionListType_PaymentOption_currArrayIndex < v2gPaymentOptionListType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType) { + int grammarID = 103; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 103: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignatureMethodType->Algorithm.characters, v2gSignatureMethodType->Algorithm.charactersLen); + } + } + grammarID = 104; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 104: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 24; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 105; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 105: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 24; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 105; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType) { + int grammarID = 106; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 106: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MaxEntriesSAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ + if ( v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 107; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 108; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 107: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RequestedEnergyTransferMode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 108; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 108: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVChargeParameter)] */ + if ( v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->AC_EVChargeParameter ); + } + grammarID = 3; + } else if ( v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->DC_EVChargeParameter ); + } + grammarID = 3; + } else if ( v2gChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVChargeParameterType(stream, &v2gChargeParameterDiscoveryReqType->EVChargeParameter ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { + int grammarID = 38; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID)', derivedBy='EXTENSION'. */ +static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { + int grammarID = 109; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 109: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateInstallationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 110; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 110: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain ); + } + grammarID = 111; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 111: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain ); + } + grammarID = 112; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 112: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey ); + } + grammarID = 113; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 113: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateInstallationResType->DHpublickey ); + } + grammarID = 114; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 114: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gEMAIDType(stream, &v2gCertificateInstallationResType->eMAID ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { + int grammarID = 115; + int done = 0; + + unsigned int v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 115: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */ + if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); + } + grammarID = 116; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 116: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), END_ELEMENT] */ + if (v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gX509IssuerSerialType(stream, &v2gListOfRootCertificateIDsType->RootCertificateID.array [v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++]); + } + grammarID = 116; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { + int grammarID = 117; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 117: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVStatusType->EVReady); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 118; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 118: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 119; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVStatusType->EVRESSSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2013:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgBody":ChargingComplete,"urn:iso:15118:2:2013:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2013:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { + int grammarID = 120; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 120: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gCurrentDemandReqType->DC_EVStatus ); + } + grammarID = 121; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 121: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetCurrent ); + } + grammarID = 122; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 122: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumVoltageLimit ); + } + grammarID = 123; + } else if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 124; + } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 125; + } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 126; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 123: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 124; + } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 125; + } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 126; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 124: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 125; + } else if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 126; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 125: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( v2gCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 126; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 126: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingComplete)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 127: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( v2gCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToFullSoC ); + } + grammarID = 128; + } else if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 129; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 128: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 129; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 129: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType) { + int grammarID = 130; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 130: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gServiceType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 131; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 131: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( v2gServiceType->ServiceName_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gServiceType->ServiceName.characters, v2gServiceType->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 132; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 133; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 132: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 133; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 133: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( v2gServiceType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gServiceType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gServiceType->ServiceScope.characters, v2gServiceType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 134; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 134: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType) { + int grammarID = 86; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 86: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gSessionStopResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ +static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType) { + int grammarID = 135; + int done = 0; + + unsigned int v2gConsumptionCostType_Cost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 135: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}startValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gConsumptionCostType->startValue ); + } + grammarID = 136; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 136: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ + if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 137; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 137: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 138; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 138: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ + if (v2gConsumptionCostType_Cost_currArrayIndex < v2gConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gCostType(stream, &v2gConsumptionCostType->Cost.array [v2gConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType) { + int grammarID = 38; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus,"urn:iso:15118:2:2013:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2013:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType) { + int grammarID = 139; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 139: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus ); + } + grammarID = 140; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 140: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage ); + } + grammarID = 141; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 141: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { + int grammarID = 142; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 142: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gWeldingDetectionReqType->DC_EVStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { + int grammarID = 143; + int done = 0; + + unsigned int v2gSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 143: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if ( v2gSignaturePropertiesType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertiesType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertiesType->Id.characters, v2gSignaturePropertiesType->Id.charactersLen); + } + } + grammarID = 144; + } else if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 145; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 144: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 145; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 145: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + if (v2gSignaturePropertiesType_SignatureProperty_currArrayIndex < v2gSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSignaturePropertyType(stream, &v2gSignaturePropertiesType->SignatureProperty.array [v2gSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 145; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType) { + int grammarID = 146; + int done = 0; + + unsigned int v2gSelectedServiceListType_SelectedService_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 146: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ + if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 147; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 147: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ + if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 147; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { + int grammarID = 148; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 148: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gServiceDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 149; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 149: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList ); + } + grammarID = 150; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 150: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gChargeServiceType(stream, &v2gServiceDiscoveryResType->ChargeService ); + } + grammarID = 151; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 151: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceList), END_ELEMENT] */ + if ( v2gServiceDiscoveryResType->ServiceList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceListType(stream, &v2gServiceDiscoveryResType->ServiceList ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { + int grammarID = 152; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 152: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gEMAIDType->Id.characters, v2gEMAIDType->Id.charactersLen); + } + } + grammarID = 153; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 153: + /* StartTag[CHARACTERS[STRING]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gEMAIDType->CONTENT.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gEMAIDType->CONTENT.characters, v2gEMAIDType->CONTENT.charactersLen); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType) { + int grammarID = 38; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType) { + int grammarID = 154; + int done = 0; + + unsigned int v2gSignedInfoType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 154: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( v2gSignedInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignedInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignedInfoType->Id.characters, v2gSignedInfoType->Id.charactersLen); + } + } + grammarID = 155; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); + } + grammarID = 156; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 155: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); + } + grammarID = 156; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 156: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSignatureMethodType(stream, &v2gSignedInfoType->SignatureMethod ); + } + grammarID = 157; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 157: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 34; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 34: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (v2gSignedInfoType_Reference_currArrayIndex < v2gSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gReferenceType(stream, &v2gSignedInfoType->Reference.array [v2gSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 34; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType) { + int grammarID = 142; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 142: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gCableCheckReqType->DC_EVStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ +static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType) { + int grammarID = 158; + int done = 0; + + unsigned int v2gServiceListType_Service_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 158: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service)] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 159; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 159: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 160; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 160: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 161; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 161: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 162; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 162: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 163; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 163: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 164; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 164: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 165; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 165: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Service), END_ELEMENT] */ + if (v2gServiceListType_Service_currArrayIndex < v2gServiceListType->Service.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gServiceType(stream, &v2gServiceListType->Service.array [v2gServiceListType_Service_currArrayIndex++]); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ +static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { + int grammarID = 166; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 166: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gAC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 167; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 167: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gAC_EVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 168; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 168: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RCD)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gAC_EVSEStatusType->RCD); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { + int grammarID = 169; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 169: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gDC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 170; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 170: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gDC_EVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 171; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 171: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + if ( v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gDC_EVSEStatusType->EVSEIsolationStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 172; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 172: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatusCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, v2gDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType) { + int grammarID = 173; + int done = 0; + + unsigned int v2gSPKIDataType_SPKISexp_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 173: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + v2gSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 174; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 174: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + v2gSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 174; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 175; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 175: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + if (v2gSPKIDataType_SPKISexp_currArrayIndex < v2gSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytes, v2gSPKIDataType->SPKISexp.array[v2gSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + v2gSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 174; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType) { + int grammarID = 176; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 176: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gCurrentDemandResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 177; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 177: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gCurrentDemandResType->DC_EVSEStatus ); + } + grammarID = 178; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 178: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentVoltage ); + } + grammarID = 179; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 179: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEPresentCurrent ); + } + grammarID = 180; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 180: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSECurrentLimitAchieved)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandResType->EVSECurrentLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 181; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 181: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEVoltageLimitAchieved)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandResType->EVSEVoltageLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 182; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 182: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPowerLimitAchieved)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandResType->EVSEPowerLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 183; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 183: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( v2gCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumVoltageLimit ); + } + grammarID = 184; + } else if ( v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit ); + } + grammarID = 185; + } else if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); + } + grammarID = 186; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 184: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit ); + } + grammarID = 185; + } else if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); + } + grammarID = 186; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 185: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit ); + } + grammarID = 186; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 186: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCurrentDemandResType->EVSEID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCurrentDemandResType->EVSEID.characters, v2gCurrentDemandResType->EVSEID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 187; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 187: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gCurrentDemandResType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 188; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 188: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + if ( v2gCurrentDemandResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gMeterInfoType(stream, &v2gCurrentDemandResType->MeterInfo ); + } + grammarID = 189; + } else if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 189: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ReceiptRequired), END_ELEMENT] */ + if ( v2gCurrentDemandResType->ReceiptRequired_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gCurrentDemandResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType) { + int grammarID = 190; + int done = 0; + + unsigned int v2gKeyInfoType_KeyName_currArrayIndex = 0; + unsigned int v2gKeyInfoType_KeyValue_currArrayIndex = 0; + unsigned int v2gKeyInfoType_RetrievalMethod_currArrayIndex = 0; + unsigned int v2gKeyInfoType_X509Data_currArrayIndex = 0; + unsigned int v2gKeyInfoType_PGPData_currArrayIndex = 0; + unsigned int v2gKeyInfoType_SPKIData_currArrayIndex = 0; + unsigned int v2gKeyInfoType_MgmtData_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 190: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( v2gKeyInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->Id.characters, v2gKeyInfoType->Id.charactersLen); + } + } + grammarID = 191; + } else if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 7); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 192; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 191: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 192; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 192: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 192; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 4, 8); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 192; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 193: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (v2gKeyInfoType_KeyName_currArrayIndex < v2gKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].characters, v2gKeyInfoType->KeyName.array[v2gKeyInfoType_KeyName_currArrayIndex].charactersLen); + v2gKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (v2gKeyInfoType_KeyValue_currArrayIndex < v2gKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_v2gKeyValueType(stream, &v2gKeyInfoType->KeyValue.array [v2gKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_RetrievalMethod_currArrayIndex < v2gKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_v2gRetrievalMethodType(stream, &v2gKeyInfoType->RetrievalMethod.array [v2gKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_X509Data_currArrayIndex < v2gKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_v2gX509DataType(stream, &v2gKeyInfoType->X509Data.array [v2gKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_PGPData_currArrayIndex < v2gKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_v2gPGPDataType(stream, &v2gKeyInfoType->PGPData.array [v2gKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_SPKIData_currArrayIndex < v2gKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_v2gSPKIDataType(stream, &v2gKeyInfoType->SPKIData.array [v2gKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 192; + } else if (v2gKeyInfoType_MgmtData_currArrayIndex < v2gKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].characters, v2gKeyInfoType->MgmtData.array[v2gKeyInfoType_MgmtData_currArrayIndex].charactersLen); + v2gKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 192; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 193; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { + int grammarID = 194; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 194: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gObjectType->Encoding_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Encoding.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->Encoding.characters, v2gObjectType->Encoding.charactersLen); + } + } + grammarID = 195; + } else if ( v2gObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); + } + } + grammarID = 196; + } else if ( v2gObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); + } + } + grammarID = 68; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 195: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); + } + } + grammarID = 196; + } else if ( v2gObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); + } + } + grammarID = 68; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 196: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( v2gObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); + } + } + grammarID = 68; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 68: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { + int grammarID = 197; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 197: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSAScheduleTupleType->SAScheduleTupleID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 198; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 198: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxSchedule)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPMaxScheduleType(stream, &v2gSAScheduleTupleType->PMaxSchedule ); + } + grammarID = 199; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 199: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ + if ( v2gSAScheduleTupleType->SalesTariff_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType) { + int grammarID = 200; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 200: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + if ( v2gSignatureValueType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignatureValueType->Id.characters, v2gSignatureValueType->Id.charactersLen); + } + } + grammarID = 6; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 6: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSignatureValueType->CONTENT.bytes, v2gSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { + int grammarID = 69; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 69: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPowerDeliveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 70; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEStatus)] */ + if ( v2gPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus ); + } + grammarID = 3; + } else if ( v2gPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus ); + } + grammarID = 3; + } else if ( v2gPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ +static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType) { + int grammarID = 201; + int done = 0; + + unsigned int v2gSubCertificatesType_Certificate_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 201: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 202; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 202: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 203; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 203: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 204; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 204: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ + if (v2gSubCertificatesType_Certificate_currArrayIndex < v2gSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytes, v2gSubCertificatesType->Certificate.array[v2gSubCertificatesType_Certificate_currArrayIndex].bytesLen); + v2gSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType) { + int grammarID = 205; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 205: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ + if ( v2gAuthorizationReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gAuthorizationReqType->Id.characters, v2gAuthorizationReqType->Id.charactersLen); + } + } + grammarID = 206; + } else if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 206: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ + if ( v2gAuthorizationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gAuthorizationReqType->GenChallenge.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gAuthorizationReqType->GenChallenge.bytes, v2gAuthorizationReqType->GenChallenge.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType) { + int grammarID = 207; + int done = 0; + + unsigned int v2gChargingProfileType_ProfileEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 207: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ + if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 208; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 208: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + if (v2gChargingProfileType_ProfileEntry_currArrayIndex < v2gChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gProfileEntryType(stream, &v2gChargingProfileType->ProfileEntry.array [v2gChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 208; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType) { + int grammarID = 209; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 209: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + if ( v2gEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gRelativeTimeIntervalType(stream, &v2gEntryType->RelativeTimeInterval ); + } + grammarID = 3; + } else if ( v2gEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gIntervalType(stream, &v2gEntryType->TimeInterval ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType) { + int grammarID = 210; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 210: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gCableCheckResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 211; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 211: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus ); + } + grammarID = 94; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gCableCheckResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ +static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { + int grammarID = 212; + int done = 0; + + unsigned int v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 212: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 213; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 213: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 214; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 214: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 215; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 215: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 216; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 216: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 217; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ + if (v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex < v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType) { + int grammarID = 218; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 218: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gPhysicalValueType->Multiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 219; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 219: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, v2gPhysicalValueType->Unit); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 220; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 220: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gPhysicalValueType->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing,"urn:iso:15118:2:2013:MsgDataTypes":SASchedules{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType) { + int grammarID = 221; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 221: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gChargeParameterDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 222; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 222: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeParameterDiscoveryResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 223; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SASchedules), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + if ( v2gChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleListType(stream, &v2gChargeParameterDiscoveryResType->SAScheduleList ); + } + grammarID = 224; + } else if ( v2gChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules ); + } + grammarID = 224; + } else if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); + } + grammarID = 3; + } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); + } + grammarID = 3; + } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 224: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEChargeParameter)] */ + if ( v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gAC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); + } + grammarID = 3; + } else if ( v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); + } + grammarID = 3; + } else if ( v2gChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gEVSEChargeParameterType(stream, &v2gChargeParameterDiscoveryResType->EVSEChargeParameter ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType) { + int grammarID = 225; + int done = 0; + + unsigned int v2gParameterSetType_Parameter_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 225: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gParameterSetType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 226; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 226: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter)] */ + if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 227; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 227: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Parameter), END_ELEMENT] */ + if (v2gParameterSetType_Parameter_currArrayIndex < v2gParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gParameterType(stream, &v2gParameterSetType->Parameter.array [v2gParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 227; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { + int grammarID = 228; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 228: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsReqType->eMAID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gPaymentDetailsReqType->eMAID.characters, v2gPaymentDetailsReqType->eMAID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 229; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 229: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType) { + int grammarID = 230; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 230: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->MeterID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gMeterInfoType->MeterID.characters, v2gMeterInfoType->MeterID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 231; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->MeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger64(stream, v2gMeterInfoType->MeterReading); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 232; + } else if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 233; + } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 234; + } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 232: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytes, v2gMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 233; + } else if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 234; + } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 233: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 234; + } else if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 234: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( v2gMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { + int grammarID = 235; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 235: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentServiceSelectionReqType->SelectedPaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 236; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 236: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedServiceList)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType) { + int grammarID = 237; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 237: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( v2gRetrievalMethodType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gRetrievalMethodType->Type.characters, v2gRetrievalMethodType->Type.charactersLen); + } + } + grammarID = 238; + } else if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 239; + } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 238: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gRetrievalMethodType->URI.characters, v2gRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 239; + } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 239: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType) { + int grammarID = 240; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 240: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVCCID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSessionSetupReqType->EVCCID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gSessionSetupReqType->EVCCID.bytes, v2gSessionSetupReqType->EVCCID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { + int grammarID = 241; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 241: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + if ( v2gDC_EVChargeParameterType->DepartureTime_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gDC_EVChargeParameterType->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 242; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); + } + grammarID = 243; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 242: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); + } + grammarID = 243; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 243: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumCurrentLimit ); + } + grammarID = 244; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 244: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + if ( v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumPowerLimit ); + } + grammarID = 245; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); + } + grammarID = 246; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 245: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaximumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); + } + grammarID = 246; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 246: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyCapacity ); + } + grammarID = 247; + } else if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 248; + } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 249; + } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 247: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 248; + } else if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 249; + } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 248: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 249; + } else if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 249: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( v2gDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(v2gDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDef":Header,"urn:iso:15118:2:2013:MsgDef":Body)', derivedBy='RESTRICTION'. */ +static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { + int grammarID = 250; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 250: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Header)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gMessageHeaderType(stream, &v2gAnonType_V2G_Message->Header ); + } + grammarID = 251; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 251: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDef}Body)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gBodyType(stream, &v2gAnonType_V2G_Message->Body ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +static int encode_v2gDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { + int grammarID = 252; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 252: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVPowerDeliveryParameterType->DC_EVStatus ); + } + grammarID = 253; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 253: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + if ( v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 254; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 254: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingComplete)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gDC_EVPowerDeliveryParameterType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int encode_v2gRelativeTimeIntervalType(bitstream_t* stream, struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType) { + int grammarID = 255; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 255: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}start)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->start); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 256; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 256: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}duration), END_ELEMENT] */ + if ( v2gRelativeTimeIntervalType->duration_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gRelativeTimeIntervalType->duration); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType) { + int grammarID = 257; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 257: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRSAKeyValueType->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gRSAKeyValueType->Modulus.bytes, v2gRSAKeyValueType->Modulus.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 258; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 258: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gRSAKeyValueType->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gRSAKeyValueType->Exponent.bytes, v2gRSAKeyValueType->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType) { + int grammarID = 259; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 259: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + if ( v2gPGPDataType->PGPKeyID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPGPDataType->PGPKeyID.bytes, v2gPGPDataType->PGPKeyID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 260; + } else if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 261; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 260: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + if ( v2gPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPGPDataType->PGPKeyPacket.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytes, v2gPGPDataType->PGPKeyPacket.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 261; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 261; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 261: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 261; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10517,13 +8529,13 @@ static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* /* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - int grammarID = 313; + int grammarID = 262; int done = 0; while(!done) { switch(grammarID) { - case 313: + case 262: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -10536,72 +8548,72 @@ static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 314; + grammarID = 263; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 314: + case 263: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain ); } - grammarID = 315; + grammarID = 264; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 315: + case 264: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain ); } - grammarID = 316; + grammarID = 265; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 316: + case 265: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey ); } - grammarID = 317; + grammarID = 266; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 317: + case 266: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey ); } - grammarID = 318; + grammarID = 267; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 318: + case 267: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID ); } - grammarID = 319; + grammarID = 268; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 319: + case 268: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ if ( v2gCertificateUpdateResType->RetryCounter_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -10614,25 +8626,2015 @@ static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 4; + grammarID = 3; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: + case 3: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 5; + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ +static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { + int grammarID = 269; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 269: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPaymentDetailsResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 270; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 270: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gPaymentDetailsResType->GenChallenge.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gPaymentDetailsResType->GenChallenge.bytes, v2gPaymentDetailsResType->GenChallenge.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 271; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 271: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, v2gPaymentDetailsResType->EVSETimeStamp); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType) { + int grammarID = 272; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 272: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( v2gDSAKeyValueType->P_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->P.bytes, v2gDSAKeyValueType->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 273; + } else if ( v2gDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 274; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 275; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 273: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + if ( v2gDSAKeyValueType->Q_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Q.bytes, v2gDSAKeyValueType->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 276; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 276: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( v2gDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->G.bytes, v2gDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 274; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 275; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 274: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Y.bytes, v2gDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 275; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 275: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( v2gDSAKeyValueType->J_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->J.bytes, v2gDSAKeyValueType->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 277; + } else if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 278; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 277: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( v2gDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->Seed.bytes, v2gDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 278; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 278: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + if ( v2gDSAKeyValueType->PgenCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDSAKeyValueType->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDSAKeyValueType->PgenCounter.bytes, v2gDSAKeyValueType->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":BodyElement{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType) { + int grammarID = 279; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 279: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AuthorizationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}BodyElement), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentServiceSelectionRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2013:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + if ( v2gBodyType->AuthorizationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 0); + if(errn == 0) { + errn = encode_v2gAuthorizationReqType(stream, &v2gBodyType->AuthorizationReq ); + } + grammarID = 3; + } else if ( v2gBodyType->AuthorizationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 1); + if(errn == 0) { + errn = encode_v2gAuthorizationResType(stream, &v2gBodyType->AuthorizationRes ); + } + grammarID = 3; + } else if ( v2gBodyType->BodyElement_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 2); + if(errn == 0) { + errn = encode_v2gBodyBaseType(stream, &v2gBodyType->BodyElement ); + } + grammarID = 3; + } else if ( v2gBodyType->CableCheckReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 3); + if(errn == 0) { + errn = encode_v2gCableCheckReqType(stream, &v2gBodyType->CableCheckReq ); + } + grammarID = 3; + } else if ( v2gBodyType->CableCheckRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 4); + if(errn == 0) { + errn = encode_v2gCableCheckResType(stream, &v2gBodyType->CableCheckRes ); + } + grammarID = 3; + } else if ( v2gBodyType->CertificateInstallationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 5); + if(errn == 0) { + errn = encode_v2gCertificateInstallationReqType(stream, &v2gBodyType->CertificateInstallationReq ); + } + grammarID = 3; + } else if ( v2gBodyType->CertificateInstallationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 6); + if(errn == 0) { + errn = encode_v2gCertificateInstallationResType(stream, &v2gBodyType->CertificateInstallationRes ); + } + grammarID = 3; + } else if ( v2gBodyType->CertificateUpdateReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 7); + if(errn == 0) { + errn = encode_v2gCertificateUpdateReqType(stream, &v2gBodyType->CertificateUpdateReq ); + } + grammarID = 3; + } else if ( v2gBodyType->CertificateUpdateRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 8); + if(errn == 0) { + errn = encode_v2gCertificateUpdateResType(stream, &v2gBodyType->CertificateUpdateRes ); + } + grammarID = 3; + } else if ( v2gBodyType->ChargeParameterDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 9); + if(errn == 0) { + errn = encode_v2gChargeParameterDiscoveryReqType(stream, &v2gBodyType->ChargeParameterDiscoveryReq ); + } + grammarID = 3; + } else if ( v2gBodyType->ChargeParameterDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 10); + if(errn == 0) { + errn = encode_v2gChargeParameterDiscoveryResType(stream, &v2gBodyType->ChargeParameterDiscoveryRes ); + } + grammarID = 3; + } else if ( v2gBodyType->ChargingStatusReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 11); + if(errn == 0) { + errn = encode_v2gChargingStatusReqType(stream, &v2gBodyType->ChargingStatusReq ); + } + grammarID = 3; + } else if ( v2gBodyType->ChargingStatusRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 12); + if(errn == 0) { + errn = encode_v2gChargingStatusResType(stream, &v2gBodyType->ChargingStatusRes ); + } + grammarID = 3; + } else if ( v2gBodyType->CurrentDemandReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 13); + if(errn == 0) { + errn = encode_v2gCurrentDemandReqType(stream, &v2gBodyType->CurrentDemandReq ); + } + grammarID = 3; + } else if ( v2gBodyType->CurrentDemandRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 14); + if(errn == 0) { + errn = encode_v2gCurrentDemandResType(stream, &v2gBodyType->CurrentDemandRes ); + } + grammarID = 3; + } else if ( v2gBodyType->MeteringReceiptReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 15); + if(errn == 0) { + errn = encode_v2gMeteringReceiptReqType(stream, &v2gBodyType->MeteringReceiptReq ); + } + grammarID = 3; + } else if ( v2gBodyType->MeteringReceiptRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 16); + if(errn == 0) { + errn = encode_v2gMeteringReceiptResType(stream, &v2gBodyType->MeteringReceiptRes ); + } + grammarID = 3; + } else if ( v2gBodyType->PaymentDetailsReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 17); + if(errn == 0) { + errn = encode_v2gPaymentDetailsReqType(stream, &v2gBodyType->PaymentDetailsReq ); + } + grammarID = 3; + } else if ( v2gBodyType->PaymentDetailsRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 18); + if(errn == 0) { + errn = encode_v2gPaymentDetailsResType(stream, &v2gBodyType->PaymentDetailsRes ); + } + grammarID = 3; + } else if ( v2gBodyType->PaymentServiceSelectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 19); + if(errn == 0) { + errn = encode_v2gPaymentServiceSelectionReqType(stream, &v2gBodyType->PaymentServiceSelectionReq ); + } + grammarID = 3; + } else if ( v2gBodyType->PaymentServiceSelectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 20); + if(errn == 0) { + errn = encode_v2gPaymentServiceSelectionResType(stream, &v2gBodyType->PaymentServiceSelectionRes ); + } + grammarID = 3; + } else if ( v2gBodyType->PowerDeliveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 21); + if(errn == 0) { + errn = encode_v2gPowerDeliveryReqType(stream, &v2gBodyType->PowerDeliveryReq ); + } + grammarID = 3; + } else if ( v2gBodyType->PowerDeliveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 22); + if(errn == 0) { + errn = encode_v2gPowerDeliveryResType(stream, &v2gBodyType->PowerDeliveryRes ); + } + grammarID = 3; + } else if ( v2gBodyType->PreChargeReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 23); + if(errn == 0) { + errn = encode_v2gPreChargeReqType(stream, &v2gBodyType->PreChargeReq ); + } + grammarID = 3; + } else if ( v2gBodyType->PreChargeRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 24); + if(errn == 0) { + errn = encode_v2gPreChargeResType(stream, &v2gBodyType->PreChargeRes ); + } + grammarID = 3; + } else if ( v2gBodyType->ServiceDetailReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 25); + if(errn == 0) { + errn = encode_v2gServiceDetailReqType(stream, &v2gBodyType->ServiceDetailReq ); + } + grammarID = 3; + } else if ( v2gBodyType->ServiceDetailRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 26); + if(errn == 0) { + errn = encode_v2gServiceDetailResType(stream, &v2gBodyType->ServiceDetailRes ); + } + grammarID = 3; + } else if ( v2gBodyType->ServiceDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 27); + if(errn == 0) { + errn = encode_v2gServiceDiscoveryReqType(stream, &v2gBodyType->ServiceDiscoveryReq ); + } + grammarID = 3; + } else if ( v2gBodyType->ServiceDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 28); + if(errn == 0) { + errn = encode_v2gServiceDiscoveryResType(stream, &v2gBodyType->ServiceDiscoveryRes ); + } + grammarID = 3; + } else if ( v2gBodyType->SessionSetupReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 29); + if(errn == 0) { + errn = encode_v2gSessionSetupReqType(stream, &v2gBodyType->SessionSetupReq ); + } + grammarID = 3; + } else if ( v2gBodyType->SessionSetupRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 30); + if(errn == 0) { + errn = encode_v2gSessionSetupResType(stream, &v2gBodyType->SessionSetupRes ); + } + grammarID = 3; + } else if ( v2gBodyType->SessionStopReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 31); + if(errn == 0) { + errn = encode_v2gSessionStopReqType(stream, &v2gBodyType->SessionStopReq ); + } + grammarID = 3; + } else if ( v2gBodyType->SessionStopRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 32); + if(errn == 0) { + errn = encode_v2gSessionStopResType(stream, &v2gBodyType->SessionStopRes ); + } + grammarID = 3; + } else if ( v2gBodyType->WeldingDetectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 33); + if(errn == 0) { + errn = encode_v2gWeldingDetectionReqType(stream, &v2gBodyType->WeldingDetectionReq ); + } + grammarID = 3; + } else if ( v2gBodyType->WeldingDetectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 34); + if(errn == 0) { + errn = encode_v2gWeldingDetectionResType(stream, &v2gBodyType->WeldingDetectionRes ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 6, 35); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { + int grammarID = 280; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 280: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gCertificateInstallationReqType->Id.characters, v2gCertificateInstallationReqType->Id.charactersLen); + } + } + grammarID = 281; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 281: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gCertificateInstallationReqType->OEMProvisioningCert.bytes, v2gCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 100; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 100: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateInstallationReqType->ListOfRootCertificateIDs ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType) { + int grammarID = 282; + int done = 0; + + unsigned int v2gServiceParameterListType_ParameterSet_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 282: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet)] */ + if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 283; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 283: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSet), END_ELEMENT] */ + if (v2gServiceParameterListType_ParameterSet_currArrayIndex < v2gServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gParameterSetType(stream, &v2gServiceParameterListType->ParameterSet.array [v2gServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 283; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType) { + int grammarID = 38; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTuple{1-3})', derivedBy='EXTENSION'. */ +static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType) { + int grammarID = 284; + int done = 0; + + unsigned int v2gSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 284: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple)] */ + if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 285; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 285: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ + if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 286; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 286: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ + if (v2gSAScheduleListType_SAScheduleTuple_currArrayIndex < v2gSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSAScheduleTupleType(stream, &v2gSAScheduleListType->SAScheduleTuple.array [v2gSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType) { + int grammarID = 67; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 67: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDigestMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gDigestMethodType->Algorithm.characters, v2gDigestMethodType->Algorithm.charactersLen); + } + } + grammarID = 68; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 68: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 24: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 24; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType) { + int grammarID = 287; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 287: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}costKind)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, v2gCostType->costKind); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 288; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 288: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gCostType->amount); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 289; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 289: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + if ( v2gCostType->amountMultiplier_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(v2gCostType->amountMultiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType) { + int grammarID = 290; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 290: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gMessageHeaderType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gMessageHeaderType->SessionID.bytes, v2gMessageHeaderType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 291; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 291: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( v2gMessageHeaderType->Notification_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification ); + } + grammarID = 292; + } else if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 292: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( v2gMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType) { + int grammarID = 293; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 293: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, v2gServiceDetailReqType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType) { + int grammarID = 294; + int done = 0; + + unsigned int v2gTransformsType_Transform_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 294: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); + } + grammarID = 295; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 295: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + if (v2gTransformsType_Transform_currArrayIndex < v2gTransformsType->Transform.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gTransformType(stream, &v2gTransformsType->Transform.array [v2gTransformsType_Transform_currArrayIndex++]); + } + grammarID = 295; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { + int grammarID = 296; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 296: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gWeldingDetectionResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 297; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 297: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus ); + } + grammarID = 298; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 298: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType) { + int grammarID = 296; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 296: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gPreChargeResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 297; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 297: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gDC_EVSEStatusType(stream, &v2gPreChargeResType->DC_EVSEStatus ); + } + grammarID = 298; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 298: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPreChargeResType->EVSEPresentVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ +static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { + int grammarID = 299; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 299: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ + if ( v2gAC_EVChargeParameterType->DepartureTime_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, v2gAC_EVChargeParameterType->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 300; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount ); + } + grammarID = 301; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 300: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount ); + } + grammarID = 301; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 301: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage ); + } + grammarID = 302; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 302: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxCurrent ); + } + grammarID = 303; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 303: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMinCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMinCurrent ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ +static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { + int grammarID = 304; + int done = 0; + + unsigned int v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 304: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + if ( v2gSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval ); + } + grammarID = 305; + } else if ( v2gSalesTariffEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval ); + } + grammarID = 305; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 305: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if ( v2gSalesTariffEntryType->EPriceLevel_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffEntryType->EPriceLevel - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 306; + } else if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 307; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 306: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 307; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 307: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 308; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 308: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex < v2gSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gConsumptionCostType(stream, &v2gSalesTariffEntryType->ConsumptionCost.array [v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { + int grammarID = 309; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 309: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ + if ( v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gRelativeTimeIntervalType(stream, &v2gPMaxScheduleEntryType->RelativeTimeInterval ); + } + grammarID = 310; + } else if ( v2gPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval ); + } + grammarID = 310; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 310: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMax)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gPhysicalValueType(stream, &v2gPMaxScheduleEntryType->PMax ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType) { + int grammarID = 38; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 38: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2013:MsgDataTypes":NumEPriceLevels{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType) { + int grammarID = 311; + int done = 0; + + unsigned int v2gSalesTariffType_SalesTariffEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 311: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ + if ( v2gSalesTariffType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSalesTariffType->Id.characters, v2gSalesTariffType->Id.charactersLen); + } + } + grammarID = 312; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 313; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 312: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->SalesTariffID - 1)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 313; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 313: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + if ( v2gSalesTariffType->SalesTariffDescription_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSalesTariffType->SalesTariffDescription.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSalesTariffType->SalesTariffDescription.characters, v2gSalesTariffType->SalesTariffDescription.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 314; + } else if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 315; + } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 316; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 314: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + if ( v2gSalesTariffType->NumEPriceLevels_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gSalesTariffType->NumEPriceLevels - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 315; + } else if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 316; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 315: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry)] */ + if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 316; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 316: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + if (v2gSalesTariffType_SalesTariffEntry_currArrayIndex < v2gSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gSalesTariffEntryType(stream, &v2gSalesTariffType->SalesTariffEntry.array [v2gSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 316; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType) { + int grammarID = 317; + int done = 0; + + unsigned int v2gTransformType_XPath_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 317: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gTransformType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gTransformType->Algorithm.characters, v2gTransformType->Algorithm.charactersLen); + } + } + grammarID = 318; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 318: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (v2gTransformType_XPath_currArrayIndex < v2gTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].characters, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen); + v2gTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 319; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 319; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 319; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 319: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (v2gTransformType_XPath_currArrayIndex < v2gTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].characters, v2gTransformType->XPath.array[v2gTransformType_XPath_currArrayIndex].charactersLen); + v2gTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 319; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 319; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 319; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { + int grammarID = 5; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 5: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gDiffieHellmanPublickeyType->Id.characters, v2gDiffieHellmanPublickeyType->Id.charactersLen); + } + } + grammarID = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 6: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytes, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -11178,6 +11180,7 @@ int encode_v2gExiDocument(bitstream_t* stream, struct v2gEXIDocument* exiDoc) { return errn; } +#endif /* DEPLOY_ISO_CODEC */ #endif diff --git a/src/codec/v2gEXIDatatypesEncoder.h b/src/codec/v2gEXIDatatypesEncoder.h index 4209ba6..3012407 100644 --- a/src/codec/v2gEXIDatatypesEncoder.h +++ b/src/codec/v2gEXIDatatypesEncoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -42,6 +42,8 @@ extern "C" { #endif +#if DEPLOY_ISO_CODEC == SUPPORT_YES + #includeCode generated by EXIdizer
@@ -27,18 +27,19 @@ * ********************************************************************/ - - -#includeCode generated by EXIdizer
@@ -27,155 +27,97 @@ * ********************************************************************/ - - -/** - * \file EXIDatatypes.h - * \brief Datatype definitions and structs for given XML Schema definitions and initialization methods - * - */ - -#ifndef EXI_din_DATATYPES_H -#define EXI_din_DATATYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - + + +/** + * \file EXIDatatypes.h + * \brief Datatype definitions and structs for given XML Schema definitions and initialization methods + * + */ + +#ifndef EXI_din_DATATYPES_H +#define EXI_din_DATATYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + #define SUPPORT_YES 1 #define SUPPORT_NO 2 #define DEPLOY_DIN_CODEC SUPPORT_NO - -#if DEPLOY_DIN_CODEC == SUPPORT_YES - - -#includeCode generated by EXIdizer
@@ -27,132 +27,132 @@ * ********************************************************************/ - - - -#include "dinEXIDatatypesDecoder.h" - -#include "DecoderChannel.h" -#include "EXIHeaderDecoder.h" - -#include "dinEXIDatatypes.h" -#include "ErrorCodes.h" - -#ifndef EXI_din_DATATYPES_DECODER_C -#define EXI_din_DATATYPES_DECODER_C - -#if DEPLOY_DIN_CODEC == SUPPORT_YES - -/** event-code */ -static uint32_t eventCode; -static int errn; -static uint32_t uint32; - - + + + +#include "dinEXIDatatypesDecoder.h" + +#include "DecoderChannel.h" +#include "EXIHeaderDecoder.h" + +#include "dinEXIDatatypes.h" +#include "ErrorCodes.h" + +#ifndef EXI_din_DATATYPES_DECODER_C +#define EXI_din_DATATYPES_DECODER_C + +#if DEPLOY_DIN_CODEC == SUPPORT_YES + +/** event-code */ +static uint32_t eventCode; +static int errn; +static uint32_t uint32; + + /* Forward Declarations */ -static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); -static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); -static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); -static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); -static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); -static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType); -static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); -static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); -static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); -static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); -static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); -static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); -static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); -static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); -static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); -static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); -static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); -static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType); -static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType); -static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType); -static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType); -static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); -static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); -static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); -static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); -static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); -static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); -static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); -static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); -static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); -static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); -static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); -static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); -static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); -static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); -static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); -static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType); -static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); -static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); -static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); -static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); -static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); -static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); -static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); -static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); -static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); -static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); -static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType); -static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); -static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType); -static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); -static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); -static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); -static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); -static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); +static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); +static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); +static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); +static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); +static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); +static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); +static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); +static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); +static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); +static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); +static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); +static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType); -static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); -static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); -static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); -static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); -static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); +static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); +static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); +static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); -static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); -static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); -static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); +static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); +static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType); static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType); static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType); -static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); -static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); -static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); -static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); -static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); -static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); -static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType); -static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); -static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); -static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); -static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); -static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); -static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); -static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); -static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); -static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); -static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType); -static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); +static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); +static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); +static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); +static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); +static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); +static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); +static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); +static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType); +static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); +static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); +static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); +static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType); +static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType); +static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); +static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); +static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); +static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); +static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); -static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); -static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); -static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); -static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); -static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); -static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); -static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); -static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType); -static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); -static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); -static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); -static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); +static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); +static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); +static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); +static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); +static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); +static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); +static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); +static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); +static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); +static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); +static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); +static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); +static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); +static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); +static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); +static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); +static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); +static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); +static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); +static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); +static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); +static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); +static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); +static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); +static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); +static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType); +static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType); +static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); +static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); +static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); +static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); +static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); +static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); +static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); +static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); +static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); +static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); +static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); +static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); +static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); +static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); +static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); +static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); +static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); +static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); +static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType); +static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); +static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); +static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); +static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); +static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); +static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType); +static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); +static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); /* Deviant data decoding (skip functions) */ static int decodeDeviationsCH(bitstream_t* stream) { @@ -169,25 +169,42 @@ static int decodeDeviationsCH(bitstream_t* stream) { return errn; } - - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { + + /* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { int grammarID = 0; int done = 0; - init_dinPreChargeReqType(dinPreChargeReqType); + init_dinPreChargeResType(dinPreChargeResType); while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus); - grammarID = 1; + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinPreChargeResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 1; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -196,12 +213,12 @@ static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeRe } break; case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage); + errn = decode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus); grammarID = 2; break; default: @@ -211,12 +228,12 @@ static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeRe } break; case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent); + errn = decode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage); grammarID = 3; break; default: @@ -251,34 +268,39 @@ static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeRe return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) { +/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { int grammarID = 5; int done = 0; - init_dinNotificationType(dinNotificationType); + init_dinMessageHeaderType(dinMessageHeaderType); while(!done) { switch(grammarID) { case 5: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinNotificationType->FaultCode = (dinfaultCodeType) uint32; + errn = decodeUnsignedInteger16(stream, &dinMessageHeaderType->SessionID.bytesLen); + if (errn == 0) { + errn = (dinMessageHeaderType->SessionID.bytesLen) <= dinMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMessageHeaderType->SessionID.bytesLen, dinMessageHeaderType->SessionID.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 6; @@ -294,36 +316,423 @@ static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificatio } break; case 6: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decode_dinNotificationType(stream, &dinMessageHeaderType->Notification); + dinMessageHeaderType->Notification_isUsed = 1u; + grammarID = 7; + break; + case 1: + errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); + dinMessageHeaderType->Signature_isUsed = 1u; + grammarID = 3; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 7: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); + dinMessageHeaderType->Signature_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) { + int grammarID = 8; + int done = 0; + + init_dinServiceDetailReqType(dinServiceDetailReqType); + + while(!done) { + switch(grammarID) { + case 8: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinNotificationType->FaultMsg.charactersLen); - if (errn == 0) { - errn = (dinNotificationType->FaultMsg.charactersLen - 2) <= dinNotificationType_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinNotificationType->FaultMsg.charactersLen >= 2) { - dinNotificationType->FaultMsg.charactersLen = (uint16_t)(dinNotificationType->FaultMsg.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinNotificationType->FaultMsg.charactersLen, dinNotificationType->FaultMsg.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinNotificationType->FaultMsg_isUsed = 1u; + errn = decodeUnsignedInteger16(stream, &dinServiceDetailReqType->ServiceID); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010: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:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { + int grammarID = 9; + int done = 0; + + init_dinEVSEChargeParameterType(dinEVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { + int grammarID = 10; + int done = 0; + + init_dinRetrievalMethodType(dinRetrievalMethodType); + + while(!done) { + switch(grammarID) { + case 10: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->Type.charactersLen); + if (errn == 0) { + errn = (dinRetrievalMethodType->Type.charactersLen - 2) <= dinRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinRetrievalMethodType->Type.charactersLen >= 2) { + dinRetrievalMethodType->Type.charactersLen = (uint16_t)(dinRetrievalMethodType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinRetrievalMethodType->Type.charactersLen, dinRetrievalMethodType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinRetrievalMethodType->Type_isUsed = 1u; + grammarID = 11; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (dinRetrievalMethodType->URI.charactersLen - 2) <= dinRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinRetrievalMethodType->URI.charactersLen >= 2) { + dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinRetrievalMethodType->URI_isUsed = 1u; + grammarID = 12; + break; + case 2: + errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); + dinRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 3; + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 11: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen); + if (errn == 0) { + errn = (dinRetrievalMethodType->URI.charactersLen - 2) <= dinRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinRetrievalMethodType->URI.charactersLen >= 2) { + dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinRetrievalMethodType->URI_isUsed = 1u; + grammarID = 12; + break; + case 1: + errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); + dinRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 3; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 12: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); + dinRetrievalMethodType->Transforms_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { + int grammarID = 13; + int done = 0; + + init_dinSessionSetupResType(dinSessionSetupResType); + + while(!done) { + switch(grammarID) { + case 13: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinSessionSetupResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 14; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 14: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSessionSetupResType->EVSEID.bytesLen); + if (errn == 0) { + errn = (dinSessionSetupResType->EVSEID.bytesLen) <= dinSessionSetupResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSessionSetupResType->EVSEID.bytesLen, dinSessionSetupResType->EVSEID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 15; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 15: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinSessionSetupResType->DateTimeNow); + dinSessionSetupResType->DateTimeNow_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -368,36 +777,42 @@ static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificatio return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) { - int grammarID = 7; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { + int grammarID = 16; int done = 0; - init_dinServiceTagType(dinServiceTagType); + init_dinRSAKeyValueType(dinRSAKeyValueType); while(!done) { switch(grammarID) { - case 7: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ + case 16: + /* 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[UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceID); + errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Modulus.bytesLen); + if (errn == 0) { + errn = (dinRSAKeyValueType->Modulus.bytesLen) <= dinRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinRSAKeyValueType->Modulus.bytesLen, dinRSAKeyValueType->Modulus.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */ + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 8; + grammarID = 17; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -409,9 +824,233 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp } } break; - case 8: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 17: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Exponent.bytesLen); + if (errn == 0) { + errn = (dinRSAKeyValueType->Exponent.bytesLen) <= dinRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinRSAKeyValueType->Exponent.bytesLen, dinRSAKeyValueType->Exponent.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ +static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { + int grammarID = 18; + int done = 0; + + init_dinCertificateInstallationResType(dinCertificateInstallationResType); + + while(!done) { + switch(grammarID) { + case 18: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->Id.charactersLen); + if (errn == 0) { + errn = (dinCertificateInstallationResType->Id.charactersLen - 2) <= dinCertificateInstallationResType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinCertificateInstallationResType->Id.charactersLen >= 2) { + dinCertificateInstallationResType->Id.charactersLen = (uint16_t)(dinCertificateInstallationResType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCertificateInstallationResType->Id.charactersLen, dinCertificateInstallationResType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 19; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 19: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinCertificateInstallationResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain); + grammarID = 21; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 21: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 22; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 22: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->DHParams.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationResType->DHParams.bytesLen) <= dinCertificateInstallationResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationResType->DHParams.bytesLen, dinCertificateInstallationResType->DHParams.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 23; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 23: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: @@ -419,127 +1058,358 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceName.charactersLen); + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractID.charactersLen); if (errn == 0) { - errn = (dinServiceTagType->ServiceName.charactersLen - 2) <= dinServiceTagType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinCertificateInstallationResType->ContractID.charactersLen - 2) <= dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (dinServiceTagType->ServiceName.charactersLen >= 2) { - dinServiceTagType->ServiceName.charactersLen = (uint16_t)(dinServiceTagType->ServiceName.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinServiceTagType->ServiceName.charactersLen, dinServiceTagType->ServiceName.characters); + if (dinCertificateInstallationResType->ContractID.charactersLen >= 2) { + dinCertificateInstallationResType->ContractID.charactersLen = (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCertificateInstallationResType->ContractID.charactersLen, dinCertificateInstallationResType->ContractID.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - dinServiceTagType->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:2010:MsgDataTypes}ServiceName) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 9; + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { + int grammarID = 24; + int done = 0; + + init_dinDC_EVChargeParameterType(dinDC_EVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 24: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus); + grammarID = 25; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit); + grammarID = 26; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 26: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit); + dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 27; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 28; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 27: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); + grammarID = 28; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 28: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity); + dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; + grammarID = 29; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); + dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 30; + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 31; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 29: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); + dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; + grammarID = 30; + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 31; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 30: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 31; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinServiceTagType->ServiceCategory = (dinserviceCategoryType) uint32; + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 10; + 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 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2010: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); - dinServiceTagType->ServiceCategory = (dinserviceCategoryType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 10; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 10: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */ + case 31: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceScope.charactersLen); - if (errn == 0) { - errn = (dinServiceTagType->ServiceScope.charactersLen - 2) <= dinServiceTagType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinServiceTagType->ServiceScope.charactersLen >= 2) { - dinServiceTagType->ServiceScope.charactersLen = (uint16_t)(dinServiceTagType->ServiceScope.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinServiceTagType->ServiceScope.charactersLen, dinServiceTagType->ServiceScope.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinServiceTagType->ServiceScope_isUsed = 1u; + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); + dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -584,16 +1454,2557 @@ static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp 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_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) { + int grammarID = 32; + int done = 0; + + init_dinSPKIDataType(dinSPKIDataType); + + while(!done) { + switch(grammarID) { + case 32: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes); + } + dinSPKIDataType->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 = 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({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 (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes); + } + dinSPKIDataType->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 = 33; + } 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 = 34; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 34: + /* 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 (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes); + } + dinSPKIDataType->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 = 33; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { + int grammarID = 35; + int done = 0; + + init_dinChargeParameterDiscoveryReqType(dinChargeParameterDiscoveryReqType); + + while(!done) { + switch(grammarID) { + case 35: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType = (dinEVRequestedEnergyTransferType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 36; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 36: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter); + dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter); + dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter); + dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { + int grammarID = 9; + int done = 0; + + init_dinBodyBaseType(dinBodyBaseType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ +static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { + int grammarID = 37; + int done = 0; + + init_dinProfileEntryType(dinProfileEntryType); + + while(!done) { + switch(grammarID) { + case 37: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinProfileEntryType->ChargingProfileEntryStart); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 38; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 38: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinProfileEntryType->ChargingProfileEntryMaxPower); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { + int grammarID = 39; + int done = 0; + + init_dinCertificateInstallationReqType(dinCertificateInstallationReqType); + + while(!done) { + switch(grammarID) { + case 39: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->Id.charactersLen); + if (errn == 0) { + errn = (dinCertificateInstallationReqType->Id.charactersLen - 2) <= dinCertificateInstallationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinCertificateInstallationReqType->Id.charactersLen >= 2) { + dinCertificateInstallationReqType->Id.charactersLen = (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCertificateInstallationReqType->Id.charactersLen, dinCertificateInstallationReqType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinCertificateInstallationReqType->Id_isUsed = 1u; + grammarID = 40; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 41; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 40: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 41; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 41: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs); + grammarID = 42; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 42: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->DHParams.bytesLen); + if (errn == 0) { + errn = (dinCertificateInstallationReqType->DHParams.bytesLen) <= dinCertificateInstallationReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytesLen, dinCertificateInstallationReqType->DHParams.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { + int grammarID = 43; + int done = 0; + + init_dinSignatureMethodType(dinSignatureMethodType); + + while(!done) { + switch(grammarID) { + case 43: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignatureMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (dinSignatureMethodType->Algorithm.charactersLen - 2) <= dinSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinSignatureMethodType->Algorithm.charactersLen >= 2) { + dinSignatureMethodType->Algorithm.charactersLen = (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignatureMethodType->Algorithm.charactersLen, dinSignatureMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 44; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 44: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); + dinSignatureMethodType->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 45; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + errn = decodeDeviationsCH(stream); + grammarID = 46; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 46: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); + dinSignatureMethodType->HMACOutputLength_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 45; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + grammarID = 46; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { + int grammarID = 9; + int done = 0; + + init_dinIntervalType(dinIntervalType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { + int grammarID = 47; + int done = 0; + + init_dinSelectedServiceListType(dinSelectedServiceListType); + + while(!done) { + switch(grammarID) { + case 47: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 48; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 48: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { + errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 48; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { + int grammarID = 49; + int done = 0; + + init_dinCableCheckReqType(dinCableCheckReqType); + + while(!done) { + switch(grammarID) { + case 49: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { + int grammarID = 50; + int done = 0; + + init_dinServicePaymentSelectionResType(dinServicePaymentSelectionResType); + + while(!done) { + switch(grammarID) { + case 50: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinServicePaymentSelectionResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { + int grammarID = 51; + int done = 0; + + init_dinChargeParameterDiscoveryResType(dinChargeParameterDiscoveryResType); + + while(!done) { + switch(grammarID) { + case 51: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinChargeParameterDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 52; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 52: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinChargeParameterDiscoveryResType->EVSEProcessing = (dinEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 53; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList); + dinChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; + grammarID = 54; + break; + case 1: + errn = decode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules); + dinChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; + grammarID = 54; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 54: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter); + dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter); + dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter); + dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { + int grammarID = 55; + int done = 0; + + init_dinX509IssuerSerialType(dinX509IssuerSerialType); + + while(!done) { + switch(grammarID) { + case 55: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509IssuerSerialType->X509IssuerName.charactersLen); + if (errn == 0) { + errn = (dinX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinX509IssuerSerialType->X509IssuerName.charactersLen >= 2) { + dinX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.charactersLen, dinX509IssuerSerialType->X509IssuerName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 56; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 56: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinX509IssuerSerialType->X509SerialNumber); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { + int grammarID = 57; + int done = 0; + + init_dinCableCheckResType(dinCableCheckResType); + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinCableCheckResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 58; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 58: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus); + grammarID = 59; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 59: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinCableCheckResType->EVSEProcessing = (dinEVSEProcessingType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { + int grammarID = 60; + int done = 0; + + init_dinMeterInfoType(dinMeterInfoType); + + while(!done) { + switch(grammarID) { + case 60: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->MeterID.charactersLen); + if (errn == 0) { + errn = (dinMeterInfoType->MeterID.charactersLen - 2) <= dinMeterInfoType_MeterID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinMeterInfoType->MeterID.charactersLen >= 2) { + dinMeterInfoType->MeterID.charactersLen = (uint16_t)(dinMeterInfoType->MeterID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinMeterInfoType->MeterID.charactersLen, dinMeterInfoType->MeterID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 61; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 61: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading); + dinMeterInfoType->MeterReading_isUsed = 1u; + grammarID = 62; + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); + } + dinMeterInfoType->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 63; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); + dinMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 62: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); + } + dinMeterInfoType->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 63; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); + dinMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 63: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); + dinMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 64; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 64: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); + dinMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { + int grammarID = 65; + int done = 0; + + init_dinCurrentDemandResType(dinCurrentDemandResType); + + while(!done) { + switch(grammarID) { + case 65: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinCurrentDemandResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 66; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 66: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus); + grammarID = 67; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 67: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage); + grammarID = 68; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 68: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent); + grammarID = 69; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 69: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSECurrentLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 70; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEVoltageLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 71; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 71: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEPowerLimitAchieved); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 72; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 72: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit); + dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; + grammarID = 73; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); + dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 74; + break; + case 2: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 3; + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); + dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; + grammarID = 74; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 3; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 74: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { + int grammarID = 75; + int done = 0; + + init_dinParameterSetType(dinParameterSetType); + + while(!done) { + switch(grammarID) { + case 75: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinParameterSetType->ParameterSetID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 76; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 76: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 77; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 77: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { + errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 77; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { + int grammarID = 78; + int done = 0; + + init_dinSubCertificatesType(dinSubCertificatesType); + + while(!done) { + switch(grammarID) { + case 78: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); + } + dinSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 79; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 79: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); + } + dinSubCertificatesType->Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 79; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { + int grammarID = 9; + int done = 0; + + init_dinEVSEStatusType(dinEVSEStatusType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { + int grammarID = 80; + int done = 0; + + init_dinAC_EVSEStatusType(dinAC_EVSEStatusType); + + while(!done) { + switch(grammarID) { + case 80: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinAC_EVSEStatusType->PowerSwitchClosed); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 81; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 81: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinAC_EVSEStatusType->RCD); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 82; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 82: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinAC_EVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 83; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinAC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { + int grammarID = 84; + int done = 0; + + init_dinEntryType(dinEntryType); + + while(!done) { + switch(grammarID) { + case 84: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval); + dinEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_dinIntervalType(stream, &dinEntryType->TimeInterval); + dinEntryType->TimeInterval_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { + int grammarID = 85; + int done = 0; + + init_dinPowerDeliveryReqType(dinPowerDeliveryReqType); + + while(!done) { + switch(grammarID) { + case 85: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinPowerDeliveryReqType->ReadyToChargeState); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 86; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 86: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile); + dinPowerDeliveryReqType->ChargingProfile_isUsed = 1u; + grammarID = 87; + break; + case 1: + errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); + dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 3: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 87: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); + dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); + dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; + grammarID = 3; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType) { - int grammarID = 11; + int grammarID = 88; int done = 0; init_dinCostType(dinCostType); while(!done) { switch(grammarID) { - case 11: + case 88: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -614,7 +4025,7 @@ static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 12; + grammarID = 89; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -626,7 +4037,7 @@ static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy } } break; - case 12: + case 89: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -646,7 +4057,7 @@ static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 13; + grammarID = 90; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -658,7 +4069,7 @@ static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy } } break; - case 13: + case 90: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -722,166 +4133,23 @@ static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { - int grammarID = 14; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { + int grammarID = 49; int done = 0; - - init_dinX509DataType(dinX509DataType); - + + init_dinWeldingDetectionReqType(dinWeldingDetectionReqType); + while(!done) { switch(grammarID) { - case 14: - /* 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); + case 49: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 15; - break; - case 1: - if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); - } - dinX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= dinX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { - dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); - } - dinX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); - } - dinX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } 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 = 15; + errn = decode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus); + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -889,159 +4157,1088 @@ static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* d } } break; - case 15: - /* 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] */ + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { + int grammarID = 91; + int done = 0; + + init_dinServiceDiscoveryResType(dinServiceDiscoveryResType); + + while(!done) { + switch(grammarID) { + case 91: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinServiceDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 92; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions); + grammarID = 93; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 93: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService); + grammarID = 94; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList); + dinServiceDiscoveryResType->ServiceList_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { + int grammarID = 95; + int done = 0; + + init_dinPaymentOptionsType(dinPaymentOptionsType); + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; + dinPaymentOptionsType->PaymentOption.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 96: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; + dinPaymentOptionsType->PaymentOption.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 96; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = 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_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) { + int grammarID = 97; + int done = 0; + + init_dinPGPDataType(dinPGPDataType); + + while(!done) { + switch(grammarID) { + case 97: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + 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, &dinPGPDataType->PGPKeyID.bytesLen); + if (errn == 0) { + errn = (dinPGPDataType->PGPKeyID.bytesLen) <= dinPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinPGPDataType->PGPKeyID.bytesLen, dinPGPDataType->PGPKeyID.bytes); + } + dinPGPDataType->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 = 98; + } 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, &dinPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (dinPGPDataType->PGPKeyPacket.bytesLen) <= dinPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytesLen, dinPGPDataType->PGPKeyPacket.bytes); + } + dinPGPDataType->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 = 99; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 98: + /* 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, &dinPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (dinPGPDataType->PGPKeyPacket.bytesLen) <= dinPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytesLen, dinPGPDataType->PGPKeyPacket.bytes); + } + dinPGPDataType->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 = 99; + } 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 = 99; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 99: + /* 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 = 99; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { + int grammarID = 100; + int done = 0; + + init_dinChargingProfileType(dinChargingProfileType); + + while(!done) { + switch(grammarID) { + case 100: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinChargingProfileType->SAScheduleTupleID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 101; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 101: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 102; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 102: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { + errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 102; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { + int grammarID = 103; + int done = 0; + + init_dinCurrentDemandReqType(dinCurrentDemandReqType); + + while(!done) { + switch(grammarID) { + case 103: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus); + grammarID = 104; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 104: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent); + grammarID = 105; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 105: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { - errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 15; + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit); + dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; + grammarID = 106; break; case 1: - if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); - } - dinX509DataType->X509SKI.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); + dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 107; break; case 2: - if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= dinX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { - dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinX509DataType->X509SubjectName.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 15; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 108; break; case 3: - if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); - } - dinX509DataType->X509Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } 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) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 15; + grammarID = 109; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; case 4: - if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); - } - dinX509DataType->X509CRL.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } - } 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) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 15; + grammarID = 110; } 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 = 15; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; - case 6: + } + } + break; + case 106: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); + dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; + grammarID = 107; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 108; + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 109; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 110; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 107: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; + grammarID = 108; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 109; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 110; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 108: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 109; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 110; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 109: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 110; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 110: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC); + dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; + grammarID = 111; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); + dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 112; + break; + case 2: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 111: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); + dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; + grammarID = 112; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 112: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* 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_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { + int grammarID = 113; + int done = 0; + + init_dinSignedInfoType(dinSignedInfoType); + + while(!done) { + switch(grammarID) { + case 113: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignedInfoType->Id.charactersLen); + if (errn == 0) { + errn = (dinSignedInfoType->Id.charactersLen - 2) <= dinSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinSignedInfoType->Id.charactersLen >= 2) { + dinSignedInfoType->Id.charactersLen = (uint16_t)(dinSignedInfoType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignedInfoType->Id.charactersLen, dinSignedInfoType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignedInfoType->Id_isUsed = 1u; + grammarID = 114; + break; + case 1: + errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); + grammarID = 115; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 114: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); + grammarID = 115; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 115: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod); + grammarID = 116; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 116: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 117; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 117: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 117; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { + int grammarID = 118; + int done = 0; + + init_dinServiceType(dinServiceType); + + while(!done) { + switch(grammarID) { + case 118: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceTagType(stream, &dinServiceType->ServiceTag); + grammarID = 119; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: done = 1; grammarID = 4; break; @@ -1064,14 +5261,14 @@ static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* d /* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":BodyElement{0-1})', derivedBy='RESTRICTION'. */ static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType) { - int grammarID = 16; + int grammarID = 120; int done = 0; - + init_dinBodyType(dinBodyType); - + while(!done) { switch(grammarID) { - case 16: + case 120: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); if (errn == 0) { @@ -1287,343 +5484,16 @@ static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyTy return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { - int grammarID = 17; - int done = 0; - - init_dinRetrievalMethodType(dinRetrievalMethodType); - - while(!done) { - switch(grammarID) { - case 17: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->Type.charactersLen); - if (errn == 0) { - errn = (dinRetrievalMethodType->Type.charactersLen - 2) <= dinRetrievalMethodType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinRetrievalMethodType->Type.charactersLen >= 2) { - dinRetrievalMethodType->Type.charactersLen = (uint16_t)(dinRetrievalMethodType->Type.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinRetrievalMethodType->Type.charactersLen, dinRetrievalMethodType->Type.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinRetrievalMethodType->Type_isUsed = 1u; - grammarID = 18; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen); - if (errn == 0) { - errn = (dinRetrievalMethodType->URI.charactersLen - 2) <= dinRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinRetrievalMethodType->URI.charactersLen >= 2) { - dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinRetrievalMethodType->URI_isUsed = 1u; - grammarID = 19; - break; - case 2: - errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); - dinRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 18: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen); - if (errn == 0) { - errn = (dinRetrievalMethodType->URI.charactersLen - 2) <= dinRetrievalMethodType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinRetrievalMethodType->URI.charactersLen >= 2) { - dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinRetrievalMethodType->URI_isUsed = 1u; - grammarID = 19; - break; - case 1: - errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); - dinRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 19: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms); - dinRetrievalMethodType->Transforms_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { - int grammarID = 20; - int done = 0; - - init_dinCertificateInstallationReqType(dinCertificateInstallationReqType); - - while(!done) { - switch(grammarID) { - case 20: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->Id.charactersLen); - if (errn == 0) { - errn = (dinCertificateInstallationReqType->Id.charactersLen - 2) <= dinCertificateInstallationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCertificateInstallationReqType->Id.charactersLen >= 2) { - dinCertificateInstallationReqType->Id.charactersLen = (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCertificateInstallationReqType->Id.charactersLen, dinCertificateInstallationReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinCertificateInstallationReqType->Id_isUsed = 1u; - grammarID = 21; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 22; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 21: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 22; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 22: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs); - grammarID = 23; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 23: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->DHParams.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationReqType->DHParams.bytesLen) <= dinCertificateInstallationReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytesLen, dinCertificateInstallationReqType->DHParams.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { - int grammarID = 24; + int grammarID = 121; int done = 0; - + init_dinAC_EVChargeParameterType(dinAC_EVChargeParameterType); - + while(!done) { switch(grammarID) { - case 24: + case 121: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -1643,7 +5513,7 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 25; + grammarID = 122; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -1655,14 +5525,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 25: + case 122: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EAmount); - grammarID = 26; + grammarID = 123; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1670,14 +5540,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 26: + case 123: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxVoltage); - grammarID = 27; + grammarID = 124; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1685,14 +5555,14 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 27: + case 124: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxCurrent); - grammarID = 28; + grammarID = 125; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1700,7 +5570,7 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ } } break; - case 28: + case 125: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -1741,83 +5611,40 @@ static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { - int grammarID = 29; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { + int grammarID = 126; int done = 0; - init_dinObjectType(dinObjectType); + init_dinSAScheduleTupleType(dinSAScheduleTupleType); while(!done) { switch(grammarID) { - case 29: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + case 126: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinObjectType->Encoding.charactersLen); - if (errn == 0) { - errn = (dinObjectType->Encoding.charactersLen - 2) <= dinObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinObjectType->Encoding.charactersLen >= 2) { - dinObjectType->Encoding.charactersLen = (uint16_t)(dinObjectType->Encoding.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinObjectType->Encoding.charactersLen, dinObjectType->Encoding.characters); + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinSAScheduleTupleType->SAScheduleTupleID); } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } - dinObjectType->Encoding_isUsed = 1u; - grammarID = 30; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen); - if (errn == 0) { - errn = (dinObjectType->Id.charactersLen - 2) <= dinObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinObjectType->Id.charactersLen >= 2) { - dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters); + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 127; } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - dinObjectType->Id_isUsed = 1u; - grammarID = 31; - break; - case 2: - errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinObjectType->MimeType.charactersLen >= 2) { - dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->MimeType_isUsed = 1u; - grammarID = 32; - break; - case 3: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 33; - break; - case 4: - done = 1; - grammarID = 4; - break; - case 5: - errn = decodeDeviationsCH(stream); - grammarID = 33; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1825,56 +5652,14 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb } } break; - case 30: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + case 127: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen); - if (errn == 0) { - errn = (dinObjectType->Id.charactersLen - 2) <= dinObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinObjectType->Id.charactersLen >= 2) { - dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->Id_isUsed = 1u; - grammarID = 31; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinObjectType->MimeType.charactersLen >= 2) { - dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->MimeType_isUsed = 1u; - grammarID = 32; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 33; - break; - case 3: - done = 1; - grammarID = 4; - break; - case 4: - grammarID = 33; + errn = decode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule); + grammarID = 128; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1882,47 +5667,450 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb } } break; - case 31: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + case 128: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen); - if (errn == 0) { - errn = (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinObjectType->MimeType.charactersLen >= 2) { - dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinObjectType->MimeType_isUsed = 1u; - grammarID = 32; + errn = decode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff); + dinSAScheduleTupleType->SalesTariff_isUsed = 1u; + grammarID = 3; break; case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 33; - break; - case 2: done = 1; grammarID = 4; break; - case 3: - grammarID = 33; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; } } break; - case 32: + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple{1-UNBOUNDED})', derivedBy='EXTENSION'. */ +static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) { + int grammarID = 129; + int done = 0; + + init_dinSAScheduleListType(dinSAScheduleListType); + + while(!done) { + switch(grammarID) { + case 129: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSAScheduleListType->SAScheduleTuple.arrayLen < dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { + errn = decode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array[dinSAScheduleListType->SAScheduleTuple.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 130; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 130: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSAScheduleListType->SAScheduleTuple.arrayLen < dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { + errn = decode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array[dinSAScheduleListType->SAScheduleTuple.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 130; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { + int grammarID = 131; + int done = 0; + + init_dinServicePaymentSelectionReqType(dinServicePaymentSelectionReqType); + + while(!done) { + switch(grammarID) { + case 131: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + dinServicePaymentSelectionReqType->SelectedPaymentOption = (dinpaymentOptionType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 132; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 132: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->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='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) { + int grammarID = 133; + int done = 0; + + init_dinPMaxScheduleType(dinPMaxScheduleType); + + while(!done) { + switch(grammarID) { + case 133: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinPMaxScheduleType->PMaxScheduleID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 134; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 134: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinPMaxScheduleType->PMaxScheduleEntry.arrayLen < dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { + errn = decode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array[dinPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 135; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 135: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinPMaxScheduleType->PMaxScheduleEntry.arrayLen < dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { + errn = decode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array[dinPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 135; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { + int grammarID = 136; + int done = 0; + + init_dinListOfRootCertificateIDsType(dinListOfRootCertificateIDsType); + + while(!done) { + switch(grammarID) { + case 136: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2) <= dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) { + dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 137; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 137: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2) <= dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) { + dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 137; + } 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='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { + int grammarID = 138; + int done = 0; + + init_dinCanonicalizationMethodType(dinCanonicalizationMethodType); + + while(!done) { + switch(grammarID) { + case 138: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinCanonicalizationMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (dinCanonicalizationMethodType->Algorithm.charactersLen - 2) <= dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinCanonicalizationMethodType->Algorithm.charactersLen >= 2) { + dinCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(dinCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.charactersLen, dinCanonicalizationMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 139; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 139: /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1930,14 +6118,14 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 33; + grammarID = 45; break; case 1: done = 1; grammarID = 4; break; case 2: - grammarID = 33; + grammarID = 45; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1945,7 +6133,7 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb } } break; - case 33: + case 45: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -1953,14 +6141,764 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 33; + grammarID = 45; break; case 1: done = 1; grammarID = 4; break; case 2: - grammarID = 33; + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) { + int grammarID = 140; + int done = 0; + + init_dinTransformType(dinTransformType); + + while(!done) { + switch(grammarID) { + case 140: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinTransformType->Algorithm.charactersLen); + if (errn == 0) { + errn = (dinTransformType->Algorithm.charactersLen - 2) <= dinTransformType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinTransformType->Algorithm.charactersLen >= 2) { + dinTransformType->Algorithm.charactersLen = (uint16_t)(dinTransformType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinTransformType->Algorithm.charactersLen, dinTransformType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 141; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 141: + /* 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 (dinTransformType->XPath.arrayLen < dinTransformType_XPath_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2) <= dinTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) { + dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinTransformType->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 = 142; + } 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 = 142; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + grammarID = 142; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 142: + /* 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 (dinTransformType->XPath.arrayLen < dinTransformType_XPath_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2) <= dinTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) { + dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinTransformType->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 = 142; + } 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 = 142; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + grammarID = 142; + break; + default: + errn = 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_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) { + int grammarID = 143; + int done = 0; + + init_dinKeyInfoType(dinKeyInfoType); + + while(!done) { + switch(grammarID) { + case 143: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->Id.charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->Id.charactersLen - 2) <= dinKeyInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->Id.charactersLen >= 2) { + dinKeyInfoType->Id.charactersLen = (uint16_t)(dinKeyInfoType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->Id.charactersLen, dinKeyInfoType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->Id_isUsed = 1u; + grammarID = 144; + break; + case 1: + if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 3: + if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 4: + if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 5: + if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 6: + if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 7: + if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } 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 = 145; + break; + case 9: + grammarID = 146; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 144: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 2: + if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 3: + if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 4: + if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 5: + if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 6: + if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } 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 = 145; + break; + case 8: + grammarID = 146; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 145: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 2: + if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 3: + if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 4: + if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 5: + if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 6: + if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } 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 = 145; + break; + case 8: + done = 1; + grammarID = 4; + break; + case 9: + grammarID = 145; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 146: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { + dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { + errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 2: + if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { + errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 3: + if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { + errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 4: + if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { + errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 5: + if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { + errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 145; + break; + case 6: + if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { + dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinKeyInfoType->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 = 145; + } 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 = 145; + break; + case 8: + grammarID = 146; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -1981,14 +6919,14 @@ static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinOb /* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType) { - int grammarID = 34; + int grammarID = 147; int done = 0; init_dinContractAuthenticationResType(dinContractAuthenticationResType); while(!done) { switch(grammarID) { - case 34: + case 147: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -2009,7 +6947,7 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 35; + grammarID = 59; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2021,7 +6959,7 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d } } break; - case 35: + case 59: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -2080,36 +7018,51 @@ static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { - int grammarID = 36; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ +static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { + int grammarID = 148; int done = 0; - init_dinChargingProfileType(dinChargingProfileType); + init_dinServiceChargeType(dinServiceChargeType); while(!done) { switch(grammarID) { - case 36: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + case 148: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag); + grammarID = 149; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 149: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger16(stream, &dinChargingProfileType->SAScheduleTupleID); + errn = decodeBoolean(stream, &dinServiceChargeType->FreeService); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 37; + grammarID = 150; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2121,97 +7074,8 @@ static int decode_dinChargingProfileType(bitstream_t* stream, struct dinCharging } } break; - case 37: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 38; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 38: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) { - errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 38; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ -static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { - int grammarID = 39; - int done = 0; - - init_dinCertificateUpdateResType(dinCertificateUpdateResType); - - while(!done) { - switch(grammarID) { - case 39: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->Id.charactersLen); - if (errn == 0) { - errn = (dinCertificateUpdateResType->Id.charactersLen - 2) <= dinCertificateUpdateResType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCertificateUpdateResType->Id.charactersLen >= 2) { - dinCertificateUpdateResType->Id.charactersLen = (uint16_t)(dinCertificateUpdateResType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCertificateUpdateResType->Id.charactersLen, dinCertificateUpdateResType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 40; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 40: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + case 150: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -2220,182 +7084,15 @@ static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCer errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCertificateUpdateResType->ResponseCode = (dinresponseCodeType) uint32; + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinServiceChargeType->EnergyTransferType = (dinEVSESupportedEnergyTransferType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 41; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain); - grammarID = 42; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); - if (errn == 0) { - errn = (dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:2010:MsgBody}DHParams)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->DHParams.bytesLen); - if (errn == 0) { - errn = (dinCertificateUpdateResType->DHParams.bytesLen) <= dinCertificateUpdateResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateUpdateResType->DHParams.bytesLen, dinCertificateUpdateResType->DHParams.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 44; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 44: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractID.charactersLen); - if (errn == 0) { - errn = (dinCertificateUpdateResType->ContractID.charactersLen - 2) <= dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCertificateUpdateResType->ContractID.charactersLen >= 2) { - dinCertificateUpdateResType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCertificateUpdateResType->ContractID.charactersLen, dinCertificateUpdateResType->ContractID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 45; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinCertificateUpdateResType->RetryCounter); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -2436,16 +7133,634 @@ static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCer return errn; } +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { + int grammarID = 151; + int done = 0; + + init_dinServiceParameterListType(dinServiceParameterListType); + + while(!done) { + switch(grammarID) { + case 151: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 152; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 152: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { + errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 152; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { + int grammarID = 153; + int done = 0; + + init_dinSignatureType(dinSignatureType); + + while(!done) { + switch(grammarID) { + case 153: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignatureType->Id.charactersLen); + if (errn == 0) { + errn = (dinSignatureType->Id.charactersLen - 2) <= dinSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinSignatureType->Id.charactersLen >= 2) { + dinSignatureType->Id.charactersLen = (uint16_t)(dinSignatureType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignatureType->Id.charactersLen, dinSignatureType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignatureType->Id_isUsed = 1u; + grammarID = 154; + break; + case 1: + errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); + grammarID = 155; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 154: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); + grammarID = 155; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 155: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue); + grammarID = 156; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 156: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo); + dinSignatureType->KeyInfo_isUsed = 1u; + grammarID = 157; + break; + case 1: + if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { + errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 157; + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 157: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { + errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 157; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { + int grammarID = 158; + int done = 0; + + init_dinMeteringReceiptResType(dinMeteringReceiptResType); + + while(!done) { + switch(grammarID) { + case 158: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinMeteringReceiptResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 159; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 159: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { + int grammarID = 160; + int done = 0; + + init_dinX509DataType(dinX509DataType); + + while(!done) { + switch(grammarID) { + case 160: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 161; + break; + case 1: + if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); + } + dinX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= dinX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); + } + dinX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); + } + dinX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 161; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 161: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) { + errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 161; + break; + case 1: + if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes); + } + dinX509DataType->X509SKI.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen); + if (errn == 0) { + errn = (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2) <= dinX509DataType_X509SubjectName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) { + dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinX509DataType->X509SubjectName.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes); + } + dinX509DataType->X509Certificate.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen); + if (errn == 0) { + errn = (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes); + } + dinX509DataType->X509CRL.arrayLen++; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 161; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 5: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 161; + break; + case 6: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) { - int grammarID = 46; + int grammarID = 162; int done = 0; init_dinReferenceType(dinReferenceType); while(!done) { switch(grammarID) { - case 46: + case 162: /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -2465,7 +7780,7 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } dinReferenceType->Id_isUsed = 1u; - grammarID = 47; + grammarID = 163; break; case 1: errn = decodeUnsignedInteger16(stream, &dinReferenceType->Type.charactersLen); @@ -2482,7 +7797,7 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } dinReferenceType->Type_isUsed = 1u; - grammarID = 48; + grammarID = 164; break; case 2: errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen); @@ -2499,16 +7814,16 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } dinReferenceType->URI_isUsed = 1u; - grammarID = 49; + grammarID = 165; break; case 3: errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); dinReferenceType->Transforms_isUsed = 1u; - grammarID = 50; + grammarID = 166; break; case 4: errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 51; + grammarID = 167; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2516,7 +7831,7 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } break; - case 47: + case 163: /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -2536,7 +7851,7 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } dinReferenceType->Type_isUsed = 1u; - grammarID = 48; + grammarID = 164; break; case 1: errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen); @@ -2553,16 +7868,16 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } dinReferenceType->URI_isUsed = 1u; - grammarID = 49; + grammarID = 165; break; case 2: errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); dinReferenceType->Transforms_isUsed = 1u; - grammarID = 50; + grammarID = 166; break; case 3: errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 51; + grammarID = 167; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2570,7 +7885,7 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } break; - case 48: + case 164: /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -2590,16 +7905,16 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } dinReferenceType->URI_isUsed = 1u; - grammarID = 49; + grammarID = 165; break; case 1: errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); dinReferenceType->Transforms_isUsed = 1u; - grammarID = 50; + grammarID = 166; break; case 2: errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 51; + grammarID = 167; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2607,7 +7922,7 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } break; - case 49: + case 165: /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -2615,11 +7930,11 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* case 0: errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); dinReferenceType->Transforms_isUsed = 1u; - grammarID = 50; + grammarID = 166; break; case 1: errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 51; + grammarID = 167; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2627,14 +7942,14 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } break; - case 50: + case 166: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); - grammarID = 51; + grammarID = 167; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2642,7 +7957,7 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* } } break; - case 51: + case 167: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -2706,29 +8021,41 @@ static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { - int grammarID = 52; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) { + int grammarID = 168; int done = 0; - init_dinPMaxScheduleEntryType(dinPMaxScheduleEntryType); + init_dinPhysicalValueType(dinPhysicalValueType); while(!done) { switch(grammarID) { - case 52: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 168: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval); - dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 53; - break; - case 1: - errn = decode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval); - dinPMaxScheduleEntryType->TimeInterval_isUsed = 1u; - grammarID = 53; + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + dinPhysicalValueType->Multiplier = (int8_t)(uint32 -3); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 169; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2736,7 +8063,1001 @@ static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxSc } } break; - case 53: + case 169: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinPhysicalValueType->Unit = (dinunitSymbolType) uint32; + dinPhysicalValueType->Unit_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 170; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinPhysicalValueType->Value); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 170: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinPhysicalValueType->Value); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { + int grammarID = 171; + int done = 0; + + init_dinRelativeTimeIntervalType(dinRelativeTimeIntervalType); + + while(!done) { + switch(grammarID) { + case 171: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->start); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 172; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 172: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->duration); + dinRelativeTimeIntervalType->duration_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { + int grammarID = 173; + int done = 0; + + init_dinSalesTariffType(dinSalesTariffType); + + while(!done) { + switch(grammarID) { + case 173: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->Id.charactersLen); + if (errn == 0) { + errn = (dinSalesTariffType->Id.charactersLen - 2) <= dinSalesTariffType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinSalesTariffType->Id.charactersLen >= 2) { + dinSalesTariffType->Id.charactersLen = (uint16_t)(dinSalesTariffType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSalesTariffType->Id.charactersLen, dinSalesTariffType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 174; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 174: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinSalesTariffType->SalesTariffID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 175; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 175: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->SalesTariffDescription.charactersLen); + if (errn == 0) { + errn = (dinSalesTariffType->SalesTariffDescription.charactersLen - 2) <= dinSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinSalesTariffType->SalesTariffDescription.charactersLen >= 2) { + dinSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.charactersLen, dinSalesTariffType->SalesTariffDescription.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSalesTariffType->SalesTariffDescription_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 176; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 177; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 176: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 177; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 177: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 178; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 178: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { + errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 178; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { + int grammarID = 179; + int done = 0; + + init_dinSignatureValueType(dinSignatureValueType); + + while(!done) { + switch(grammarID) { + case 179: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->Id.charactersLen); + if (errn == 0) { + errn = (dinSignatureValueType->Id.charactersLen - 2) <= dinSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinSignatureValueType->Id.charactersLen >= 2) { + dinSignatureValueType->Id.charactersLen = (uint16_t)(dinSignatureValueType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignatureValueType->Id.charactersLen, dinSignatureValueType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignatureValueType->Id_isUsed = 1u; + grammarID = 180; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); + } + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 180: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); + if (errn == 0) { + errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); + } + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { + int grammarID = 9; + int done = 0; + + init_dinEVStatusType(dinEVStatusType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { + int grammarID = 181; + int done = 0; + + init_dinChargingStatusResType(dinChargingStatusResType); + + while(!done) { + switch(grammarID) { + case 181: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinChargingStatusResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 182; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 182: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinChargingStatusResType->EVSEID.bytesLen); + if (errn == 0) { + errn = (dinChargingStatusResType->EVSEID.bytesLen) <= dinChargingStatusResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinChargingStatusResType->EVSEID.bytesLen, dinChargingStatusResType->EVSEID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 183; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 183: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinChargingStatusResType->SAScheduleTupleID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 184; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 184: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent); + dinChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; + grammarID = 185; + break; + case 1: + errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); + dinChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 186; + break; + case 2: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 159; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 185: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); + dinChargingStatusResType->MeterInfo_isUsed = 1u; + grammarID = 186; + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 159; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 186: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 159; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 159: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) { + int grammarID = 187; + int done = 0; + + init_dinManifestType(dinManifestType); + + while(!done) { + switch(grammarID) { + case 187: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinManifestType->Id.charactersLen); + if (errn == 0) { + errn = (dinManifestType->Id.charactersLen - 2) <= dinManifestType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinManifestType->Id.charactersLen >= 2) { + dinManifestType->Id.charactersLen = (uint16_t)(dinManifestType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinManifestType->Id.charactersLen, dinManifestType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinManifestType->Id_isUsed = 1u; + grammarID = 188; + break; + case 1: + if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 117; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 188: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 117; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 117: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { + errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 117; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { + int grammarID = 9; + int done = 0; + + init_dinSASchedulesType(dinSASchedulesType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { + int grammarID = 189; + int done = 0; + + init_dinPMaxScheduleEntryType(dinPMaxScheduleEntryType); + + while(!done) { + switch(grammarID) { + case 189: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval); + dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 190; + break; + case 1: + errn = decode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval); + dinPMaxScheduleEntryType->TimeInterval_isUsed = 1u; + grammarID = 190; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 190: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -2794,1985 +9115,16 @@ static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxSc return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { - int grammarID = 54; - int done = 0; - - init_dinServicePaymentSelectionReqType(dinServicePaymentSelectionReqType); - - while(!done) { - switch(grammarID) { - case 54: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinServicePaymentSelectionReqType->SelectedPaymentOption = (dinpaymentOptionType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 55; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 55: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ -static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { - int grammarID = 56; - int done = 0; - - init_dinCertificateInstallationResType(dinCertificateInstallationResType); - - while(!done) { - switch(grammarID) { - case 56: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->Id.charactersLen); - if (errn == 0) { - errn = (dinCertificateInstallationResType->Id.charactersLen - 2) <= dinCertificateInstallationResType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCertificateInstallationResType->Id.charactersLen >= 2) { - dinCertificateInstallationResType->Id.charactersLen = (uint16_t)(dinCertificateInstallationResType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCertificateInstallationResType->Id.charactersLen, dinCertificateInstallationResType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 57; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 57: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCertificateInstallationResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 58; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 58: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain); - grammarID = 59; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 59: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 60; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 60: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->DHParams.bytesLen); - if (errn == 0) { - errn = (dinCertificateInstallationResType->DHParams.bytesLen) <= dinCertificateInstallationResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateInstallationResType->DHParams.bytesLen, dinCertificateInstallationResType->DHParams.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 61; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 61: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractID.charactersLen); - if (errn == 0) { - errn = (dinCertificateInstallationResType->ContractID.charactersLen - 2) <= dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCertificateInstallationResType->ContractID.charactersLen >= 2) { - dinCertificateInstallationResType->ContractID.charactersLen = (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCertificateInstallationResType->ContractID.charactersLen, dinCertificateInstallationResType->ContractID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { - int grammarID = 62; - int done = 0; - - init_dinSelectedServiceType(dinSelectedServiceType); - - while(!done) { - switch(grammarID) { - case 62: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSelectedServiceType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 63; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 63: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinSelectedServiceType->ParameterSetID); - dinSelectedServiceType->ParameterSetID_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { - int grammarID = 64; - int done = 0; - - init_dinDC_EVStatusType(dinDC_EVStatusType); - - while(!done) { - switch(grammarID) { - case 64: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVReady); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 65; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 65: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVCabinConditioning); - dinDC_EVStatusType->EVCabinConditioning_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 66; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); - dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 67; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 68; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 66: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); - dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 67; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 68; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 67: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 68; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 68: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) { - int grammarID = 69; - int done = 0; - - init_dinPGPDataType(dinPGPDataType); - - while(!done) { - switch(grammarID) { - case 69: - /* 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, &dinPGPDataType->PGPKeyID.bytesLen); - if (errn == 0) { - errn = (dinPGPDataType->PGPKeyID.bytesLen) <= dinPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinPGPDataType->PGPKeyID.bytesLen, dinPGPDataType->PGPKeyID.bytes); - } - dinPGPDataType->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 = 70; - } 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, &dinPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (dinPGPDataType->PGPKeyPacket.bytesLen) <= dinPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytesLen, dinPGPDataType->PGPKeyPacket.bytes); - } - dinPGPDataType->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 = 71; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 70: - /* Element[START_ELEMENT({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, &dinPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (dinPGPDataType->PGPKeyPacket.bytesLen) <= dinPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytesLen, dinPGPDataType->PGPKeyPacket.bytes); - } - dinPGPDataType->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 = 71; - } 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 = 71; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 71: - /* 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 = 71; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { - int grammarID = 72; - int done = 0; - - init_dinCurrentDemandResType(dinCurrentDemandResType); - - while(!done) { - switch(grammarID) { - case 72: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCurrentDemandResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 73; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus); - grammarID = 74; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 74: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage); - grammarID = 75; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 75: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent); - grammarID = 76; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 76: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSECurrentLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 77; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 77: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEVoltageLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:2010:MsgBody}EVSEPowerLimitAchieved)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEPowerLimitAchieved); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 79; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit); - dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u; - grammarID = 80; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); - dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 81; - break; - case 2: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); - dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 80: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit); - dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 81; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); - dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit); - dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { - int grammarID = 82; - int done = 0; - - init_dinCableCheckReqType(dinCableCheckReqType); - - while(!done) { - switch(grammarID) { - case 82: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { - int grammarID = 83; - int done = 0; - - init_dinChargingStatusResType(dinChargingStatusResType); - - while(!done) { - switch(grammarID) { - case 83: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinChargingStatusResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 84; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 84: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinChargingStatusResType->EVSEID.bytesLen); - if (errn == 0) { - errn = (dinChargingStatusResType->EVSEID.bytesLen) <= dinChargingStatusResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinChargingStatusResType->EVSEID.bytesLen, dinChargingStatusResType->EVSEID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 85; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 85: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinChargingStatusResType->SAScheduleTupleID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 86; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 86: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent); - dinChargingStatusResType->EVSEMaxCurrent_isUsed = 1u; - grammarID = 87; - break; - case 1: - errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); - dinChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 88; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 89; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 87: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo); - dinChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 88; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 89; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 88: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 89; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 89: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { - int grammarID = 82; - int done = 0; - - init_dinWeldingDetectionReqType(dinWeldingDetectionReqType); - - while(!done) { - switch(grammarID) { - case 82: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { - int grammarID = 90; - int done = 0; - - init_dinServiceParameterListType(dinServiceParameterListType); - - while(!done) { - switch(grammarID) { - case 90: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 91; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 91: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) { - errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 91; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { - int grammarID = 92; - int done = 0; - - init_dinCertificateChainType(dinCertificateChainType); - - while(!done) { - switch(grammarID) { - case 92: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010: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, &dinCertificateChainType->Certificate.bytesLen); - if (errn == 0) { - errn = (dinCertificateChainType->Certificate.bytesLen) <= dinCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateChainType->Certificate.bytesLen, dinCertificateChainType->Certificate.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 93; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 93: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates); - dinCertificateChainType->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:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { - int grammarID = 94; - int done = 0; - - init_dinPowerDeliveryResType(dinPowerDeliveryResType); - - while(!done) { - switch(grammarID) { - case 94: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinPowerDeliveryResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 95; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 95: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus); - dinPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus); - dinPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus); - dinPowerDeliveryResType->EVSEStatus_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ -static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { - int grammarID = 96; - int done = 0; - - init_dinAC_EVSEChargeParameterType(dinAC_EVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 96: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus); - grammarID = 97; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 97: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage); - grammarID = 98; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 98: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent); - grammarID = 99; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 99: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ -static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { - int grammarID = 100; - int done = 0; - - init_dinAnonType_V2G_Message(dinAnonType_V2G_Message); - - while(!done) { - switch(grammarID) { - case 100: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header); - grammarID = 101; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 101: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinBodyType(stream, &dinAnonType_V2G_Message->Body); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { - int grammarID = 102; - int done = 0; - - init_dinConsumptionCostType(dinConsumptionCostType); - - while(!done) { - switch(grammarID) { - case 102: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinConsumptionCostType->startValue); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 103; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 103: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinConsumptionCostType->Cost.arrayLen < dinConsumptionCostType_Cost_ARRAY_SIZE) { - errn = decode_dinCostType(stream, &dinConsumptionCostType->Cost.array[dinConsumptionCostType->Cost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 103; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { - int grammarID = 104; + int grammarID = 191; int done = 0; init_dinDC_EVSEStatusType(dinDC_EVSEStatusType); while(!done) { switch(grammarID) { - case 104: + case 191: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -4794,7 +9146,7 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 105; + grammarID = 192; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4816,7 +9168,7 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 106; + grammarID = 82; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4828,7 +9180,7 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta } } break; - case 105: + case 192: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -4849,7 +9201,7 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 106; + grammarID = 82; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4861,7 +9213,7 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta } } break; - case 106: + case 82: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -4881,7 +9233,7 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 107; + grammarID = 83; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4893,7 +9245,7 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta } } break; - case 107: + case 83: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -4952,41 +9304,23 @@ static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSESta return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) { - int grammarID = 108; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { + int grammarID = 193; int done = 0; - init_dinWeldingDetectionResType(dinWeldingDetectionResType); + init_dinPreChargeReqType(dinPreChargeReqType); while(!done) { switch(grammarID) { - case 108: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + case 193: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinWeldingDetectionResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 109; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus); + grammarID = 194; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4994,14 +9328,14 @@ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeld } } break; - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + case 194: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus); - grammarID = 110; + errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage); + grammarID = 195; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5009,13 +9343,13 @@ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeld } } break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + case 195: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage); + errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent); grammarID = 3; break; default: @@ -5050,2636 +9384,16 @@ static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeld return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { - int grammarID = 111; - int done = 0; - - init_dinSessionSetupReqType(dinSessionSetupReqType); - - while(!done) { - switch(grammarID) { - case 111: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSessionSetupReqType->EVCCID.bytesLen); - if (errn == 0) { - errn = (dinSessionSetupReqType->EVCCID.bytesLen) <= dinSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSessionSetupReqType->EVCCID.bytesLen, dinSessionSetupReqType->EVCCID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { - int grammarID = 112; - int done = 0; - - init_dinSessionSetupResType(dinSessionSetupResType); - - while(!done) { - switch(grammarID) { - case 112: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinSessionSetupResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 113; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSessionSetupResType->EVSEID.bytesLen); - if (errn == 0) { - errn = (dinSessionSetupResType->EVSEID.bytesLen) <= dinSessionSetupResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSessionSetupResType->EVSEID.bytesLen, dinSessionSetupResType->EVSEID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 114; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 114: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinSessionSetupResType->DateTimeNow); - dinSessionSetupResType->DateTimeNow_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { - int grammarID = 115; - int done = 0; - - init_dinServiceDetailResType(dinServiceDetailResType); - - while(!done) { - switch(grammarID) { - case 115: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinServiceDetailResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 116; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 116: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinServiceDetailResType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 117; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 117: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList); - dinServiceDetailResType->ServiceParameterList_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) { - int grammarID = 118; - int done = 0; - - init_dinSPKIDataType(dinSPKIDataType); - - while(!done) { - switch(grammarID) { - case 118: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes); - } - dinSPKIDataType->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 = 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({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 (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes); - } - dinSPKIDataType->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 = 119; - } 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 = 120; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 120: - /* 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 (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes); - } - dinSPKIDataType->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 = 119; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { - int grammarID = 121; - int done = 0; - - init_dinPowerDeliveryReqType(dinPowerDeliveryReqType); - - while(!done) { - switch(grammarID) { - case 121: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinPowerDeliveryReqType->ReadyToChargeState); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 122; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile); - dinPowerDeliveryReqType->ChargingProfile_isUsed = 1u; - grammarID = 123; - break; - case 1: - errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); - dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter); - dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter); - dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { - int grammarID = 108; - int done = 0; - - init_dinPreChargeResType(dinPreChargeResType); - - while(!done) { - switch(grammarID) { - case 108: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinPreChargeResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 109; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus); - grammarID = 110; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage); - grammarID = 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_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { - int grammarID = 124; - int done = 0; - - init_dinCanonicalizationMethodType(dinCanonicalizationMethodType); - - while(!done) { - switch(grammarID) { - case 124: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinCanonicalizationMethodType->Algorithm.charactersLen); - if (errn == 0) { - errn = (dinCanonicalizationMethodType->Algorithm.charactersLen - 2) <= dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCanonicalizationMethodType->Algorithm.charactersLen >= 2) { - dinCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(dinCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.charactersLen, dinCanonicalizationMethodType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 32; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 32: - /* 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 = 33; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 33; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 33: - /* 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 = 33; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 33; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ -static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { - int grammarID = 125; - int done = 0; - - init_dinServiceChargeType(dinServiceChargeType); - - while(!done) { - switch(grammarID) { - case 125: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag); - grammarID = 126; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 126: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinServiceChargeType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 127; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinServiceChargeType->EnergyTransferType = (dinEVSESupportedEnergyTransferType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { - int grammarID = 128; - int done = 0; - - init_dinEVChargeParameterType(dinEVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple{1-UNBOUNDED})', derivedBy='EXTENSION'. */ -static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) { - int grammarID = 129; - int done = 0; - - init_dinSAScheduleListType(dinSAScheduleListType); - - while(!done) { - switch(grammarID) { - case 129: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSAScheduleListType->SAScheduleTuple.arrayLen < dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { - errn = decode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array[dinSAScheduleListType->SAScheduleTuple.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 130; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 130: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSAScheduleListType->SAScheduleTuple.arrayLen < dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) { - errn = decode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array[dinSAScheduleListType->SAScheduleTuple.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 130; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { - int grammarID = 128; - int done = 0; - - init_dinSASchedulesType(dinSASchedulesType); - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) { - int grammarID = 131; - int done = 0; - - init_dinPhysicalValueType(dinPhysicalValueType); - - while(!done) { - switch(grammarID) { - case 131: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); - dinPhysicalValueType->Multiplier = (int8_t)(uint32 -3); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 132; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 132: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 4, &uint32); - dinPhysicalValueType->Unit = (dinunitSymbolType) uint32; - dinPhysicalValueType->Unit_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 133; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinPhysicalValueType->Value); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 133: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinPhysicalValueType->Value); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { - int grammarID = 134; - int done = 0; - - init_dinSAScheduleTupleType(dinSAScheduleTupleType); - - while(!done) { - switch(grammarID) { - case 134: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinSAScheduleTupleType->SAScheduleTupleID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 135; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 135: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule); - grammarID = 136; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 136: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff); - dinSAScheduleTupleType->SalesTariff_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { - int grammarID = 137; - int done = 0; - - init_dinCertificateUpdateReqType(dinCertificateUpdateReqType); - - while(!done) { - switch(grammarID) { - case 137: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->Id.charactersLen); - if (errn == 0) { - errn = (dinCertificateUpdateReqType->Id.charactersLen - 2) <= dinCertificateUpdateReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCertificateUpdateReqType->Id.charactersLen >= 2) { - dinCertificateUpdateReqType->Id.charactersLen = (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCertificateUpdateReqType->Id.charactersLen, dinCertificateUpdateReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinCertificateUpdateReqType->Id_isUsed = 1u; - grammarID = 138; - break; - case 1: - errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain); - grammarID = 139; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 138: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain); - grammarID = 139; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 139: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->ContractID.charactersLen); - if (errn == 0) { - errn = (dinCertificateUpdateReqType->ContractID.charactersLen - 2) <= dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinCertificateUpdateReqType->ContractID.charactersLen >= 2) { - dinCertificateUpdateReqType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinCertificateUpdateReqType->ContractID.charactersLen, dinCertificateUpdateReqType->ContractID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 22; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 22: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs); - grammarID = 23; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 23: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->DHParams.bytesLen); - if (errn == 0) { - errn = (dinCertificateUpdateReqType->DHParams.bytesLen) <= dinCertificateUpdateReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytesLen, dinCertificateUpdateReqType->DHParams.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { - int grammarID = 140; - int done = 0; - - init_dinSignatureMethodType(dinSignatureMethodType); - - while(!done) { - switch(grammarID) { - case 140: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinSignatureMethodType->Algorithm.charactersLen); - if (errn == 0) { - errn = (dinSignatureMethodType->Algorithm.charactersLen - 2) <= dinSignatureMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinSignatureMethodType->Algorithm.charactersLen >= 2) { - dinSignatureMethodType->Algorithm.charactersLen = (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignatureMethodType->Algorithm.charactersLen, dinSignatureMethodType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 141; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 141: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); - dinSignatureMethodType->HMACOutputLength_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 33; - } 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 = 33; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 142; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 33: - /* 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 = 33; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 33; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 142: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength); - dinSignatureMethodType->HMACOutputLength_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 33; - } 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 = 33; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 142; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) { - int grammarID = 124; - int done = 0; - - init_dinDigestMethodType(dinDigestMethodType); - - while(!done) { - switch(grammarID) { - case 124: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinDigestMethodType->Algorithm.charactersLen); - if (errn == 0) { - errn = (dinDigestMethodType->Algorithm.charactersLen - 2) <= dinDigestMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinDigestMethodType->Algorithm.charactersLen >= 2) { - dinDigestMethodType->Algorithm.charactersLen = (uint16_t)(dinDigestMethodType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinDigestMethodType->Algorithm.charactersLen, dinDigestMethodType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 32; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 32: - /* 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 = 33; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 33; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 33: - /* 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 = 33; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 33; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { - int grammarID = 143; - int done = 0; - - init_dinKeyValueType(dinKeyValueType); - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); - dinKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 144; - break; - case 1: - errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); - dinKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 144; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 144; - break; - case 3: - grammarID = 145; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 144: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - case 1: - grammarID = 144; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 145: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); - dinKeyValueType->DSAKeyValue_isUsed = 1u; - grammarID = 144; - break; - case 1: - errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); - dinKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 144; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 144; - break; - case 3: - grammarID = 145; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { - int grammarID = 146; - int done = 0; - - init_dinContractAuthenticationReqType(dinContractAuthenticationReqType); - - while(!done) { - switch(grammarID) { - case 146: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->Id.charactersLen); - if (errn == 0) { - errn = (dinContractAuthenticationReqType->Id.charactersLen - 2) <= dinContractAuthenticationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinContractAuthenticationReqType->Id.charactersLen >= 2) { - dinContractAuthenticationReqType->Id.charactersLen = (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinContractAuthenticationReqType->Id.charactersLen, dinContractAuthenticationReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinContractAuthenticationReqType->Id_isUsed = 1u; - grammarID = 147; - break; - case 1: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen); - if (errn == 0) { - errn = (dinContractAuthenticationReqType->GenChallenge.charactersLen - 2) <= dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) { - dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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 147: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen); - if (errn == 0) { - errn = (dinContractAuthenticationReqType->GenChallenge.charactersLen - 2) <= dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) { - dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { - int grammarID = 148; - int done = 0; - - init_dinServiceDiscoveryReqType(dinServiceDiscoveryReqType); - - while(!done) { - switch(grammarID) { - case 148: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinServiceDiscoveryReqType->ServiceScope.charactersLen); - if (errn == 0) { - errn = (dinServiceDiscoveryReqType->ServiceScope.charactersLen - 2) <= dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinServiceDiscoveryReqType->ServiceScope.charactersLen >= 2) { - dinServiceDiscoveryReqType->ServiceScope.charactersLen = (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.charactersLen, dinServiceDiscoveryReqType->ServiceScope.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinServiceDiscoveryReqType->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:2010:MsgBody}ServiceScope) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 149; - } 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); - dinServiceDiscoveryReqType->ServiceCategory = (dinserviceCategoryType) uint32; - dinServiceDiscoveryReqType->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:2010: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 149: - /* Element[START_ELEMENT({urn:iso:15118:2:2010: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); - dinServiceDiscoveryReqType->ServiceCategory = (dinserviceCategoryType) uint32; - dinServiceDiscoveryReqType->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:2010: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:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) { - int grammarID = 150; - int done = 0; - - init_dinServiceDetailReqType(dinServiceDetailReqType); - - while(!done) { - switch(grammarID) { - case 150: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinServiceDetailReqType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { - int grammarID = 151; - int done = 0; - - init_dinSignedInfoType(dinSignedInfoType); - - while(!done) { - switch(grammarID) { - case 151: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinSignedInfoType->Id.charactersLen); - if (errn == 0) { - errn = (dinSignedInfoType->Id.charactersLen - 2) <= dinSignedInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinSignedInfoType->Id.charactersLen >= 2) { - dinSignedInfoType->Id.charactersLen = (uint16_t)(dinSignedInfoType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignedInfoType->Id.charactersLen, dinSignedInfoType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinSignedInfoType->Id_isUsed = 1u; - grammarID = 152; - break; - case 1: - errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); - grammarID = 153; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 152: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod); - grammarID = 153; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 153: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod); - grammarID = 154; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 154: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 155; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 155: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 155; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { - int grammarID = 156; - int done = 0; - - init_dinMeteringReceiptReqType(dinMeteringReceiptReqType); - - while(!done) { - switch(grammarID) { - case 156: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->Id.charactersLen); - if (errn == 0) { - errn = (dinMeteringReceiptReqType->Id.charactersLen - 2) <= dinMeteringReceiptReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinMeteringReceiptReqType->Id.charactersLen >= 2) { - dinMeteringReceiptReqType->Id.charactersLen = (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinMeteringReceiptReqType->Id.charactersLen, dinMeteringReceiptReqType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinMeteringReceiptReqType->Id_isUsed = 1u; - grammarID = 157; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); - if (errn == 0) { - errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 158; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 157: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); - if (errn == 0) { - errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 158; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 158: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeteringReceiptReqType->SAScheduleTupleID); - dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 159; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { - int grammarID = 160; - int done = 0; - - init_dinX509IssuerSerialType(dinX509IssuerSerialType); - - while(!done) { - switch(grammarID) { - case 160: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinX509IssuerSerialType->X509IssuerName.charactersLen); - if (errn == 0) { - errn = (dinX509IssuerSerialType->X509IssuerName.charactersLen - 2) <= dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinX509IssuerSerialType->X509IssuerName.charactersLen >= 2) { - dinX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.charactersLen, dinX509IssuerSerialType->X509IssuerName.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinX509IssuerSerialType->X509SerialNumber); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType) { - int grammarID = 162; + int grammarID = 196; int done = 0; init_dinTransformsType(dinTransformsType); while(!done) { switch(grammarID) { - case 162: + case 196: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -7687,10 +9401,10 @@ static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsTyp case 0: if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); - } else { + } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 163; + grammarID = 197; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7698,7 +9412,7 @@ static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsTyp } } break; - case 163: + case 197: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7706,10 +9420,10 @@ static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsTyp case 0: if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); - } else { + } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 163; + grammarID = 197; break; case 1: done = 1; @@ -7734,14 +9448,14 @@ static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsTyp /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { - int grammarID = 164; + int grammarID = 198; int done = 0; init_dinParameterType(dinParameterType); while(!done) { switch(grammarID) { - case 164: + case 198: /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -7760,7 +9474,7 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 165; + grammarID = 199; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7768,7 +9482,7 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* } } break; - case 165: + case 199: /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -7776,7 +9490,7 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* case 0: errn = decodeNBitUnsignedInteger(stream, 3, &uint32); dinParameterType->ValueType = (dinvalueType) uint32; - grammarID = 166; + grammarID = 200; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7784,7 +9498,7 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* } } break; - case 166: + case 200: /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); if (errn == 0) { @@ -7949,2524 +9663,16 @@ static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { - int grammarID = 128; - int done = 0; - - init_dinIntervalType(dinIntervalType); - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { - int grammarID = 167; - int done = 0; - - init_dinRelativeTimeIntervalType(dinRelativeTimeIntervalType); - - while(!done) { - switch(grammarID) { - case 167: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->start); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:2010:MsgDataTypes}duration), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->duration); - dinRelativeTimeIntervalType->duration_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) { - int grammarID = 169; - int done = 0; - - init_dinKeyInfoType(dinKeyInfoType); - - while(!done) { - switch(grammarID) { - case 169: - /* 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, &dinKeyInfoType->Id.charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->Id.charactersLen - 2) <= dinKeyInfoType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->Id.charactersLen >= 2) { - dinKeyInfoType->Id.charactersLen = (uint16_t)(dinKeyInfoType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->Id.charactersLen, dinKeyInfoType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->Id_isUsed = 1u; - grammarID = 170; - break; - case 1: - if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 3: - if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 4: - if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 5: - if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 6: - if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 7: - if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } 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 = 171; - break; - case 9: - grammarID = 172; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 170: - /* 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 (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 2: - if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 3: - if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 4: - if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 5: - if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 6: - if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } 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 = 171; - break; - case 8: - grammarID = 172; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 171: - /* 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 (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 2: - if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 3: - if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 4: - if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 5: - if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 6: - if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } 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 = 171; - break; - case 8: - done = 1; - grammarID = 4; - break; - case 9: - grammarID = 171; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 172: - /* 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 (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2) <= dinKeyInfoType_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) { - dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) { - errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 2: - if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) { - errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 3: - if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) { - errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 4: - if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) { - errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 5: - if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) { - errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 171; - break; - case 6: - if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2) <= dinKeyInfoType_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) { - dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinKeyInfoType->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 = 171; - } 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 = 171; - break; - case 8: - grammarID = 172; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { - int grammarID = 173; - int done = 0; - - init_dinEntryType(dinEntryType); - - while(!done) { - switch(grammarID) { - case 173: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval); - dinEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinIntervalType(stream, &dinEntryType->TimeInterval); - dinEntryType->TimeInterval_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { - int grammarID = 128; - int done = 0; - - init_dinEVStatusType(dinEVStatusType); - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { - int grammarID = 128; - int done = 0; - - init_dinChargingStatusReqType(dinChargingStatusReqType); - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { - int grammarID = 174; - int done = 0; - - init_dinChargeParameterDiscoveryResType(dinChargeParameterDiscoveryResType); - - while(!done) { - switch(grammarID) { - case 174: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinChargeParameterDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 175; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 175: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinChargeParameterDiscoveryResType->EVSEProcessing = (dinEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 176; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 176: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList); - dinChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u; - grammarID = 177; - break; - case 1: - errn = decode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules); - dinChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; - grammarID = 177; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter); - dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter); - dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter); - dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) { - int grammarID = 178; - int done = 0; - - init_dinPMaxScheduleType(dinPMaxScheduleType); - - while(!done) { - switch(grammarID) { - case 178: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinPMaxScheduleType->PMaxScheduleID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 179; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 179: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinPMaxScheduleType->PMaxScheduleEntry.arrayLen < dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { - errn = decode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array[dinPMaxScheduleType->PMaxScheduleEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 180; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 180: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinPMaxScheduleType->PMaxScheduleEntry.arrayLen < dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) { - errn = decode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array[dinPMaxScheduleType->PMaxScheduleEntry.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; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { - int grammarID = 181; - int done = 0; - - init_dinDC_EVSEChargeParameterType(dinDC_EVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 181: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus); - grammarID = 182; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 182: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); - grammarID = 183; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 183: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); - dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 184; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); - grammarID = 185; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 184: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); - grammarID = 185; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 185: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); - grammarID = 186; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 186: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); - grammarID = 187; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 187: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); - dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; - grammarID = 188; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 189; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 188: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 189; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 189: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); - dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { - int grammarID = 190; - int done = 0; - - init_dinCableCheckResType(dinCableCheckResType); - - while(!done) { - switch(grammarID) { - case 190: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinCableCheckResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 191; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 191: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus); - grammarID = 35; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 35: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinCableCheckResType->EVSEProcessing = (dinEVSEProcessingType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) { - int grammarID = 192; - int done = 0; - - init_dinTransformType(dinTransformType); - - while(!done) { - switch(grammarID) { - case 192: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinTransformType->Algorithm.charactersLen); - if (errn == 0) { - errn = (dinTransformType->Algorithm.charactersLen - 2) <= dinTransformType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinTransformType->Algorithm.charactersLen >= 2) { - dinTransformType->Algorithm.charactersLen = (uint16_t)(dinTransformType->Algorithm.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinTransformType->Algorithm.charactersLen, dinTransformType->Algorithm.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 193; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 193: - /* 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 (dinTransformType->XPath.arrayLen < dinTransformType_XPath_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2) <= dinTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) { - dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinTransformType->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 = 194; - } 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 = 194; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 194; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 194: - /* 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 (dinTransformType->XPath.arrayLen < dinTransformType_XPath_ARRAY_SIZE) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2) <= dinTransformType_XPath_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) { - dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinTransformType->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 = 194; - } 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 = 194; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 194; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { - int grammarID = 195; - int done = 0; - - init_dinParameterSetType(dinParameterSetType); - - while(!done) { - switch(grammarID) { - case 195: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinParameterSetType->ParameterSetID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 196; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 196: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 197; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 197: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) { - errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 197; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { - int grammarID = 198; - int done = 0; - - init_dinSubCertificatesType(dinSubCertificatesType); - - while(!done) { - switch(grammarID) { - case 198: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); - } - dinSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 199; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 199: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen); - if (errn == 0) { - errn = (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes); - } - dinSubCertificatesType->Certificate.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 199; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { - int grammarID = 200; - int done = 0; - - init_dinDC_EVPowerDeliveryParameterType(dinDC_EVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { - case 200: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus); - grammarID = 201; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 201: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->BulkChargingComplete); - dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 202; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { - int grammarID = 203; - int done = 0; - - init_dinPaymentDetailsReqType(dinPaymentDetailsReqType); - - while(!done) { - switch(grammarID) { - case 203: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinPaymentDetailsReqType->ContractID.charactersLen); - if (errn == 0) { - errn = (dinPaymentDetailsReqType->ContractID.charactersLen - 2) <= dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinPaymentDetailsReqType->ContractID.charactersLen >= 2) { - dinPaymentDetailsReqType->ContractID.charactersLen = (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinPaymentDetailsReqType->ContractID.charactersLen, dinPaymentDetailsReqType->ContractID.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:2010:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { - int grammarID = 205; - int done = 0; - - init_dinDC_EVChargeParameterType(dinDC_EVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 205: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus); - grammarID = 206; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 206: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit); - grammarID = 207; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 207: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit); - dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 208; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 209; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 208: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 209; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 209: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity); - dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u; - grammarID = 210; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); - dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 211; - break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 212; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 210: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest); - dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 211; - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 212; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 211: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->FullSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 212; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 212: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); - dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0); - dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { - int grammarID = 213; - int done = 0; - - init_dinSelectedServiceListType(dinSelectedServiceListType); - - while(!done) { - switch(grammarID) { - case 213: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 214; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) { - errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 214; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { - int grammarID = 215; - int done = 0; - - init_dinServiceDiscoveryResType(dinServiceDiscoveryResType); - - while(!done) { - switch(grammarID) { - case 215: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinServiceDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:2010:MsgBody}PaymentOptions)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions); - grammarID = 217; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 217: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService); - grammarID = 218; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 218: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList); - dinServiceDiscoveryResType->ServiceList_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType) { - int grammarID = 219; + int grammarID = 201; int done = 0; init_dinPaymentDetailsResType(dinPaymentDetailsResType); while(!done) { switch(grammarID) { - case 219: + case 201: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -10487,7 +9693,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 220; + grammarID = 202; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10499,7 +9705,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen } } break; - case 220: + case 202: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -10531,7 +9737,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 221; + grammarID = 203; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -10543,7 +9749,7 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen } } break; - case 221: + case 203: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -10601,23 +9807,41 @@ static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { - int grammarID = 222; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { + int grammarID = 204; int done = 0; - init_dinServiceType(dinServiceType); + init_dinPowerDeliveryResType(dinPowerDeliveryResType); while(!done) { switch(grammarID) { - case 222: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + case 204: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_dinServiceTagType(stream, &dinServiceType->ServiceTag); - grammarID = 223; + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinPowerDeliveryResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 205; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -10625,8 +9849,162 @@ static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* din } } break; - case 223: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + case 205: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus); + dinPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus); + dinPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus); + dinPowerDeliveryResType->EVSEStatus_isUsed = 1u; + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { + int grammarID = 206; + int done = 0; + + init_dinCertificateChainType(dinCertificateChainType); + + while(!done) { + switch(grammarID) { + case 206: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010: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, &dinCertificateChainType->Certificate.bytesLen); + if (errn == 0) { + errn = (dinCertificateChainType->Certificate.bytesLen) <= dinCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateChainType->Certificate.bytesLen, dinCertificateChainType->Certificate.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 207; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 207: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates); + dinCertificateChainType->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:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { + int grammarID = 208; + int done = 0; + + init_dinDC_EVStatusType(dinDC_EVStatusType); + + while(!done) { + switch(grammarID) { + case 208: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -10635,14 +10013,212 @@ static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* din errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeBoolean(stream, &dinServiceType->FreeService); + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVReady); } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 209; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 209: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVCabinConditioning); + dinDC_EVStatusType->EVCabinConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 210; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); + dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 211; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 212; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 210: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning); + dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 211; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 212; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 211: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 212; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 212: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 7, &(uint32)); + dinDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -10683,21 +10259,75 @@ static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* din return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { - int grammarID = 128; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { + int grammarID = 213; int done = 0; - - init_dinEVPowerDeliveryParameterType(dinEVPowerDeliveryParameterType); - + + init_dinSelectedServiceType(dinSelectedServiceType); + while(!done) { switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ + case 213: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSelectedServiceType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 214; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 214: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinSelectedServiceType->ParameterSetID); + dinSelectedServiceType->ParameterSetID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: done = 1; grammarID = 4; break; @@ -10707,429 +10337,6 @@ static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct di } } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { - int grammarID = 128; - int done = 0; - - init_dinBodyBaseType(dinBodyBaseType); - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { - int grammarID = 224; - int done = 0; - - init_dinCurrentDemandReqType(dinCurrentDemandReqType); - - while(!done) { - switch(grammarID) { - case 224: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus); - grammarID = 225; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 225: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent); - grammarID = 226; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 226: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit); - dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u; - grammarID = 227; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); - dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 228; - break; - case 2: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); - dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 229; - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 230; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 231; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 227: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit); - dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 228; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); - dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 229; - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 230; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 231; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 228: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit); - dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 229; - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 230; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 231; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete); - dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 230; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 231; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 230: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 231; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 231: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC); - dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u; - grammarID = 232; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); - dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 233; - break; - case 2: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 232: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC); - dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 233; - break; - case 1: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 233: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); @@ -11156,37 +10363,103 @@ static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrent return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { - int grammarID = 234; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) { + int grammarID = 215; int done = 0; - - init_dinMeteringReceiptResType(dinMeteringReceiptResType); - + + init_dinServiceTagType(dinServiceTagType); + while(!done) { switch(grammarID) { - case 234: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + case 215: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010: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, &dinServiceTagType->ServiceName.charactersLen); + if (errn == 0) { + errn = (dinServiceTagType->ServiceName.charactersLen - 2) <= dinServiceTagType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinServiceTagType->ServiceName.charactersLen >= 2) { + dinServiceTagType->ServiceName.charactersLen = (uint16_t)(dinServiceTagType->ServiceName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinServiceTagType->ServiceName.charactersLen, dinServiceTagType->ServiceName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinServiceTagType->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:2010:MsgDataTypes}ServiceName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 217; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinMeteringReceiptResType->ResponseCode = (dinresponseCodeType) uint32; + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinServiceTagType->ServiceCategory = (dinserviceCategoryType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 89; + grammarID = 218; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11198,372 +10471,8 @@ static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeter } } break; - case 89: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { - int grammarID = 235; - int done = 0; - - init_dinPaymentOptionsType(dinPaymentOptionsType); - - while(!done) { - switch(grammarID) { - case 235: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; - dinPaymentOptionsType->PaymentOption.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 236; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &uint32); - dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32; - dinPaymentOptionsType->PaymentOption.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 236; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { - int grammarID = 237; - int done = 0; - - init_dinMessageHeaderType(dinMessageHeaderType); - - while(!done) { - switch(grammarID) { - case 237: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMessageHeaderType->SessionID.bytesLen); - if (errn == 0) { - errn = (dinMessageHeaderType->SessionID.bytesLen) <= dinMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMessageHeaderType->SessionID.bytesLen, dinMessageHeaderType->SessionID.bytes); - } - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 238; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 238: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinNotificationType(stream, &dinMessageHeaderType->Notification); - dinMessageHeaderType->Notification_isUsed = 1u; - grammarID = 239; - break; - case 1: - errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); - dinMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 239: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature); - dinMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { - int grammarID = 240; - int done = 0; - - init_dinAC_EVSEStatusType(dinAC_EVSEStatusType); - - while(!done) { - switch(grammarID) { - case 240: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinAC_EVSEStatusType->PowerSwitchClosed); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 241; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 241: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &dinAC_EVSEStatusType->RCD); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 106; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 106: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinAC_EVSEStatusType->NotificationMaxDelay); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 107; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 107: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -11573,17 +10482,17 @@ static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSESta if(errn == 0) { if(eventCode == 0) { errn = decodeNBitUnsignedInteger(stream, 2, &uint32); - dinAC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32; + dinServiceTagType->ServiceCategory = (dinserviceCategoryType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 218; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11595,102 +10504,8 @@ static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSESta } } break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { - int grammarID = 242; - int done = 0; - - init_dinSalesTariffType(dinSalesTariffType); - - while(!done) { - switch(grammarID) { - case 242: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->Id.charactersLen); - if (errn == 0) { - errn = (dinSalesTariffType->Id.charactersLen - 2) <= dinSalesTariffType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinSalesTariffType->Id.charactersLen >= 2) { - dinSalesTariffType->Id.charactersLen = (uint16_t)(dinSalesTariffType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSalesTariffType->Id.charactersLen, dinSalesTariffType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 243; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 243: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinSalesTariffType->SalesTariffID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 244; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 244: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ + case 218: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { @@ -11699,128 +10514,35 @@ static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffT errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->SalesTariffDescription.charactersLen); + errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceScope.charactersLen); if (errn == 0) { - errn = (dinSalesTariffType->SalesTariffDescription.charactersLen - 2) <= dinSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinServiceTagType->ServiceScope.charactersLen - 2) <= dinServiceTagType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (dinSalesTariffType->SalesTariffDescription.charactersLen >= 2) { - dinSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.charactersLen, dinSalesTariffType->SalesTariffDescription.characters); + if (dinServiceTagType->ServiceScope.charactersLen >= 2) { + dinServiceTagType->ServiceScope.charactersLen = (uint16_t)(dinServiceTagType->ServiceScope.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinServiceTagType->ServiceScope.charactersLen, dinServiceTagType->ServiceScope.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - dinSalesTariffType->SalesTariffDescription_isUsed = 1u; + dinServiceTagType->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:2010:MsgDataTypes}SalesTariffDescription) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 245; + grammarID = 3; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; - case 1: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 246; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 245: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 246; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 246: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 247; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 247: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) { - errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 247; - break; case 1: done = 1; grammarID = 4; @@ -11831,85 +10553,6 @@ static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffT } } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { - int grammarID = 248; - int done = 0; - - init_dinChargeParameterDiscoveryReqType(dinChargeParameterDiscoveryReqType); - - while(!done) { - switch(grammarID) { - case 248: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &uint32); - dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType = (dinEVRequestedEnergyTransferType) uint32; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter); - dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 1: - errn = decode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter); - dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - case 2: - errn = decode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter); - dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u; - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; case 3: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); @@ -11936,34 +10579,252 @@ static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { - int grammarID = 250; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { + int grammarID = 219; int done = 0; - - init_dinServicePaymentSelectionResType(dinServicePaymentSelectionResType); - + + init_dinContractAuthenticationReqType(dinContractAuthenticationReqType); + while(!done) { switch(grammarID) { - case 250: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + case 219: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->Id.charactersLen); + if (errn == 0) { + errn = (dinContractAuthenticationReqType->Id.charactersLen - 2) <= dinContractAuthenticationReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinContractAuthenticationReqType->Id.charactersLen >= 2) { + dinContractAuthenticationReqType->Id.charactersLen = (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinContractAuthenticationReqType->Id.charactersLen, dinContractAuthenticationReqType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinContractAuthenticationReqType->Id_isUsed = 1u; + grammarID = 220; + break; + case 1: + /* FirstStartTag[CHARACTERS[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &uint32); - dinServicePaymentSelectionResType->ResponseCode = (dinresponseCodeType) uint32; + errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen); + if (errn == 0) { + errn = (dinContractAuthenticationReqType->GenChallenge.charactersLen - 2) <= dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) { + dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 220: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen); + if (errn == 0) { + errn = (dinContractAuthenticationReqType->GenChallenge.charactersLen - 2) <= dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) { + dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinContractAuthenticationReqType->GenChallenge_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { + int grammarID = 221; + int done = 0; + + init_dinDC_EVPowerDeliveryParameterType(dinDC_EVPowerDeliveryParameterType); + + while(!done) { + switch(grammarID) { + case 221: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus); + grammarID = 222; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 222: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->BulkChargingComplete); + dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 223; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -12004,16 +10865,161 @@ static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { - int grammarID = 128; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { + int grammarID = 224; int done = 0; - init_dinEVSEStatusType(dinEVSEStatusType); + init_dinServiceDiscoveryReqType(dinServiceDiscoveryReqType); while(!done) { switch(grammarID) { - case 128: + case 224: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinServiceDiscoveryReqType->ServiceScope.charactersLen); + if (errn == 0) { + errn = (dinServiceDiscoveryReqType->ServiceScope.charactersLen - 2) <= dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinServiceDiscoveryReqType->ServiceScope.charactersLen >= 2) { + dinServiceDiscoveryReqType->ServiceScope.charactersLen = (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.charactersLen, dinServiceDiscoveryReqType->ServiceScope.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinServiceDiscoveryReqType->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:2010:MsgBody}ServiceScope) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 225; + } 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); + dinServiceDiscoveryReqType->ServiceCategory = (dinserviceCategoryType) uint32; + dinServiceDiscoveryReqType->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:2010: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 225: + /* Element[START_ELEMENT({urn:iso:15118:2:2010: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); + dinServiceDiscoveryReqType->ServiceCategory = (dinserviceCategoryType) uint32; + dinServiceDiscoveryReqType->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:2010: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:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { + int grammarID = 9; + int done = 0; + + init_dinSessionStopType(dinSessionStopType); + + while(!done) { + switch(grammarID) { + case 9: /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12039,236 +11045,16 @@ static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusTyp return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) { - int grammarID = 251; - int done = 0; - - init_dinManifestType(dinManifestType); - - while(!done) { - switch(grammarID) { - case 251: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinManifestType->Id.charactersLen); - if (errn == 0) { - errn = (dinManifestType->Id.charactersLen - 2) <= dinManifestType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinManifestType->Id.charactersLen >= 2) { - dinManifestType->Id.charactersLen = (uint16_t)(dinManifestType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinManifestType->Id.charactersLen, dinManifestType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinManifestType->Id_isUsed = 1u; - grammarID = 252; - break; - case 1: - if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 155; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 252: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 155; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 155: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) { - errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 155; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { - int grammarID = 253; - int done = 0; - - init_dinListOfRootCertificateIDsType(dinListOfRootCertificateIDsType); - - while(!done) { - switch(grammarID) { - case 253: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2) <= dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) { - dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 254; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 254: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen); - if (errn == 0) { - errn = (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2) <= dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) { - dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 254; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType) { - int grammarID = 255; + int grammarID = 226; int done = 0; - + init_dinServiceTagListType(dinServiceTagListType); - + while(!done) { switch(grammarID) { - case 255: + case 226: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12276,10 +11062,10 @@ static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTa case 0: if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); - } else { + } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 256; + grammarID = 227; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12287,7 +11073,7 @@ static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTa } } break; - case 256: + case 227: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12295,10 +11081,10 @@ static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTa case 0: if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); - } else { + } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 256; + grammarID = 227; break; case 1: done = 1; @@ -12321,42 +11107,37 @@ static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTa return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { - int grammarID = 257; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) { + int grammarID = 0; int done = 0; - init_dinRSAKeyValueType(dinRSAKeyValueType); + init_dinWeldingDetectionResType(dinWeldingDetectionResType); while(!done) { switch(grammarID) { - case 257: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + case 0: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Modulus.bytesLen); - if (errn == 0) { - errn = (dinRSAKeyValueType->Modulus.bytesLen) <= dinRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinRSAKeyValueType->Modulus.bytesLen, dinRSAKeyValueType->Modulus.bytes); - } + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinWeldingDetectionResType->ResponseCode = (dinresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 258; + grammarID = 1; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12368,22 +11149,475 @@ static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueT } } break; - case 258: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + case 1: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus); + grammarID = 2; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 2: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ +static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { + int grammarID = 228; + int done = 0; + + init_dinAnonType_V2G_Message(dinAnonType_V2G_Message); + + while(!done) { + switch(grammarID) { + case 228: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header); + grammarID = 229; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 229: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinBodyType(stream, &dinAnonType_V2G_Message->Body); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { + int grammarID = 230; + int done = 0; + + init_dinDC_EVSEChargeParameterType(dinDC_EVSEChargeParameterType); + + while(!done) { + switch(grammarID) { + case 230: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus); + grammarID = 231; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit); + grammarID = 232; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 232: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit); + dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 1u; + grammarID = 233; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); + grammarID = 234; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 233: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit); + grammarID = 234; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 234: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit); + grammarID = 235; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 235: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit); + grammarID = 236; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 236: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); + dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; + grammarID = 237; + break; + case 1: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 238; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 237: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 238; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 238: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered); + dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ +static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { + int grammarID = 239; + int done = 0; + + init_dinSalesTariffEntryType(dinSalesTariffEntryType); + + while(!done) { + switch(grammarID) { + case 239: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval); + dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; + grammarID = 240; + break; + case 1: + errn = decode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval); + dinSalesTariffEntryType->TimeInterval_isUsed = 1u; + grammarID = 240; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 240: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Exponent.bytesLen); + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 241; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 241: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSalesTariffEntryType->ConsumptionCost.arrayLen < dinSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { + errn = decode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array[dinSalesTariffEntryType->ConsumptionCost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 241; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { + int grammarID = 9; + int done = 0; + + init_dinEVChargeParameterType(dinEVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { + int grammarID = 242; + int done = 0; + + init_dinPaymentDetailsReqType(dinPaymentDetailsReqType); + + while(!done) { + switch(grammarID) { + case 242: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinPaymentDetailsReqType->ContractID.charactersLen); if (errn == 0) { - errn = (dinRSAKeyValueType->Exponent.bytesLen) <= dinRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + errn = (dinPaymentDetailsReqType->ContractID.charactersLen - 2) <= dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - errn = decodeBytes(stream, dinRSAKeyValueType->Exponent.bytesLen, dinRSAKeyValueType->Exponent.bytes); + if (dinPaymentDetailsReqType->ContractID.charactersLen >= 2) { + dinPaymentDetailsReqType->ContractID.charactersLen = (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinPaymentDetailsReqType->ContractID.charactersLen, dinPaymentDetailsReqType->ContractID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -12391,7 +11625,95 @@ static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueT } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 243; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 243: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { + int grammarID = 244; + int done = 0; + + init_dinSessionSetupReqType(dinSessionSetupReqType); + + while(!done) { + switch(grammarID) { + case 244: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinSessionSetupReqType->EVCCID.bytesLen); + if (errn == 0) { + errn = (dinSessionSetupReqType->EVCCID.bytesLen) <= dinSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinSessionSetupReqType->EVCCID.bytesLen, dinSessionSetupReqType->EVCCID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -12432,16 +11754,16 @@ static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueT return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { - int grammarID = 128; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { + int grammarID = 9; int done = 0; - init_dinEVSEChargeParameterType(dinEVSEChargeParameterType); + init_dinChargingStatusReqType(dinChargingStatusReqType); while(!done) { switch(grammarID) { - case 128: + case 9: /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12467,44 +11789,52 @@ static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSE return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) { - int grammarID = 259; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { + int grammarID = 245; int done = 0; - init_dinSignaturePropertiesType(dinSignaturePropertiesType); + init_dinSignaturePropertyType(dinSignaturePropertyType); while(!done) { switch(grammarID) { - case 259: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + case 245: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinSignaturePropertiesType->Id.charactersLen); + errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Id.charactersLen); if (errn == 0) { - errn = (dinSignaturePropertiesType->Id.charactersLen - 2) <= dinSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinSignaturePropertyType->Id.charactersLen - 2) <= dinSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (dinSignaturePropertiesType->Id.charactersLen >= 2) { - dinSignaturePropertiesType->Id.charactersLen = (uint16_t)(dinSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignaturePropertiesType->Id.charactersLen, dinSignaturePropertiesType->Id.characters); + if (dinSignaturePropertyType->Id.charactersLen >= 2) { + dinSignaturePropertyType->Id.charactersLen = (uint16_t)(dinSignaturePropertyType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignaturePropertyType->Id.charactersLen, dinSignaturePropertyType->Id.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - dinSignaturePropertiesType->Id_isUsed = 1u; - grammarID = 260; + dinSignaturePropertyType->Id_isUsed = 1u; + grammarID = 246; break; case 1: - if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (dinSignaturePropertyType->Target.charactersLen - 2) <= dinSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - grammarID = 261; + if (errn == 0) { + if (dinSignaturePropertyType->Target.charactersLen >= 2) { + dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 247; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12512,18 +11842,26 @@ static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign } } break; - case 260: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + case 246: + /* StartTag[ATTRIBUTE[STRING](Target)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; + errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen); + if (errn == 0) { + errn = (dinSignaturePropertyType->Target.charactersLen - 2) <= dinSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - grammarID = 261; + if (errn == 0) { + if (dinSignaturePropertyType->Target.charactersLen >= 2) { + dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 247; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12531,20 +11869,440 @@ static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign } } break; - case 261: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + case 247: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { - errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 261; + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; break; case 1: + grammarID = 248; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 248: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 1: + grammarID = 248; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ +static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { + int grammarID = 249; + int done = 0; + + init_dinCertificateUpdateResType(dinCertificateUpdateResType); + + while(!done) { + switch(grammarID) { + case 249: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->Id.charactersLen); + if (errn == 0) { + errn = (dinCertificateUpdateResType->Id.charactersLen - 2) <= dinCertificateUpdateResType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinCertificateUpdateResType->Id.charactersLen >= 2) { + dinCertificateUpdateResType->Id.charactersLen = (uint16_t)(dinCertificateUpdateResType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCertificateUpdateResType->Id.charactersLen, dinCertificateUpdateResType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 250; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 250: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinCertificateUpdateResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 251; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 251: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain); + grammarID = 252; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 252: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); + if (errn == 0) { + errn = (dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 253; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 253: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->DHParams.bytesLen); + if (errn == 0) { + errn = (dinCertificateUpdateResType->DHParams.bytesLen) <= dinCertificateUpdateResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateUpdateResType->DHParams.bytesLen, dinCertificateUpdateResType->DHParams.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 254; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 254: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractID.charactersLen); + if (errn == 0) { + errn = (dinCertificateUpdateResType->ContractID.charactersLen - 2) <= dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinCertificateUpdateResType->ContractID.charactersLen >= 2) { + dinCertificateUpdateResType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCertificateUpdateResType->ContractID.charactersLen, dinCertificateUpdateResType->ContractID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 255; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 255: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinCertificateUpdateResType->RetryCounter); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { + int grammarID = 256; + int done = 0; + + init_dinServiceDetailResType(dinServiceDetailResType); + + while(!done) { + switch(grammarID) { + case 256: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinServiceDetailResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 257; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 257: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinServiceDetailResType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 258; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 258: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList); + dinServiceDetailResType->ServiceParameterList_isUsed = 1u; + grammarID = 3; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: done = 1; grammarID = 4; break; @@ -12567,14 +12325,14 @@ static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType) { - int grammarID = 262; + int grammarID = 259; int done = 0; - + init_dinDSAKeyValueType(dinDSAKeyValueType); - + while(!done) { switch(grammarID) { - case 262: + case 259: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12601,7 +12359,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 263; + grammarID = 260; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12629,7 +12387,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 264; + grammarID = 261; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12656,7 +12414,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 265; + grammarID = 262; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12668,7 +12426,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT } } break; - case 263: + case 260: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12695,7 +12453,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 266; + grammarID = 263; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12707,7 +12465,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT } } break; - case 266: + case 263: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12734,7 +12492,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 264; + grammarID = 261; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12761,7 +12519,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 265; + grammarID = 262; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12773,7 +12531,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT } } break; - case 264: + case 261: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12799,7 +12557,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 265; + grammarID = 262; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12811,7 +12569,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT } } break; - case 265: + case 262: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12838,7 +12596,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 267; + grammarID = 264; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12866,7 +12624,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 268; + grammarID = 265; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12882,7 +12640,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT } } break; - case 267: + case 264: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12909,7 +12667,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 268; + grammarID = 265; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12925,7 +12683,7 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT } } break; - case 268: + case 265: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12990,36 +12748,651 @@ static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ -static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { - int grammarID = 269; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ +static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { + int grammarID = 266; int done = 0; - - init_dinProfileEntryType(dinProfileEntryType); - + + init_dinAC_EVSEChargeParameterType(dinAC_EVSEChargeParameterType); + while(!done) { switch(grammarID) { - case 269: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ + case 266: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus); + grammarID = 267; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 267: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage); + grammarID = 268; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 268: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent); + grammarID = 269; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 269: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { + int grammarID = 270; + int done = 0; + + init_dinObjectType(dinObjectType); + + while(!done) { + switch(grammarID) { + case 270: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinObjectType->Encoding.charactersLen); + if (errn == 0) { + errn = (dinObjectType->Encoding.charactersLen - 2) <= dinObjectType_Encoding_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinObjectType->Encoding.charactersLen >= 2) { + dinObjectType->Encoding.charactersLen = (uint16_t)(dinObjectType->Encoding.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinObjectType->Encoding.charactersLen, dinObjectType->Encoding.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->Encoding_isUsed = 1u; + grammarID = 271; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen); + if (errn == 0) { + errn = (dinObjectType->Id.charactersLen - 2) <= dinObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinObjectType->Id.charactersLen >= 2) { + dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->Id_isUsed = 1u; + grammarID = 272; + break; + case 2: + errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinObjectType->MimeType.charactersLen >= 2) { + dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->MimeType_isUsed = 1u; + grammarID = 139; + break; + case 3: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 4: + done = 1; + grammarID = 4; + break; + case 5: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 271: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen); + if (errn == 0) { + errn = (dinObjectType->Id.charactersLen - 2) <= dinObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinObjectType->Id.charactersLen >= 2) { + dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->Id_isUsed = 1u; + grammarID = 272; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinObjectType->MimeType.charactersLen >= 2) { + dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->MimeType_isUsed = 1u; + grammarID = 139; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 3: + done = 1; + grammarID = 4; + break; + case 4: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 272: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen); + if (errn == 0) { + errn = (dinObjectType->MimeType.charactersLen - 2) <= dinObjectType_MimeType_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinObjectType->MimeType.charactersLen >= 2) { + dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinObjectType->MimeType_isUsed = 1u; + grammarID = 139; + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 2: + done = 1; + grammarID = 4; + break; + case 3: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 139: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { + int grammarID = 273; + int done = 0; + + init_dinKeyValueType(dinKeyValueType); + + while(!done) { + switch(grammarID) { + case 273: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); + dinKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 274; + break; + case 1: + errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); + dinKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 274; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 274; + break; + case 3: + grammarID = 275; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 274: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + case 1: + grammarID = 274; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 275: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue); + dinKeyValueType->DSAKeyValue_isUsed = 1u; + grammarID = 274; + break; + case 1: + errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue); + dinKeyValueType->RSAKeyValue_isUsed = 1u; + grammarID = 274; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 274; + break; + case 3: + grammarID = 275; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { + int grammarID = 9; + int done = 0; + + init_dinEVPowerDeliveryParameterType(dinEVPowerDeliveryParameterType); + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) { + int grammarID = 138; + int done = 0; + + init_dinDigestMethodType(dinDigestMethodType); + + while(!done) { + switch(grammarID) { + case 138: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinDigestMethodType->Algorithm.charactersLen); + if (errn == 0) { + errn = (dinDigestMethodType->Algorithm.charactersLen - 2) <= dinDigestMethodType_Algorithm_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinDigestMethodType->Algorithm.charactersLen >= 2) { + dinDigestMethodType->Algorithm.charactersLen = (uint16_t)(dinDigestMethodType->Algorithm.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinDigestMethodType->Algorithm.charactersLen, dinDigestMethodType->Algorithm.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 139; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 139: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 45; + break; + case 1: + done = 1; + grammarID = 4; + break; + case 2: + grammarID = 45; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { + int grammarID = 276; + int done = 0; + + init_dinCertificateUpdateReqType(dinCertificateUpdateReqType); + + while(!done) { + switch(grammarID) { + case 276: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->Id.charactersLen); + if (errn == 0) { + errn = (dinCertificateUpdateReqType->Id.charactersLen - 2) <= dinCertificateUpdateReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinCertificateUpdateReqType->Id.charactersLen >= 2) { + dinCertificateUpdateReqType->Id.charactersLen = (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCertificateUpdateReqType->Id.charactersLen, dinCertificateUpdateReqType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinCertificateUpdateReqType->Id_isUsed = 1u; + grammarID = 277; + break; + case 1: + errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain); + grammarID = 278; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 277: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain); + grammarID = 278; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 278: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &dinProfileEntryType->ChargingProfileEntryStart); + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->ContractID.charactersLen); + if (errn == 0) { + errn = (dinCertificateUpdateReqType->ContractID.charactersLen - 2) <= dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinCertificateUpdateReqType->ContractID.charactersLen >= 2) { + dinCertificateUpdateReqType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinCertificateUpdateReqType->ContractID.charactersLen, dinCertificateUpdateReqType->ContractID.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 270; + grammarID = 41; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13031,24 +13404,45 @@ static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntr } } break; - case 270: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + case 41: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs); + grammarID = 42; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 42: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeInteger16(stream, &dinProfileEntryType->ChargingProfileEntryMaxPower); + errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->DHParams.bytesLen); + if (errn == 0) { + errn = (dinCertificateUpdateReqType->DHParams.bytesLen) <= dinCertificateUpdateReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytesLen, dinCertificateUpdateReqType->DHParams.bytes); + } } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -13089,45 +13483,137 @@ static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntr return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { - int grammarID = 271; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { + int grammarID = 279; int done = 0; - - init_dinSignatureValueType(dinSignatureValueType); - + + init_dinMeteringReceiptReqType(dinMeteringReceiptReqType); + while(!done) { switch(grammarID) { - case 271: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + case 279: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->Id.charactersLen); + errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->Id.charactersLen); if (errn == 0) { - errn = (dinSignatureValueType->Id.charactersLen - 2) <= dinSignatureValueType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinMeteringReceiptReqType->Id.charactersLen - 2) <= dinMeteringReceiptReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (dinSignatureValueType->Id.charactersLen >= 2) { - dinSignatureValueType->Id.charactersLen = (uint16_t)(dinSignatureValueType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignatureValueType->Id.charactersLen, dinSignatureValueType->Id.characters); + if (dinMeteringReceiptReqType->Id.charactersLen >= 2) { + dinMeteringReceiptReqType->Id.charactersLen = (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinMeteringReceiptReqType->Id.charactersLen, dinMeteringReceiptReqType->Id.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - dinSignatureValueType->Id_isUsed = 1u; - grammarID = 272; + dinMeteringReceiptReqType->Id_isUsed = 1u; + grammarID = 280; break; case 1: - errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); + if (errn == 0) { + errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } } - if (errn == 0) { - errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 281; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 280: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen); + if (errn == 0) { + errn = (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 281; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 281: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinMeteringReceiptReqType->SAScheduleTupleID); + dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 282; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); grammarID = 3; break; default: @@ -13136,19 +13622,13 @@ static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignature } } break; - case 272: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ + case 282: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen); - if (errn == 0) { - errn = (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes); - } + errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo); grammarID = 3; break; default: @@ -13183,16 +13663,91 @@ static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignature return errn; } +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { + int grammarID = 283; + int done = 0; + + init_dinConsumptionCostType(dinConsumptionCostType); + + while(!done) { + switch(grammarID) { + case 283: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinConsumptionCostType->startValue); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 284; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 284: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinConsumptionCostType->Cost.arrayLen < dinConsumptionCostType_Cost_ARRAY_SIZE) { + errn = decode_dinCostType(stream, &dinConsumptionCostType->Cost.array[dinConsumptionCostType->Cost.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 284; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType) { - int grammarID = 250; + int grammarID = 50; int done = 0; init_dinSessionStopResType(dinSessionStopResType); while(!done) { switch(grammarID) { - case 250: + case 50: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13251,18 +13806,149 @@ static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionSt return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ -static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { - int grammarID = 273; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) { + int grammarID = 285; int done = 0; - init_dinMeterInfoType(dinMeterInfoType); + init_dinSignaturePropertiesType(dinSignaturePropertiesType); while(!done) { switch(grammarID) { - case 273: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ + case 285: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinSignaturePropertiesType->Id.charactersLen); + if (errn == 0) { + errn = (dinSignaturePropertiesType->Id.charactersLen - 2) <= dinSignaturePropertiesType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinSignaturePropertiesType->Id.charactersLen >= 2) { + dinSignaturePropertiesType->Id.charactersLen = (uint16_t)(dinSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinSignaturePropertiesType->Id.charactersLen, dinSignaturePropertiesType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinSignaturePropertiesType->Id_isUsed = 1u; + grammarID = 286; + break; + case 1: + if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 287; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 286: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 287; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 287: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) { + errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 287; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ +static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) { + int grammarID = 288; + int done = 0; + + init_dinNotificationType(dinNotificationType); + + while(!done) { + switch(grammarID) { + case 288: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinNotificationType->FaultCode = (dinfaultCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 289; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 289: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: @@ -13270,297 +13956,27 @@ static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->MeterID.charactersLen); + errn = decodeUnsignedInteger16(stream, &dinNotificationType->FaultMsg.charactersLen); if (errn == 0) { - errn = (dinMeterInfoType->MeterID.charactersLen - 2) <= dinMeterInfoType_MeterID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + errn = (dinNotificationType->FaultMsg.charactersLen - 2) <= dinNotificationType_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } if (errn == 0) { - if (dinMeterInfoType->MeterID.charactersLen >= 2) { - dinMeterInfoType->MeterID.charactersLen = (uint16_t)(dinMeterInfoType->MeterID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinMeterInfoType->MeterID.charactersLen, dinMeterInfoType->MeterID.characters); + if (dinNotificationType->FaultMsg.charactersLen >= 2) { + dinNotificationType->FaultMsg.charactersLen = (uint16_t)(dinNotificationType->FaultMsg.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinNotificationType->FaultMsg.charactersLen, dinNotificationType->FaultMsg.characters); } else { /* string table hit */ errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } + dinNotificationType->FaultMsg_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 274; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 274: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading); - dinMeterInfoType->MeterReading_isUsed = 1u; - grammarID = 275; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); - if (errn == 0) { - errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); - } - dinMeterInfoType->SigMeterReading_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 276; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); - dinMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 277; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 275: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen); - if (errn == 0) { - errn = (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes); - } - dinMeterInfoType->SigMeterReading_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 276; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); - dinMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 277; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 276: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus); - dinMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 277; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 277: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &dinMeterInfoType->TMeter); - dinMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 3; @@ -13605,430 +14021,13 @@ static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ -static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { - int grammarID = 278; - int done = 0; - - init_dinSalesTariffEntryType(dinSalesTariffEntryType); - - while(!done) { - switch(grammarID) { - case 278: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval); - dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 279; - break; - case 1: - errn = decode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval); - dinSalesTariffEntryType->TimeInterval_isUsed = 1u; - grammarID = 279; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 279: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - dinSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSalesTariffEntryType->ConsumptionCost.arrayLen < dinSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) { - errn = decode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array[dinSalesTariffEntryType->ConsumptionCost.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 280; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { - int grammarID = 128; - int done = 0; - - init_dinSessionStopType(dinSessionStopType); - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { - int grammarID = 281; - int done = 0; - - init_dinSignaturePropertyType(dinSignaturePropertyType); - - while(!done) { - switch(grammarID) { - case 281: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Id.charactersLen); - if (errn == 0) { - errn = (dinSignaturePropertyType->Id.charactersLen - 2) <= dinSignaturePropertyType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinSignaturePropertyType->Id.charactersLen >= 2) { - dinSignaturePropertyType->Id.charactersLen = (uint16_t)(dinSignaturePropertyType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignaturePropertyType->Id.charactersLen, dinSignaturePropertyType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinSignaturePropertyType->Id_isUsed = 1u; - grammarID = 282; - break; - case 1: - errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen); - if (errn == 0) { - errn = (dinSignaturePropertyType->Target.charactersLen - 2) <= dinSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinSignaturePropertyType->Target.charactersLen >= 2) { - dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 283; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 282: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen); - if (errn == 0) { - errn = (dinSignaturePropertyType->Target.charactersLen - 2) <= dinSignaturePropertyType_Target_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinSignaturePropertyType->Target.charactersLen >= 2) { - dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - grammarID = 283; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 283: - /* 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 = 33; - break; - case 1: - grammarID = 284; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 33: - /* 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 = 33; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 33; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 284: - /* 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 = 33; - break; - case 1: - grammarID = 284; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { - int grammarID = 285; - int done = 0; - - init_dinSignatureType(dinSignatureType); - - while(!done) { - switch(grammarID) { - case 285: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decodeUnsignedInteger16(stream, &dinSignatureType->Id.charactersLen); - if (errn == 0) { - errn = (dinSignatureType->Id.charactersLen - 2) <= dinSignatureType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (dinSignatureType->Id.charactersLen >= 2) { - dinSignatureType->Id.charactersLen = (uint16_t)(dinSignatureType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, dinSignatureType->Id.charactersLen, dinSignatureType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - dinSignatureType->Id_isUsed = 1u; - grammarID = 286; - break; - case 1: - errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); - grammarID = 287; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 286: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo); - grammarID = 287; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 287: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue); - grammarID = 288; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 288: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo); - dinSignatureType->KeyInfo_isUsed = 1u; - grammarID = 289; - break; - case 1: - if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { - errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 289; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 289: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) { - errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 289; - 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_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { - errn = readEXIHeader(stream); - - if(errn == 0) { + + + +int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { + errn = readEXIHeader(stream); + + if(errn == 0) { /* DocContent[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010: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:2010:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2010: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:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT_GENERIC] */ init_dinEXIDocument(exiDoc); errn = decodeNBitUnsignedInteger(stream, 7, &eventCode); @@ -14501,13 +14500,13 @@ int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { break; } } - - } - - return errn; -} - -#endif /* DEPLOY_DIN_CODEC */ - -#endif - + + } + + return errn; +} + +#endif /* DEPLOY_DIN_CODEC */ + +#endif + diff --git a/src/din/dinEXIDatatypesDecoder.h b/src/din/dinEXIDatatypesDecoder.h index fccc613..54f3ba9 100644 --- a/src/din/dinEXIDatatypesDecoder.h +++ b/src/din/dinEXIDatatypesDecoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -41,19 +41,17 @@ #ifdef __cplusplus extern "C" { #endif - - -#include "dinEXIDatatypes.h" - -#if DEPLOY_DIN_CODEC == SUPPORT_YES + +#if DEPLOY_DIN_CODEC == SUPPORT_YES #includeCode generated by EXIdizer
@@ -27,133 +27,132 @@ * ********************************************************************/ - - - -#include "dinEXIDatatypesEncoder.h" - -#include "EncoderChannel.h" -#include "EXIHeaderEncoder.h" - -#include "dinEXIDatatypes.h" -#include "ErrorCodes.h" - -#ifndef EXI_din_DATATYPES_ENCODER_C -#define EXI_din_DATATYPES_ENCODER_C - -#if DEPLOY_DIN_CODEC == SUPPORT_YES - -static int errn; - + + + +#include "dinEXIDatatypesEncoder.h" + +#include "EncoderChannel.h" +#include "EXIHeaderEncoder.h" + +#include "dinEXIDatatypes.h" +#include "ErrorCodes.h" + +#ifndef EXI_din_DATATYPES_ENCODER_C +#define EXI_din_DATATYPES_ENCODER_C + +#if DEPLOY_DIN_CODEC == SUPPORT_YES + +static int errn; + /* Forward Declarations */ -static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); -static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); -static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); -static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); -static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); -static int encode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType); -static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); -static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); -static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); -static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); -static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); -static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); -static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); -static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); -static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); -static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); -static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); -static int encode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType); -static int encode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType); -static int encode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType); -static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType); -static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); -static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); -static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); -static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); -static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); -static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); -static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); -static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); -static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); -static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); -static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); -static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); -static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); -static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); -static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); -static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType); -static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); -static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); -static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); -static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); -static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); -static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); -static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); -static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); -static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); -static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); -static int encode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType); -static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); -static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); static int encode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType); -static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); -static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); -static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); -static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); -static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); +static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); +static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType); +static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType); +static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); +static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType); +static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); +static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType); +static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); +static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); +static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); +static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); +static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType); static int encode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType); -static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); -static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); -static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); -static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); -static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); +static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); +static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType); +static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); static int encode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); -static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); -static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType); static int encode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); -static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); +static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); +static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType); static int encode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType); static int encode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType); -static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); -static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); -static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); -static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType); -static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); -static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); -static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType); -static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); -static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType); -static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); -static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); -static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); -static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType); -static int encode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); -static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); -static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); -static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType); -static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); +static int encode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); +static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType); +static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); +static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType); +static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); +static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); +static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType); +static int encode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType); +static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType); +static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType); +static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType); +static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType); +static int encode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType); +static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); +static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType); +static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType); +static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); +static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType); static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); -static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); -static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType); -static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); -static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); -static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); -static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType); -static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); -static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType); -static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType); -static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); -static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); -static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); +static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); +static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); +static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType); +static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType); +static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType); +static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType); static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); +static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType); +static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType); +static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType); +static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType); +static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); +static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType); +static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType); +static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType); +static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType); +static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType); +static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType); +static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); +static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); +static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType); +static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType); +static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType); +static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType); +static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType); +static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType); +static int encode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType); +static int encode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType); +static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType); +static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); +static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); +static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType); +static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType); +static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType); +static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); +static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType); +static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType); +static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); +static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType); +static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType); +static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType); +static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType); +static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType); +static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType); +static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); +static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType); +static int encode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType); +static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); +static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType); +static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); +static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); +static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType); +static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType); +static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType); +static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType); - - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ -static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { + + /* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { int grammarID = 0; int done = 0; @@ -161,11 +160,17 @@ static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeRe while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus ); + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinPreChargeResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } grammarID = 1; } else { @@ -173,11 +178,11 @@ static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeRe } break; case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage ); + errn = encode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus ); } grammarID = 2; } else { @@ -185,11 +190,11 @@ static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeRe } break; case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent ); + errn = encode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage ); } grammarID = 3; } else { @@ -219,8 +224,8 @@ static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeRe return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) { +/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { int grammarID = 5; int done = 0; @@ -228,14 +233,17 @@ static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificatio while(!done) { switch(grammarID) { case 5: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinNotificationType->FaultCode); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMessageHeaderType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMessageHeaderType->SessionID.bytes, dinMessageHeaderType->SessionID.bytesLen); + } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -246,22 +254,325 @@ static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificatio } break; case 6: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ - if ( dinNotificationType->FaultMsg_isUsed == 1u ) { + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( dinMessageHeaderType->Notification_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encode_dinNotificationType(stream, &dinMessageHeaderType->Notification ); + } + grammarID = 7; + } else if ( dinMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 7: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ + if ( dinMessageHeaderType->Signature_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +static int encode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) { + int grammarID = 8; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 8: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinNotificationType->FaultMsg.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, dinServiceDetailReqType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { + int grammarID = 9; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { + int grammarID = 10; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 10: + /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( dinRetrievalMethodType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinRetrievalMethodType->Type.characters, dinRetrievalMethodType->Type.charactersLen); + } + } + grammarID = 11; + } else if ( dinRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 12; + } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 11: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( dinRetrievalMethodType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); + } + } + grammarID = 12; + } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 12: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ + if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { + int grammarID = 13; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 13: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinSessionSetupResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 14; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 14: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupResType->EVSEID.bytesLen)); if (errn == 0) { - errn = encodeCharacters(stream, dinNotificationType->FaultMsg.characters, dinNotificationType->FaultMsg.charactersLen); + errn = encodeBytes(stream, dinSessionSetupResType->EVSEID.bytes, dinSessionSetupResType->EVSEID.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } + grammarID = 15; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 15: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ + if ( dinSessionSetupResType->DateTimeNow_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinSessionSetupResType->DateTimeNow); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } grammarID = 3; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); @@ -296,97 +607,417 @@ static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificatio return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) { - int grammarID = 7; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { + int grammarID = 16; int done = 0; while(!done) { switch(grammarID) { - case 7: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ + case 16: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinServiceTagType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 8; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 8: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ - if ( dinServiceTagType->ServiceName_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceName.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Modulus.bytesLen)); if (errn == 0) { - errn = encodeCharacters(stream, dinServiceTagType->ServiceName.characters, dinServiceTagType->ServiceName.charactersLen); + errn = encodeBytes(stream, dinRSAKeyValueType->Modulus.bytes, dinRSAKeyValueType->Modulus.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 9; + grammarID = 17; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 17: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Exponent.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinRSAKeyValueType->Exponent.bytes, dinRSAKeyValueType->Exponent.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { + int grammarID = 18; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 18: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateInstallationResType->Id.characters, dinCertificateInstallationResType->Id.charactersLen); + } + } + grammarID = 19; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 19: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateInstallationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 20; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 20: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain ); + } + grammarID = 21; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 21: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 22; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 22: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationResType->DHParams.bytes, dinCertificateInstallationResType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 23; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 23: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateInstallationResType->ContractID.characters, dinCertificateInstallationResType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { + int grammarID = 24; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 24: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus ); + } + grammarID = 25; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 25: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit ); + } + grammarID = 26; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 26: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ + if ( dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit ); + } + grammarID = 27; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); } - grammarID = 10; + grammarID = 28; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ + case 27: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); } - grammarID = 10; + grammarID = 28; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 10: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */ - if ( dinServiceTagType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + case 28: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity ); + } + grammarID = 29; + } else if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 30; + } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinServiceTagType->ServiceScope.characters, dinServiceTagType->ServiceScope.charactersLen); - } + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 31; + } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 29: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); + } + grammarID = 30; + } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 31; + } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 30: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 31; + } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 31: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ + if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -425,15 +1056,1804 @@ static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagTyp return errn; } +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) { + int grammarID = 32; + int done = 0; + + unsigned int dinSPKIDataType_SPKISexp_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 32: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + dinSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 33; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 33: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + dinSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 33; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 34; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 34: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ + if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); + dinSPKIDataType_SPKISexp_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 33; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { + int grammarID = 35; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 35: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 36; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 36: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ + if ( dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter ); + } + grammarID = 3; + } else if ( dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter ); + } + grammarID = 3; + } else if ( dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { + int grammarID = 9; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ +static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { + int grammarID = 37; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 37: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinProfileEntryType->ChargingProfileEntryStart); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 38; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 38: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinProfileEntryType->ChargingProfileEntryMaxPower); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { + int grammarID = 39; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 39: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + if ( dinCertificateInstallationReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateInstallationReqType->Id.characters, dinCertificateInstallationReqType->Id.charactersLen); + } + } + grammarID = 40; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 41; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 40: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 41; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 41: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs ); + } + grammarID = 42; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 42: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytes, dinCertificateInstallationReqType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { + int grammarID = 43; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 43: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignatureMethodType->Algorithm.characters, dinSignatureMethodType->Algorithm.charactersLen); + } + } + grammarID = 44; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 44: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 45; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 46; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 46: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 45; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 46; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { + int grammarID = 9; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { + int grammarID = 47; + int done = 0; + + unsigned int dinSelectedServiceListType_SelectedService_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 47: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ + if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 48; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 48: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ + if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); + } + grammarID = 48; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { + int grammarID = 49; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 49: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { + int grammarID = 50; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 50: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinServicePaymentSelectionResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ +static int encode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { + int grammarID = 51; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 51: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinChargeParameterDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 52; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 52: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinChargeParameterDiscoveryResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 53; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ + if ( dinChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList ); + } + grammarID = 54; + } else if ( dinChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules ); + } + grammarID = 54; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 54: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ + if ( dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); + } + grammarID = 3; + } else if ( dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); + } + grammarID = 3; + } else if ( dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { + int grammarID = 55; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 55: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.characters, dinX509IssuerSerialType->X509IssuerName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 56; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 56: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinX509IssuerSerialType->X509SerialNumber); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { + int grammarID = 57; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 57: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinCableCheckResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 58; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 58: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus ); + } + grammarID = 59; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 59: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinCableCheckResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { + int grammarID = 60; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 60: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->MeterID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinMeterInfoType->MeterID.characters, dinMeterInfoType->MeterID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 61; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 61: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->MeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading ); + } + grammarID = 62; + } else if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 63; + } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 62: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 63; + } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 63: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 64; + } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 64: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ + if ( dinMeterInfoType->TMeter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinMeterInfoType->TMeter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { + int grammarID = 65; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 65: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinCurrentDemandResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 66; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 66: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus ); + } + grammarID = 67; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 67: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage ); + } + grammarID = 68; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 68: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent ); + } + grammarID = 69; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 69: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandResType->EVSECurrentLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 70; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 70: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandResType->EVSEVoltageLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 71; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 71: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandResType->EVSEPowerLimitAchieved); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 72; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 72: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + if ( dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit ); + } + grammarID = 73; + } else if ( dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit ); + } + grammarID = 74; + } else if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 73: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + if ( dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit ); + } + grammarID = 74; + } else if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 74: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ + if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { + int grammarID = 75; + int done = 0; + + unsigned int dinParameterSetType_Parameter_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 75: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinParameterSetType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 76; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 76: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ + if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 77; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 77: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ + if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); + } + grammarID = 77; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { + int grammarID = 78; + int done = 0; + + unsigned int dinSubCertificatesType_Certificate_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 78: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ + if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); + dinSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 79; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 79: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ + if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); + dinSubCertificatesType_Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 79; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { + int grammarID = 9; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +static int encode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { + int grammarID = 80; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 80: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinAC_EVSEStatusType->PowerSwitchClosed); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 81; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 81: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinAC_EVSEStatusType->RCD); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 82; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 82: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinAC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 83; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinAC_EVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { + int grammarID = 84; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 84: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + if ( dinEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval ); + } + grammarID = 3; + } else if ( dinEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &dinEntryType->TimeInterval ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { + int grammarID = 85; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 85: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinPowerDeliveryReqType->ReadyToChargeState); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 86; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 86: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( dinPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile ); + } + grammarID = 87; + } else if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 87: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ + if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType) { - int grammarID = 11; + int grammarID = 88; int done = 0; while(!done) { switch(grammarID) { - case 11: + case 88: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -446,12 +2866,12 @@ static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 12; + grammarID = 89; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 12: + case 89: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -464,12 +2884,12 @@ static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 13; + grammarID = 90; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 13: + case 90: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ if ( dinCostType->amountMultiplier_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -516,177 +2936,791 @@ static int encode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostTy return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { - int grammarID = 14; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { + int grammarID = 49; int done = 0; - - unsigned int dinX509DataType_X509IssuerSerial_currArrayIndex = 0; - unsigned int dinX509DataType_X509SKI_currArrayIndex = 0; - unsigned int dinX509DataType_X509SubjectName_currArrayIndex = 0; - unsigned int dinX509DataType_X509Certificate_currArrayIndex = 0; - unsigned int dinX509DataType_X509CRL_currArrayIndex = 0; - + + while(!done) { switch(grammarID) { - case 14: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ - if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + case 49: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + errn = encode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus ); } - grammarID = 15; - } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); - dinX509DataType_X509SKI_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); - dinX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); - dinX509DataType_X509Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); - dinX509DataType_X509CRL_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 15; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 15: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + done = 1; } - grammarID = 15; - } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { + int grammarID = 91; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 91: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDiscoveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 92; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 92: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions ); + } + grammarID = 93; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 93: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService ); + } + grammarID = 94; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 94: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ + if ( dinServiceDiscoveryResType->ServiceList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { + int grammarID = 95; + int done = 0; + + unsigned int dinPaymentOptionsType_PaymentOption_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 95: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ + if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 96: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ + if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 96; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +static int encode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) { + int grammarID = 97; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 97: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ + if ( dinPGPDataType->PGPKeyID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyID.bytesLen)); if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); - dinX509DataType_X509SKI_currArrayIndex++; + errn = encodeBytes(stream, dinPGPDataType->PGPKeyID.bytes, dinPGPDataType->PGPKeyID.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 15; - } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); - dinX509DataType_X509SubjectName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 15; - } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); + grammarID = 98; + } else if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); - dinX509DataType_X509Certificate_currArrayIndex++; + errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 15; - } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); + grammarID = 99; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 98: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); if (errn == 0) { - errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); - dinX509DataType_X509CRL_currArrayIndex++; + errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 15; + grammarID = 99; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 15; + grammarID = 99; } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 6); + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 99: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 99; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { + int grammarID = 100; + int done = 0; + + unsigned int dinChargingProfileType_ProfileEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 100: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinChargingProfileType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 101; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 101: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ + if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 102; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 102: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ + if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); + } + grammarID = 102; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ +static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { + int grammarID = 103; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 103: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus ); + } + grammarID = 104; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 104: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent ); + } + grammarID = 105; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 105: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit ); + } + grammarID = 106; + } else if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 107; + } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 108; + } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 109; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 110; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 106: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); + } + grammarID = 107; + } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 108; + } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 109; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 110; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 107: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); + } + grammarID = 108; + } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 109; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 110; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 108: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 109; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 110; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 109: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 110; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 110: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC ); + } + grammarID = 111; + } else if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 112; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 111: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); + } + grammarID = 112; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 112: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { + int grammarID = 113; + int done = 0; + + unsigned int dinSignedInfoType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 113: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( dinSignedInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignedInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignedInfoType->Id.characters, dinSignedInfoType->Id.charactersLen); + } + } + grammarID = 114; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); + } + grammarID = 115; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 114: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); + } + grammarID = 115; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 115: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod ); + } + grammarID = 116; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 116: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 117; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 117: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); + } + grammarID = 117; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { + int grammarID = 118; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 118: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinServiceTagType(stream, &dinServiceType->ServiceTag ); + } + grammarID = 119; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 119: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } @@ -708,13 +3742,13 @@ static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* d /* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":BodyElement{0-1})', derivedBy='RESTRICTION'. */ static int encode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType) { - int grammarID = 16; + int grammarID = 120; int done = 0; - - + + while(!done) { switch(grammarID) { - case 16: + case 120: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ if ( dinBodyType->BodyElement_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 6, 0); @@ -959,246 +3993,15 @@ static int encode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyTy return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) { - int grammarID = 17; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 17: - /* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( dinRetrievalMethodType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinRetrievalMethodType->Type.characters, dinRetrievalMethodType->Type.charactersLen); - } - } - grammarID = 18; - } else if ( dinRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 19; - } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 18: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( dinRetrievalMethodType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRetrievalMethodType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType->URI.charactersLen); - } - } - grammarID = 19; - } else if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 19: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( dinRetrievalMethodType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { - int grammarID = 20; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 20: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - if ( dinCertificateInstallationReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateInstallationReqType->Id.characters, dinCertificateInstallationReqType->Id.charactersLen); - } - } - grammarID = 21; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 22; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 21: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytes, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 22; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 22: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs ); - } - grammarID = 23; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 23: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationReqType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytes, dinCertificateInstallationReqType->DHParams.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { - int grammarID = 24; + int grammarID = 121; int done = 0; - - + + while(!done) { switch(grammarID) { - case 24: + case 121: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -1211,48 +4014,48 @@ static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 25; + grammarID = 122; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 25: + case 122: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EAmount ); } - grammarID = 26; + grammarID = 123; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 26: + case 123: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxVoltage ); } - grammarID = 27; + grammarID = 124; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 27: + case 124: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxCurrent ); } - grammarID = 28; + grammarID = 125; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 28: + case 125: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -1287,252 +4090,15 @@ static int encode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_ return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { - int grammarID = 29; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { + int grammarID = 126; int done = 0; while(!done) { switch(grammarID) { - case 29: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinObjectType->Encoding_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Encoding.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->Encoding.characters, dinObjectType->Encoding.charactersLen); - } - } - grammarID = 30; - } else if ( dinObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); - } - } - grammarID = 31; - } else if ( dinObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); - } - } - grammarID = 32; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 30: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinObjectType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); - } - } - grammarID = 31; - } else if ( dinObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); - } - } - grammarID = 32; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 31: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinObjectType->MimeType_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); - } - } - grammarID = 32; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 32: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 33: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType) { - int grammarID = 34; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 34: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinContractAuthenticationResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 35; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 35: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinContractAuthenticationResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) { - int grammarID = 36; - int done = 0; - - unsigned int dinChargingProfileType_ProfileEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 36: + case 126: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -1540,2659 +4106,7 @@ static int encode_dinChargingProfileType(bitstream_t* stream, struct dinCharging /* FirstStartTag[CHARACTERS[INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeInteger16(stream, dinChargingProfileType->SAScheduleTupleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 37; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 37: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ - if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 38; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 38: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */ - if (dinChargingProfileType_ProfileEntry_currArrayIndex < dinChargingProfileType->ProfileEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array [dinChargingProfileType_ProfileEntry_currArrayIndex++]); - } - grammarID = 38; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { - int grammarID = 39; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 39: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateResType->Id.characters, dinCertificateUpdateResType->Id.charactersLen); - } - } - grammarID = 40; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 40: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateUpdateResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 41: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain ); - } - grammarID = 42; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 42: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 43; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 43: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateUpdateResType->DHParams.bytes, dinCertificateUpdateResType->DHParams.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 44; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 44: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateResType->ContractID.characters, dinCertificateUpdateResType->ContractID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 45: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinCertificateUpdateResType->RetryCounter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ -static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) { - int grammarID = 46; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 46: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->Id.characters, dinReferenceType->Id.charactersLen); - } - } - grammarID = 47; - } else if ( dinReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); - } - } - grammarID = 48; - } else if ( dinReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); - } - } - grammarID = 49; - } else if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 50; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 51; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 47: - /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); - } - } - grammarID = 48; - } else if ( dinReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); - } - } - grammarID = 49; - } else if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 50; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 51; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 48: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); - } - } - grammarID = 49; - } else if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 50; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 51; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 49: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( dinReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); - } - grammarID = 50; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 51; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 50: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); - } - grammarID = 51; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 51: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->DigestValue.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinReferenceType->DigestValue.bytes, dinReferenceType->DigestValue.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ -static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { - int grammarID = 52; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 52: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - if ( dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval ); - } - grammarID = 53; - } else if ( dinPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval ); - } - grammarID = 53; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 53: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinPMaxScheduleEntryType->PMax); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { - int grammarID = 54; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 54: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinServicePaymentSelectionReqType->SelectedPaymentOption); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 55; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 55: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) { - int grammarID = 56; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 56: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateInstallationResType->Id.characters, dinCertificateInstallationResType->Id.charactersLen); - } - } - grammarID = 57; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 57: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateInstallationResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 58; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 58: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain ); - } - grammarID = 59; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 59: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 60: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateInstallationResType->DHParams.bytes, dinCertificateInstallationResType->DHParams.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 61; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 61: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateInstallationResType->ContractID.characters, dinCertificateInstallationResType->ContractID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { - int grammarID = 62; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 62: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinSelectedServiceType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 63; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 63: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ - if ( dinSelectedServiceType->ParameterSetID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinSelectedServiceType->ParameterSetID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { - int grammarID = 64; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 64: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVReady); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 65; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 65: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - if ( dinDC_EVStatusType->EVCabinConditioning_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVCabinConditioning); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 66; - } else if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 67; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 68; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 66: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 67; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 68; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 67: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 68; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 68: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVStatusType->EVRESSSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -static int encode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) { - int grammarID = 69; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 69: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - if ( dinPGPDataType->PGPKeyID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinPGPDataType->PGPKeyID.bytes, dinPGPDataType->PGPKeyID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 70; - } else if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 70: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - if ( dinPGPDataType->PGPKeyPacket_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPGPDataType->PGPKeyPacket.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytes, dinPGPDataType->PGPKeyPacket.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 71; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 71; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 71: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 71; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) { - int grammarID = 72; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 72: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCurrentDemandResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 73; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus ); - } - grammarID = 74; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 74: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage ); - } - grammarID = 75; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 75: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent ); - } - grammarID = 76; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 76: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandResType->EVSECurrentLimitAchieved); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 77; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 77: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandResType->EVSEVoltageLimitAchieved); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 78; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 78: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandResType->EVSEPowerLimitAchieved); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 79; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 79: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - if ( dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit ); - } - grammarID = 80; - } else if ( dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit ); - } - grammarID = 81; - } else if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 80: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - if ( dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit ); - } - grammarID = 81; - } else if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 81: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */ - if ( dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) { - int grammarID = 82; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 82: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { - int grammarID = 83; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 83: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinChargingStatusResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 84; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 84: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinChargingStatusResType->EVSEID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinChargingStatusResType->EVSEID.bytes, dinChargingStatusResType->EVSEID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 85; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 85: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinChargingStatusResType->SAScheduleTupleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 86; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 86: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - if ( dinChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent ); - } - grammarID = 87; - } else if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); - } - grammarID = 88; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 87: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); - } - grammarID = 88; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 88: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 89: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -static int encode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { - int grammarID = 82; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 82: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { - int grammarID = 90; - int done = 0; - - unsigned int dinServiceParameterListType_ParameterSet_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 90: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ - if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 91; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 91: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ - if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); - } - grammarID = 91; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { - int grammarID = 92; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 92: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateChainType->Certificate.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateChainType->Certificate.bytes, dinCertificateChainType->Certificate.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 93; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 93: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ - if ( dinCertificateChainType->SubCertificates_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { - int grammarID = 94; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 94: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinPowerDeliveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 95; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 95: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ - if ( dinPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus ); - } - grammarID = 3; - } else if ( dinPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus ); - } - grammarID = 3; - } else if ( dinPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ -static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { - int grammarID = 96; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 96: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus ); - } - grammarID = 97; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 97: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage ); - } - grammarID = 98; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 98: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent ); - } - grammarID = 99; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 99: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ -static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { - int grammarID = 100; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 100: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header ); - } - grammarID = 101; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 101: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinBodyType(stream, &dinAnonType_V2G_Message->Body ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { - int grammarID = 102; - int done = 0; - - unsigned int dinConsumptionCostType_Cost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 102: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinConsumptionCostType->startValue); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 103; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 103: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ - if (dinConsumptionCostType_Cost_currArrayIndex < dinConsumptionCostType->Cost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinCostType(stream, &dinConsumptionCostType->Cost.array [dinConsumptionCostType_Cost_currArrayIndex++]); - } - grammarID = 103; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { - int grammarID = 104; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 104: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - if ( dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSEIsolationStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 105; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 106; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 105: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 106; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 106: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinDC_EVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 107; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 107: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) { - int grammarID = 108; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 108: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinWeldingDetectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 109; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus ); - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { - int grammarID = 111; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 111: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupReqType->EVCCID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSessionSetupReqType->EVCCID.bytes, dinSessionSetupReqType->EVCCID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) { - int grammarID = 112; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 112: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinSessionSetupResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 113; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupResType->EVSEID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSessionSetupResType->EVSEID.bytes, dinSessionSetupResType->EVSEID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 114; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 114: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */ - if ( dinSessionSetupResType->DateTimeNow_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinSessionSetupResType->DateTimeNow); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { - int grammarID = 115; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 115: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDetailResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 116; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 116: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinServiceDetailResType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 117; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 117: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ - if ( dinServiceDetailResType->ServiceParameterList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) { - int grammarID = 118; - int done = 0; - - unsigned int dinSPKIDataType_SPKISexp_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 118: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - dinSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 119; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 119: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */ - if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - dinSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 119; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 120; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 120: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ - if (dinSPKIDataType_SPKISexp_currArrayIndex < dinSPKIDataType->SPKISexp.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytes, dinSPKIDataType->SPKISexp.array[dinSPKIDataType_SPKISexp_currArrayIndex].bytesLen); - dinSPKIDataType_SPKISexp_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 119; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { - int grammarID = 121; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 121: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinPowerDeliveryReqType->ReadyToChargeState); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 122; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( dinPowerDeliveryReqType->ChargingProfile_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile ); - } - grammarID = 123; - } else if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */ - if ( dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if ( dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -static int encode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) { - int grammarID = 108; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 108: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinPreChargeResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 109; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus ); - } - grammarID = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 110: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { - int grammarID = 124; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 124: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCanonicalizationMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.characters, dinCanonicalizationMethodType->Algorithm.charactersLen); - } - } - grammarID = 32; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 32: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 33: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ -static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { - int grammarID = 125; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 125: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag ); - } - grammarID = 126; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 126: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinServiceChargeType->FreeService); + errn = encodeInteger16(stream, dinSAScheduleTupleType->SAScheduleTupleID); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -4203,27 +4117,27 @@ static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceCha } break; case 127: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 4, dinServiceChargeType->EnergyTransferType); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule ); } - grammarID = 3; + grammarID = 128; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); + case 128: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ + if ( dinSAScheduleTupleType->SalesTariff_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } @@ -4232,27 +4146,8 @@ static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceCha errn = EXI_ERROR_UNKOWN_EVENT; } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { - int grammarID = 128; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ + case 3: + /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { @@ -4278,9 +4173,9 @@ static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChar static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) { int grammarID = 129; int done = 0; - + unsigned int dinSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; - + while(!done) { switch(grammarID) { case 129: @@ -4324,16 +4219,1460 @@ static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSASchedul return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { - int grammarID = 128; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +static int encode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { + int grammarID = 131; int done = 0; while(!done) { switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ + case 131: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinServicePaymentSelectionReqType->SelectedPaymentOption); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 132; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 132: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) { + int grammarID = 133; + int done = 0; + + unsigned int dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 133: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinPMaxScheduleType->PMaxScheduleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 134; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 134: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ + if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 135; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 135: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ + if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 135; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { + int grammarID = 136; + int done = 0; + + unsigned int dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 136: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ + if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); + dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 137; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 137: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ + if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); + dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 137; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { + int grammarID = 138; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 138: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCanonicalizationMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.characters, dinCanonicalizationMethodType->Algorithm.charactersLen); + } + } + grammarID = 139; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 139: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) { + int grammarID = 140; + int done = 0; + + unsigned int dinTransformType_XPath_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 140: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinTransformType->Algorithm.characters, dinTransformType->Algorithm.charactersLen); + } + } + grammarID = 141; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 141: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); + dinTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 142; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 142; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 142; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 142: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); + dinTransformType_XPath_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 142; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 142; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 142; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) { + int grammarID = 143; + int done = 0; + + unsigned int dinKeyInfoType_KeyName_currArrayIndex = 0; + unsigned int dinKeyInfoType_KeyValue_currArrayIndex = 0; + unsigned int dinKeyInfoType_RetrievalMethod_currArrayIndex = 0; + unsigned int dinKeyInfoType_X509Data_currArrayIndex = 0; + unsigned int dinKeyInfoType_PGPData_currArrayIndex = 0; + unsigned int dinKeyInfoType_SPKIData_currArrayIndex = 0; + unsigned int dinKeyInfoType_MgmtData_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 143: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( dinKeyInfoType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->Id.characters, dinKeyInfoType->Id.charactersLen); + } + } + grammarID = 144; + } else if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 7); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 145; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 146; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 144: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 145; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 146; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 145: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 145; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 4, 8); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 145; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 146: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); + dinKeyInfoType_KeyName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 1); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 2); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 3); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 4); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 5); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); + } + grammarID = 145; + } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 4, 6); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); + dinKeyInfoType_MgmtData_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 145; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 145; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 146; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +static int encode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType) { + int grammarID = 147; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 147: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinContractAuthenticationResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 59; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 59: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 1, dinContractAuthenticationResType->EVSEProcessing); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ +static int encode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) { + int grammarID = 148; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 148: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag ); + } + grammarID = 149; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 149: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinServiceChargeType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 150; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 150: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinServiceChargeType->EnergyTransferType); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) { + int grammarID = 151; + int done = 0; + + unsigned int dinServiceParameterListType_ParameterSet_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 151: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ + if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 152; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 152: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */ + if (dinServiceParameterListType_ParameterSet_currArrayIndex < dinServiceParameterListType->ParameterSet.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array [dinServiceParameterListType_ParameterSet_currArrayIndex++]); + } + grammarID = 152; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { + int grammarID = 153; + int done = 0; + + unsigned int dinSignatureType_Object_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 153: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( dinSignatureType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignatureType->Id.characters, dinSignatureType->Id.charactersLen); + } + } + grammarID = 154; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); + } + grammarID = 155; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 154: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); + } + grammarID = 155; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 155: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue ); + } + grammarID = 156; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 156: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if ( dinSignatureType->KeyInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo ); + } + grammarID = 157; + } else if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); + } + grammarID = 157; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 157: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ + if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); + } + grammarID = 157; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { + int grammarID = 158; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 158: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinMeteringReceiptResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 159; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 159: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) { + int grammarID = 160; + int done = 0; + + unsigned int dinX509DataType_X509IssuerSerial_currArrayIndex = 0; + unsigned int dinX509DataType_X509SKI_currArrayIndex = 0; + unsigned int dinX509DataType_X509SubjectName_currArrayIndex = 0; + unsigned int dinX509DataType_X509Certificate_currArrayIndex = 0; + unsigned int dinX509DataType_X509CRL_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 160: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */ + if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 161; + } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); + dinX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); + dinX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); + dinX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); + dinX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 161; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 161: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */ + if (dinX509DataType_X509IssuerSerial_currArrayIndex < dinX509DataType->X509IssuerSerial.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + } + grammarID = 161; + } else if (dinX509DataType_X509SKI_currArrayIndex < dinX509DataType->X509SKI.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytes, dinX509DataType->X509SKI.array[dinX509DataType_X509SKI_currArrayIndex].bytesLen); + dinX509DataType_X509SKI_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (dinX509DataType_X509SubjectName_currArrayIndex < dinX509DataType->X509SubjectName.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].characters, dinX509DataType->X509SubjectName.array[dinX509DataType_X509SubjectName_currArrayIndex].charactersLen); + dinX509DataType_X509SubjectName_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (dinX509DataType_X509Certificate_currArrayIndex < dinX509DataType->X509Certificate.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytes, dinX509DataType->X509Certificate.array[dinX509DataType_X509Certificate_currArrayIndex].bytesLen); + dinX509DataType_X509Certificate_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (dinX509DataType_X509CRL_currArrayIndex < dinX509DataType->X509CRL.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytes, dinX509DataType->X509CRL.array[dinX509DataType_X509CRL_currArrayIndex].bytesLen); + dinX509DataType_X509CRL_currArrayIndex++; + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 161; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 161; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 6); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int encode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) { + int grammarID = 162; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 162: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->Id.characters, dinReferenceType->Id.charactersLen); + } + } + grammarID = 163; + } else if ( dinReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); + } + } + grammarID = 164; + } else if ( dinReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); + } + } + grammarID = 165; + } else if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 166; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 167; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 163: + /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->Type.characters, dinReferenceType->Type.charactersLen); + } + } + grammarID = 164; + } else if ( dinReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); + } + } + grammarID = 165; + } else if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 166; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 167; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 164: + /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinReferenceType->URI.characters, dinReferenceType->URI.charactersLen); + } + } + grammarID = 165; + } else if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 166; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 167; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 165: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( dinReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &dinReferenceType->Transforms ); + } + grammarID = 166; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 167; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 166: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod ); + } + grammarID = 167; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 167: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinReferenceType->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinReferenceType->DigestValue.bytes, dinReferenceType->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { @@ -4357,13 +5696,13 @@ static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesT /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) { - int grammarID = 131; + int grammarID = 168; int done = 0; while(!done) { switch(grammarID) { - case 131: + case 168: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4376,12 +5715,12 @@ static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalVa errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 132; + grammarID = 169; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 132: + case 169: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ if ( dinPhysicalValueType->Unit_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -4394,7 +5733,7 @@ static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalVa errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 133; + grammarID = 170; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -4411,7 +5750,7 @@ static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalVa errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 133: + case 170: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4452,50 +5791,44 @@ static int encode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalVa return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) { - int grammarID = 134; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { + int grammarID = 171; int done = 0; while(!done) { switch(grammarID) { - case 134: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + case 171: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeInteger16(stream, dinSAScheduleTupleType->SAScheduleTupleID); + errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->start); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 135; + grammarID = 172; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 135: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule ); - } - grammarID = 136; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 136: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */ - if ( dinSAScheduleTupleType->SalesTariff_isUsed == 1u ) { + case 172: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */ + if ( dinRelativeTimeIntervalType->duration_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff ); + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->duration); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } grammarID = 3; } else if (1==1) { @@ -4531,98 +5864,185 @@ static int encode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSASchedu return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ -static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { - int grammarID = 137; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { + int grammarID = 173; int done = 0; + unsigned int dinSalesTariffType_SalesTariffEntry_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 137: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( dinCertificateUpdateReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + case 173: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->Id.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateReqType->Id.characters, dinCertificateUpdateReqType->Id.charactersLen); + errn = encodeCharacters(stream, dinSalesTariffType->Id.characters, dinSalesTariffType->Id.charactersLen); } } - grammarID = 138; + grammarID = 174; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 174: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinSalesTariffType->SalesTariffID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 175; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 175: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ + if ( dinSalesTariffType->SalesTariffDescription_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.characters, dinSalesTariffType->SalesTariffDescription.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 176; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); - } - grammarID = 139; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 138: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); - } - grammarID = 139; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 139: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinCertificateUpdateReqType->ContractID.characters, dinCertificateUpdateReqType->ContractID.charactersLen); - } + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 22; + grammarID = 177; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 22: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ + case 176: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs ); - } - grammarID = 23; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 23: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->DHParams.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytes, dinCertificateUpdateReqType->DHParams.bytesLen); - } + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } + grammarID = 177; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 177: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ + if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 178; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 178: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ + if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); + } + grammarID = 178; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { + int grammarID = 179; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 179: + /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ + if ( dinSignatureValueType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignatureValueType->Id.characters, dinSignatureValueType->Id.charactersLen); + } + } + grammarID = 180; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 180: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); + } + } grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; @@ -4651,348 +6071,16 @@ static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCer return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) { - int grammarID = 140; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { + int grammarID = 9; int done = 0; while(!done) { switch(grammarID) { - case 140: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignatureMethodType->Algorithm.characters, dinSignatureMethodType->Algorithm.charactersLen); - } - } - grammarID = 141; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 141: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 33; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 142; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 33: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 142: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if ( dinSignatureMethodType->HMACOutputLength_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinSignatureMethodType->HMACOutputLength); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 33; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 142; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) { - int grammarID = 124; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 124: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDigestMethodType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinDigestMethodType->Algorithm.characters, dinDigestMethodType->Algorithm.charactersLen); - } - } - grammarID = 32; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 32: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 33: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -static int encode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { - int grammarID = 143; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 143: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); - } - grammarID = 144; - } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); - } - grammarID = 144; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 144; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 145; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 144: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 144; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 145: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); - } - grammarID = 144; - } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); - } - grammarID = 144; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 144; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 145; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { - int grammarID = 146; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 146: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - if ( dinContractAuthenticationReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinContractAuthenticationReqType->Id.characters, dinContractAuthenticationReqType->Id.charactersLen); - } - } - grammarID = 147; - } else if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 147: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ - if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ + case 9: + /* FirstStartTag[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { @@ -5014,336 +6102,149 @@ static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { - int grammarID = 148; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) { + int grammarID = 181; int done = 0; - - + + while(!done) { switch(grammarID) { - case 148: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( dinServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.characters, dinServiceDiscoveryReqType->ServiceScope.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 149; - } else if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); + case 181: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); + errn = encodeNBitUnsignedInteger(stream, 5, dinChargingStatusResType->ResponseCode); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 182; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 149: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -static int encode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) { - int grammarID = 150; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 150: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, dinServiceDetailReqType->ServiceID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) { - int grammarID = 151; - int done = 0; - - unsigned int dinSignedInfoType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 151: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( dinSignedInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignedInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignedInfoType->Id.characters, dinSignedInfoType->Id.charactersLen); - } - } - grammarID = 152; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); - } - grammarID = 153; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 152: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod ); - } - grammarID = 153; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 153: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod ); - } - grammarID = 154; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 154: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 155; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 155: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (dinSignedInfoType_Reference_currArrayIndex < dinSignedInfoType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinReferenceType(stream, &dinSignedInfoType->Reference.array [dinSignedInfoType_Reference_currArrayIndex++]); - } - grammarID = 155; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { - int grammarID = 156; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 156: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ - if ( dinMeteringReceiptReqType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinMeteringReceiptReqType->Id.characters, dinMeteringReceiptReqType->Id.charactersLen); - } - } - grammarID = 157; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 158; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 157: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + case 182: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinChargingStatusResType->EVSEID.bytesLen)); if (errn == 0) { - errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); + errn = encodeBytes(stream, dinChargingStatusResType->EVSEID.bytes, dinChargingStatusResType->EVSEID.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 158; + grammarID = 183; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 158: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ - if ( dinMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); + case 183: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeInteger16(stream, dinMeteringReceiptReqType->SAScheduleTupleID); + errn = encodeInteger16(stream, dinChargingStatusResType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 184; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 184: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + if ( dinChargingStatusResType->EVSEMaxCurrent_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent ); + } + grammarID = 185; + } else if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); + } + grammarID = 186; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } grammarID = 159; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 185: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + if ( dinChargingStatusResType->MeterInfo_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo ); + } + grammarID = 186; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 3; + grammarID = 159; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 186: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 159; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); + errn = encode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus ); } grammarID = 3; } else { @@ -5373,45 +6274,144 @@ static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeter return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) { - int grammarID = 160; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) { + int grammarID = 187; + int done = 0; + + unsigned int dinManifestType_Reference_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 187: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if ( dinManifestType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinManifestType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinManifestType->Id.characters, dinManifestType->Id.charactersLen); + } + } + grammarID = 188; + } else if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); + } + grammarID = 117; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 188: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ + if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); + } + grammarID = 117; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 117: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ + if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); + } + grammarID = 117; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) { + int grammarID = 9; int done = 0; while(!done) { switch(grammarID) { - case 160: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - if ( 1 == 1 ) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.characters, dinX509IssuerSerialType->X509IssuerName.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + done = 1; } - grammarID = 161; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 161: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +static int encode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { + int grammarID = 189; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 189: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + if ( dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval ); + } + grammarID = 190; + } else if ( dinPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval ); + } + grammarID = 190; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 190: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + /* FirstStartTag[CHARACTERS[INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeInteger64(stream, dinX509IssuerSerialType->X509SerialNumber); + errn = encodeInteger16(stream, dinPMaxScheduleEntryType->PMax); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -5444,35 +6444,217 @@ static int encode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509Iss return errn; } +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { + int grammarID = 191; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 191: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ + if ( dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSEIsolationStatus); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 192; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 82; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 192: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVSEStatusType->EVSEStatusCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 82; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 82: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinDC_EVSEStatusType->NotificationMaxDelay); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 83; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 83: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinDC_EVSEStatusType->EVSENotification); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +static int encode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) { + int grammarID = 193; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 193: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus ); + } + grammarID = 194; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 194: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage ); + } + grammarID = 195; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 195: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType) { - int grammarID = 162; + int grammarID = 196; int done = 0; unsigned int dinTransformsType_Transform_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 162: + case 196: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ if (dinTransformsType_Transform_currArrayIndex < dinTransformsType->Transform.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinTransformType(stream, &dinTransformsType->Transform.array [dinTransformsType_Transform_currArrayIndex++]); } - grammarID = 163; + grammarID = 197; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 163: + case 197: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ if (dinTransformsType_Transform_currArrayIndex < dinTransformsType->Transform.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_dinTransformType(stream, &dinTransformsType->Transform.array [dinTransformsType_Transform_currArrayIndex++]); } - grammarID = 163; + grammarID = 197; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -5496,13 +6678,13 @@ static int encode_dinTransformsType(bitstream_t* stream, struct dinTransformsTyp /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { - int grammarID = 164; + int grammarID = 198; int done = 0; while(!done) { switch(grammarID) { - case 164: + case 198: /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5513,24 +6695,24 @@ static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* errn = encodeCharacters(stream, dinParameterType->Name.characters, dinParameterType->Name.charactersLen); } } - grammarID = 165; + grammarID = 199; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 165: + case 199: /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encodeNBitUnsignedInteger(stream, 3, dinParameterType->ValueType); } - grammarID = 166; + grammarID = 200; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 166: + case 200: /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ if ( dinParameterType->boolValue_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -5629,1765 +6811,15 @@ static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) { - int grammarID = 128; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { - int grammarID = 167; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 167: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->start); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 168; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 168: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */ - if ( dinRelativeTimeIntervalType->duration_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinRelativeTimeIntervalType->duration); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) { - int grammarID = 169; - int done = 0; - - unsigned int dinKeyInfoType_KeyName_currArrayIndex = 0; - unsigned int dinKeyInfoType_KeyValue_currArrayIndex = 0; - unsigned int dinKeyInfoType_RetrievalMethod_currArrayIndex = 0; - unsigned int dinKeyInfoType_X509Data_currArrayIndex = 0; - unsigned int dinKeyInfoType_PGPData_currArrayIndex = 0; - unsigned int dinKeyInfoType_SPKIData_currArrayIndex = 0; - unsigned int dinKeyInfoType_MgmtData_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 169: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if ( dinKeyInfoType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->Id.characters, dinKeyInfoType->Id.charactersLen); - } - } - grammarID = 170; - } else if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 7); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 171; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 172; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 170: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 171; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 172; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 171: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 171; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 4, 8); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 171; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 172: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (dinKeyInfoType_KeyName_currArrayIndex < dinKeyInfoType->KeyName.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].characters, dinKeyInfoType->KeyName.array[dinKeyInfoType_KeyName_currArrayIndex].charactersLen); - dinKeyInfoType_KeyName_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (dinKeyInfoType_KeyValue_currArrayIndex < dinKeyInfoType->KeyValue.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 1); - if(errn == 0) { - errn = encode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array [dinKeyInfoType_KeyValue_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_RetrievalMethod_currArrayIndex < dinKeyInfoType->RetrievalMethod.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 2); - if(errn == 0) { - errn = encode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array [dinKeyInfoType_RetrievalMethod_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_X509Data_currArrayIndex < dinKeyInfoType->X509Data.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 3); - if(errn == 0) { - errn = encode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array [dinKeyInfoType_X509Data_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_PGPData_currArrayIndex < dinKeyInfoType->PGPData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 4); - if(errn == 0) { - errn = encode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array [dinKeyInfoType_PGPData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_SPKIData_currArrayIndex < dinKeyInfoType->SPKIData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 5); - if(errn == 0) { - errn = encode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array [dinKeyInfoType_SPKIData_currArrayIndex++]); - } - grammarID = 171; - } else if (dinKeyInfoType_MgmtData_currArrayIndex < dinKeyInfoType->MgmtData.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 4, 6); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].characters, dinKeyInfoType->MgmtData.array[dinKeyInfoType_MgmtData_currArrayIndex].charactersLen); - dinKeyInfoType_MgmtData_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 171; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 171; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 172; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -static int encode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) { - int grammarID = 173; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 173: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - if ( dinEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval ); - } - grammarID = 3; - } else if ( dinEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinIntervalType(stream, &dinEntryType->TimeInterval ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) { - int grammarID = 128; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { - int grammarID = 128; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { - int grammarID = 174; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 174: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinChargeParameterDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 175; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 175: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinChargeParameterDiscoveryResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 176; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 176: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */ - if ( dinChargeParameterDiscoveryResType->SAScheduleList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList ); - } - grammarID = 177; - } else if ( dinChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules ); - } - grammarID = 177; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */ - if ( dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) { - int grammarID = 178; - int done = 0; - - unsigned int dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 178: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinPMaxScheduleType->PMaxScheduleID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 179; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 179: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ - if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); - } - grammarID = 180; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 180: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */ - if (dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex < dinPMaxScheduleType->PMaxScheduleEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array [dinPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); - } - grammarID = 180; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { - int grammarID = 181; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 181: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus ); - } - grammarID = 182; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 182: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); - } - grammarID = 183; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 183: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - if ( dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); - } - grammarID = 184; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); - } - grammarID = 185; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 184: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); - } - grammarID = 185; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 185: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); - } - grammarID = 186; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 186: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); - } - grammarID = 187; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 187: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); - } - grammarID = 188; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 189; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 188: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 189; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 189: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ - if ( dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -static int encode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) { - int grammarID = 190; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 190: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinCableCheckResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 191; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 191: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus ); - } - grammarID = 35; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 35: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinCableCheckResType->EVSEProcessing); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) { - int grammarID = 192; - int done = 0; - - unsigned int dinTransformType_XPath_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 192: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->Algorithm.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinTransformType->Algorithm.characters, dinTransformType->Algorithm.charactersLen); - } - } - grammarID = 193; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 193: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); - dinTransformType_XPath_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 194; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 194; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 194; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 194: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (dinTransformType_XPath_currArrayIndex < dinTransformType->XPath.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].characters, dinTransformType->XPath.array[dinTransformType_XPath_currArrayIndex].charactersLen); - dinTransformType_XPath_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 194; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 194; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 194; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) { - int grammarID = 195; - int done = 0; - - unsigned int dinParameterSetType_Parameter_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 195: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinParameterSetType->ParameterSetID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 196; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 196: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ - if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 197; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 197: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */ - if (dinParameterSetType_Parameter_currArrayIndex < dinParameterSetType->Parameter.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinParameterType(stream, &dinParameterSetType->Parameter.array [dinParameterSetType_Parameter_currArrayIndex++]); - } - grammarID = 197; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) { - int grammarID = 198; - int done = 0; - - unsigned int dinSubCertificatesType_Certificate_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 198: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); - dinSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 199; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 199: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */ - if (dinSubCertificatesType_Certificate_currArrayIndex < dinSubCertificatesType->Certificate.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytes, dinSubCertificatesType->Certificate.array[dinSubCertificatesType_Certificate_currArrayIndex].bytesLen); - dinSubCertificatesType_Certificate_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 199; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { - int grammarID = 200; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 200: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus ); - } - grammarID = 201; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 201: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ - if ( dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVPowerDeliveryParameterType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 202; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVPowerDeliveryParameterType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinDC_EVPowerDeliveryParameterType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { - int grammarID = 203; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 203: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinPaymentDetailsReqType->ContractID.characters, dinPaymentDetailsReqType->ContractID.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 204; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 204: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { - int grammarID = 205; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 205: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus ); - } - grammarID = 206; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 206: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit ); - } - grammarID = 207; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 207: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit ); - } - grammarID = 208; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 209; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 208: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 209; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 209: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity ); - } - grammarID = 210; - } else if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 211; - } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 212; - } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 210: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 211; - } else if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 212; - } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 211: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->FullSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->FullSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 212; - } else if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 212: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */ - if ( dinDC_EVChargeParameterType->BulkSOC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVChargeParameterType->BulkSOC - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) { - int grammarID = 213; - int done = 0; - - unsigned int dinSelectedServiceListType_SelectedService_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 213: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ - if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 214; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */ - if (dinSelectedServiceListType_SelectedService_currArrayIndex < dinSelectedServiceListType->SelectedService.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array [dinSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 214; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -static int encode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { - int grammarID = 215; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 215: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDiscoveryResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 216; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 216: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions ); - } - grammarID = 217; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 217: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService ); - } - grammarID = 218; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 218: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */ - if ( dinServiceDiscoveryResType->ServiceList_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType) { - int grammarID = 219; + int grammarID = 201; int done = 0; while(!done) { switch(grammarID) { - case 219: + case 201: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -7400,12 +6832,12 @@ static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 220; + grammarID = 202; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 220: + case 202: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -7422,12 +6854,12 @@ static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 221; + grammarID = 203; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 221: + case 203: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -7468,35 +6900,274 @@ static int encode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymen return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) { - int grammarID = 222; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +static int encode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) { + int grammarID = 204; int done = 0; while(!done) { switch(grammarID) { - case 222: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ + case 204: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_dinServiceTagType(stream, &dinServiceType->ServiceTag ); + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinPowerDeliveryResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 223; + grammarID = 205; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 223: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + case 205: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */ + if ( dinPowerDeliveryResType->AC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus ); + } + grammarID = 3; + } else if ( dinPowerDeliveryResType->DC_EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus ); + } + grammarID = 3; + } else if ( dinPowerDeliveryResType->EVSEStatus_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) { + int grammarID = 206; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 206: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateChainType->Certificate.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateChainType->Certificate.bytes, dinCertificateChainType->Certificate.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 207; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 207: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */ + if ( dinCertificateChainType->SubCertificates_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) { + int grammarID = 208; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 208: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeBoolean(stream, dinServiceType->FreeService); + errn = encodeBoolean(stream, dinDC_EVStatusType->EVReady); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 209; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 209: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + if ( dinDC_EVStatusType->EVCabinConditioning_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVStatusType->EVCabinConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 210; + } else if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 211; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 212; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 210: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + if ( dinDC_EVStatusType->EVRESSConditioning_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVStatusType->EVRESSConditioning); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 211; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 212; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 211: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinDC_EVStatusType->EVErrorCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 212; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 212: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 7, (uint32_t)(dinDC_EVStatusType->EVRESSSOC - 0)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -7529,16 +7200,58 @@ static int encode_dinServiceType(bitstream_t* stream, struct dinServiceType* din return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { - int grammarID = 128; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) { + int grammarID = 213; int done = 0; - - + + while(!done) { switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ + case 213: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, dinSelectedServiceType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 214; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 214: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */ + if ( dinSelectedServiceType->ParameterSetID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinSelectedServiceType->ParameterSetID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { @@ -7560,16 +7273,114 @@ static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct di return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) { - int grammarID = 128; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) { + int grammarID = 215; int done = 0; - - + + while(!done) { switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ + case 215: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, dinServiceTagType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 216; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 216: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ + if ( dinServiceTagType->ServiceName_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceTagType->ServiceName.characters, dinServiceTagType->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 217; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 218; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 217: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceTagType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 218; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 218: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */ + if ( dinServiceTagType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceTagType->ServiceScope.characters, dinServiceTagType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { @@ -7591,8 +7402,196 @@ static int encode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* d return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)', derivedBy='EXTENSION'. */ -static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) { +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { + int grammarID = 219; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 219: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + if ( dinContractAuthenticationReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinContractAuthenticationReqType->Id.characters, dinContractAuthenticationReqType->Id.charactersLen); + } + } + grammarID = 220; + } else if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 220: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */ + if ( dinContractAuthenticationReqType->GenChallenge_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType->GenChallenge.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { + int grammarID = 221; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 221: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus ); + } + grammarID = 222; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 222: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ + if ( dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVPowerDeliveryParameterType->BulkChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 223; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVPowerDeliveryParameterType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinDC_EVPowerDeliveryParameterType->ChargingComplete); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { int grammarID = 224; int done = 0; @@ -7600,463 +7599,58 @@ static int encode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrent while(!done) { switch(grammarID) { case 224: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( dinServiceDiscoveryReqType->ServiceScope_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { - errn = encode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus ); + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.characters, dinServiceDiscoveryReqType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } grammarID = 225; + } else if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 225: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent ); - } - grammarID = 226; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 226: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit ); - } - grammarID = 227; - } else if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 228; - } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 229; - } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 230; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 227: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 228; - } else if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 229; - } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 230; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 228: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 229; - } else if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 230; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( dinCurrentDemandReqType->BulkChargingComplete_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->BulkChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 230; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 230: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinCurrentDemandReqType->ChargingComplete); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 231: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - if ( dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC ); - } - grammarID = 232; - } else if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 233; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 232: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - if ( dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 233; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 233: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -static int encode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) { - int grammarID = 234; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 234: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinMeteringReceiptResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 89: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) { - int grammarID = 235; - int done = 0; - - unsigned int dinPaymentOptionsType_PaymentOption_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 235: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ - if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 236; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 236: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */ - if (dinPaymentOptionsType_PaymentOption_currArrayIndex < dinPaymentOptionsType->PaymentOption.arrayLen ) { + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */ + if ( dinServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 1, dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType_PaymentOption_currArrayIndex++]); + errn = encodeNBitUnsignedInteger(stream, 2, dinServiceDiscoveryReqType->ServiceCategory); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 236; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) { - int grammarID = 237; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 237: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMessageHeaderType->SessionID.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMessageHeaderType->SessionID.bytes, dinMessageHeaderType->SessionID.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 238; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 238: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( dinMessageHeaderType->Notification_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinNotificationType(stream, &dinMessageHeaderType->Notification ); - } - grammarID = 239; - } else if ( dinMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 239: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ - if ( dinMessageHeaderType->Signature_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSignatureType(stream, &dinMessageHeaderType->Signature ); - } grammarID = 3; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); @@ -8091,376 +7685,15 @@ static int encode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHea return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ -static int encode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { - int grammarID = 240; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { + int grammarID = 9; int done = 0; while(!done) { switch(grammarID) { - case 240: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinAC_EVSEStatusType->PowerSwitchClosed); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 241; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 241: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeBoolean(stream, dinAC_EVSEStatusType->RCD); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 106; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 106: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinAC_EVSEStatusType->NotificationMaxDelay); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 107; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 107: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, dinAC_EVSEStatusType->EVSENotification); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) { - int grammarID = 242; - int done = 0; - - unsigned int dinSalesTariffType_SalesTariffEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 242: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSalesTariffType->Id.characters, dinSalesTariffType->Id.charactersLen); - } - } - grammarID = 243; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 243: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinSalesTariffType->SalesTariffID); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 244; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 244: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - if ( dinSalesTariffType->SalesTariffDescription_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.characters, dinSalesTariffType->SalesTariffDescription.charactersLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 245; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 246; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 245: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffType->NumEPriceLevels - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 246; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 246: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ - if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 247; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 247: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */ - if (dinSalesTariffType_SalesTariffEntry_currArrayIndex < dinSalesTariffType->SalesTariffEntry.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array [dinSalesTariffType_SalesTariffEntry_currArrayIndex++]); - } - grammarID = 247; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -static int encode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { - int grammarID = 248; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 248: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 3, dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 249; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 249: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */ - if ( dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter ); - } - grammarID = 3; - } else if ( dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -static int encode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { - int grammarID = 250; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 250: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, dinServicePaymentSelectionResType->ResponseCode); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) { - int grammarID = 128; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 128: + case 9: /* FirstStartTag[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -8483,179 +7716,35 @@ static int encode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusTyp return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) { - int grammarID = 251; - int done = 0; - - unsigned int dinManifestType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 251: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if ( dinManifestType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinManifestType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinManifestType->Id.characters, dinManifestType->Id.charactersLen); - } - } - grammarID = 252; - } else if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); - } - grammarID = 155; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 252: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); - } - grammarID = 155; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 155: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */ - if (dinManifestType_Reference_currArrayIndex < dinManifestType->Reference.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinReferenceType(stream, &dinManifestType->Reference.array [dinManifestType_Reference_currArrayIndex++]); - } - grammarID = 155; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { - int grammarID = 253; - int done = 0; - - unsigned int dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 253: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ - if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); - dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 254; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 254: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */ - if (dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex < dinListOfRootCertificateIDsType->RootCertificateID.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].characters, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex].charactersLen); - dinListOfRootCertificateIDsType_RootCertificateID_currArrayIndex++; - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 254; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - /* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType) { - int grammarID = 255; + int grammarID = 226; int done = 0; unsigned int dinServiceTagListType_Service_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 255: + case 226: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ if (dinServiceTagListType_Service_currArrayIndex < dinServiceTagListType->Service.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { errn = encode_dinServiceType(stream, &dinServiceTagListType->Service.array [dinServiceTagListType_Service_currArrayIndex++]); } - grammarID = 256; + grammarID = 227; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 256: + case 227: /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */ if (dinServiceTagListType_Service_currArrayIndex < dinServiceTagListType->Service.arrayLen ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { errn = encode_dinServiceType(stream, &dinServiceTagListType->Service.array [dinServiceTagListType_Service_currArrayIndex++]); } - grammarID = 256; + grammarID = 227; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -8677,46 +7766,480 @@ static int encode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTa return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ -static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) { - int grammarID = 257; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +static int encode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) { + int grammarID = 0; int done = 0; while(!done) { switch(grammarID) { - case 257: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ + case 0: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Modulus.bytesLen)); + errn = encodeNBitUnsignedInteger(stream, 5, dinWeldingDetectionResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 1: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus ); + } + grammarID = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 2: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)', derivedBy='RESTRICTION'. */ +static int encode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { + int grammarID = 228; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 228: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header ); + } + grammarID = 229; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 229: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinBodyType(stream, &dinAnonType_V2G_Message->Body ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { + int grammarID = 230; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 230: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus ); + } + grammarID = 231; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 231: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit ); + } + grammarID = 232; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 232: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + if ( dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit ); + } + grammarID = 233; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); + } + grammarID = 234; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 233: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit ); + } + grammarID = 234; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 234: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit ); + } + grammarID = 235; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 235: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit ); + } + grammarID = 236; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 236: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance ); + } + grammarID = 237; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 238; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 237: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); + } + grammarID = 238; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 238: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */ + if ( dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ +static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { + int grammarID = 239; + int done = 0; + + unsigned int dinSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 239: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ + if ( dinSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval ); + } + grammarID = 240; + } else if ( dinSalesTariffEntryType->TimeInterval_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval ); + } + grammarID = 240; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 240: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffEntryType->EPriceLevel - 0)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 241; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 241: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + if (dinSalesTariffEntryType_ConsumptionCost_currArrayIndex < dinSalesTariffEntryType->ConsumptionCost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array [dinSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); + } + grammarID = 241; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) { + int grammarID = 9; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +static int encode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { + int grammarID = 242; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 242: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen + 2)); if (errn == 0) { - errn = encodeBytes(stream, dinRSAKeyValueType->Modulus.bytes, dinRSAKeyValueType->Modulus.bytesLen); + errn = encodeCharacters(stream, dinPaymentDetailsReqType->ContractID.characters, dinPaymentDetailsReqType->ContractID.charactersLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 258; + grammarID = 243; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 258: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ + case 243: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +static int encode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) { + int grammarID = 244; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 244: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinRSAKeyValueType->Exponent.bytesLen)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSessionSetupReqType->EVCCID.bytesLen)); if (errn == 0) { - errn = encodeBytes(stream, dinRSAKeyValueType->Exponent.bytes, dinRSAKeyValueType->Exponent.bytesLen); + errn = encodeBytes(stream, dinSessionSetupReqType->EVCCID.bytes, dinSessionSetupReqType->EVCCID.bytesLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -8750,15 +8273,15 @@ static int encode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueT return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { - int grammarID = 128; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) { + int grammarID = 9; int done = 0; - - + + while(!done) { switch(grammarID) { - case 128: + case 9: /* FirstStartTag[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -8781,59 +8304,334 @@ static int encode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSE return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) { - int grammarID = 259; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { + int grammarID = 245; int done = 0; - - unsigned int dinSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; - + + while(!done) { switch(grammarID) { - case 259: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - if ( dinSignaturePropertiesType->Id_isUsed == 1u ) { + case 245: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + if ( dinSignaturePropertyType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertiesType->Id.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Id.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, dinSignaturePropertiesType->Id.characters, dinSignaturePropertiesType->Id.charactersLen); + errn = encodeCharacters(stream, dinSignaturePropertyType->Id.characters, dinSignaturePropertyType->Id.charactersLen); } } - grammarID = 260; - } else if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 261; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 260: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 261; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 261: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ - if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); - } - grammarID = 261; + grammarID = 246; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 247; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 246: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 247; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 247: + /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 248; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 248: + /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 248; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) { + int grammarID = 249; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 249: + /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateResType->Id.characters, dinCertificateUpdateResType->Id.charactersLen); + } + } + grammarID = 250; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 250: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinCertificateUpdateResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 251; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 251: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain ); + } + grammarID = 252; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 252: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 253; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 253: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateUpdateResType->DHParams.bytes, dinCertificateUpdateResType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 254; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 254: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateResType->ContractID.characters, dinCertificateUpdateResType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 255; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 255: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinCertificateUpdateResType->RetryCounter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +static int encode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) { + int grammarID = 256; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 256: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinServiceDetailResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 257; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 257: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, dinServiceDetailResType->ServiceID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 258; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 258: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */ + if ( dinServiceDetailResType->ServiceParameterList_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } @@ -8855,13 +8653,13 @@ static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSign /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType) { - int grammarID = 262; + int grammarID = 259; int done = 0; while(!done) { switch(grammarID) { - case 262: + case 259: /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ if ( dinDSAKeyValueType->P_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -8877,7 +8675,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 263; + grammarID = 260; } else if ( dinDSAKeyValueType->G_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -8892,7 +8690,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 264; + grammarID = 261; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { @@ -8907,12 +8705,12 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 265; + grammarID = 262; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 263: + case 260: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ if ( dinDSAKeyValueType->Q_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -8928,12 +8726,12 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 266; + grammarID = 263; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 266: + case 263: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ if ( dinDSAKeyValueType->G_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -8949,7 +8747,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 264; + grammarID = 261; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -8964,12 +8762,12 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 265; + grammarID = 262; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 264: + case 261: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -8985,12 +8783,12 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 265; + grammarID = 262; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 265: + case 262: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ if ( dinDSAKeyValueType->J_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -9006,7 +8804,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 267; + grammarID = 264; } else if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -9021,7 +8819,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 268; + grammarID = 265; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { @@ -9032,7 +8830,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 267: + case 264: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -9048,7 +8846,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 268; + grammarID = 265; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -9059,7 +8857,7 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 268: + case 265: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ if ( dinDSAKeyValueType->PgenCounter_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9103,41 +8901,526 @@ static int encode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueT return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ -static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) { - int grammarID = 269; +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ +static int encode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { + int grammarID = 266; int done = 0; while(!done) { switch(grammarID) { - case 269: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ + case 266: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger32(stream, dinProfileEntryType->ChargingProfileEntryStart); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } + errn = encode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus ); } - grammarID = 270; + grammarID = 267; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 270: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + case 267: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage ); + } + grammarID = 268; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 268: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent ); + } + grammarID = 269; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 269: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) { + int grammarID = 270; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 270: + /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinObjectType->Encoding_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Encoding.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->Encoding.characters, dinObjectType->Encoding.charactersLen); + } + } + grammarID = 271; + } else if ( dinObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); + } + } + grammarID = 272; + } else if ( dinObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); + } + } + grammarID = 139; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 271: + /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinObjectType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->Id.characters, dinObjectType->Id.charactersLen); + } + } + grammarID = 272; + } else if ( dinObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); + } + } + grammarID = 139; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 272: + /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if ( dinObjectType->MimeType_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinObjectType->MimeType.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinObjectType->MimeType.characters, dinObjectType->MimeType.charactersLen); + } + } + grammarID = 139; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 139: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +static int encode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) { + int grammarID = 273; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 273: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); + } + grammarID = 274; + } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); + } + grammarID = 274; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 274; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 275; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 274: + /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 274; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 275: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ + if ( dinKeyValueType->DSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + errn = encode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue ); + } + grammarID = 274; + } else if ( dinKeyValueType->RSAKeyValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + errn = encode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue ); + } + grammarID = 274; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 274; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 275; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int encode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { + int grammarID = 9; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 9: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) { + int grammarID = 138; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 138: + /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDigestMethodType->Algorithm.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinDigestMethodType->Algorithm.characters, dinDigestMethodType->Algorithm.charactersLen); + } + } + grammarID = 139; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 139: + /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 45: + /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ + if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else if (1==0) { + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + grammarID = 45; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +static int encode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { + int grammarID = 276; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 276: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( dinCertificateUpdateReqType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateReqType->Id.characters, dinCertificateUpdateReqType->Id.charactersLen); + } + } + grammarID = 277; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); + } + grammarID = 278; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 277: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain ); + } + grammarID = 278; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 278: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeInteger16(stream, dinProfileEntryType->ChargingProfileEntryMaxPower); + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateReqType->ContractID.characters, dinCertificateUpdateReqType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 41; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 41: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs ); + } + grammarID = 42; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 42: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytes, dinCertificateUpdateReqType->DHParams.bytesLen); + } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -9170,48 +9453,96 @@ static int encode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntr return errn; } -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) { - int grammarID = 271; +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +static int encode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { + int grammarID = 279; int done = 0; while(!done) { switch(grammarID) { - case 271: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - if ( dinSignatureValueType->Id_isUsed == 1u ) { + case 279: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + if ( dinMeteringReceiptReqType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->Id.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, dinSignatureValueType->Id.characters, dinSignatureValueType->Id.charactersLen); + errn = encodeCharacters(stream, dinMeteringReceiptReqType->Id.characters, dinMeteringReceiptReqType->Id.charactersLen); } } - grammarID = 272; - } else if (1==1) { + grammarID = 280; + } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); } } + grammarID = 281; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 280: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeteringReceiptReqType->SessionID.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytes, dinMeteringReceiptReqType->SessionID.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 281; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 281: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + if ( dinMeteringReceiptReqType->SAScheduleTupleID_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinMeteringReceiptReqType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 282; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); + } grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 272: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { + case 282: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); - } + errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); } grammarID = 3; } else { @@ -9241,15 +9572,71 @@ static int encode_dinSignatureValueType(bitstream_t* stream, struct dinSignature return errn; } +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) { + int grammarID = 283; + int done = 0; + + unsigned int dinConsumptionCostType_Cost_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 283: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinConsumptionCostType->startValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 284; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 284: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */ + if (dinConsumptionCostType_Cost_currArrayIndex < dinConsumptionCostType->Cost.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinCostType(stream, &dinConsumptionCostType->Cost.array [dinConsumptionCostType_Cost_currArrayIndex++]); + } + grammarID = 284; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + /* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType) { - int grammarID = 250; + int grammarID = 50; int done = 0; while(!done) { switch(grammarID) { - case 250: + case 50: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9290,193 +9677,121 @@ static int encode_dinSessionStopResType(bitstream_t* stream, struct dinSessionSt return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ -static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) { - int grammarID = 273; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +static int encode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) { + int grammarID = 285; int done = 0; - - + + unsigned int dinSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; + while(!done) { switch(grammarID) { - case 273: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ + case 285: + /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if ( dinSignaturePropertiesType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertiesType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinSignaturePropertiesType->Id.characters, dinSignaturePropertiesType->Id.charactersLen); + } + } + grammarID = 286; + } else if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 287; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 286: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 287; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 287: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */ + if (dinSignaturePropertiesType_SignatureProperty_currArrayIndex < dinSignaturePropertiesType->SignatureProperty.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array [dinSignaturePropertiesType_SignatureProperty_currArrayIndex++]); + } + grammarID = 287; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ +static int encode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) { + int grammarID = 288; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 288: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinNotificationType->FaultCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 289; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 289: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ + if ( dinNotificationType->FaultMsg_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); if(errn == 0) { /* FirstStartTag[CHARACTERS[STRING]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->MeterID.charactersLen + 2)); + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinNotificationType->FaultMsg.charactersLen + 2)); if (errn == 0) { - errn = encodeCharacters(stream, dinMeterInfoType->MeterID.characters, dinMeterInfoType->MeterID.charactersLen); + errn = encodeCharacters(stream, dinNotificationType->FaultMsg.characters, dinNotificationType->FaultMsg.charactersLen); } /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 274; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 274: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->MeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - errn = encode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading ); - } - grammarID = 275; - } else if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 276; - } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 277; - } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 275: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->SigMeterReading_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinMeterInfoType->SigMeterReading.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, dinMeterInfoType->SigMeterReading.bytes, dinMeterInfoType->SigMeterReading.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 276; - } else if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 277; - } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 276: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->MeterStatus_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger16(stream, dinMeterInfoType->MeterStatus); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 277; - } else if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 277: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */ - if ( dinMeterInfoType->TMeter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, dinMeterInfoType->TMeter); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } grammarID = 3; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); @@ -9511,328 +9826,12 @@ static int encode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* return errn; } -/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))', derivedBy='EXTENSION'. */ -static int encode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) { - int grammarID = 278; - int done = 0; - - unsigned int dinSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 278: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - if ( dinSalesTariffEntryType->RelativeTimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval ); - } - grammarID = 279; - } else if ( dinSalesTariffEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval ); - } - grammarID = 279; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 279: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinSalesTariffEntryType->EPriceLevel - 0)); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 280; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 280: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ - if (dinSalesTariffEntryType_ConsumptionCost_currArrayIndex < dinSalesTariffEntryType->ConsumptionCost.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array [dinSalesTariffEntryType_ConsumptionCost_currArrayIndex++]); - } - grammarID = 280; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int encode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) { - int grammarID = 128; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 128: - /* FirstStartTag[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int encode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) { - int grammarID = 281; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 281: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - if ( dinSignaturePropertyType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignaturePropertyType->Id.characters, dinSignaturePropertyType->Id.charactersLen); - } - } - grammarID = 282; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 283; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 282: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 283; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 283: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 284; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 33: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 284: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 33; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 284; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -static int encode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) { - int grammarID = 285; - int done = 0; - - unsigned int dinSignatureType_Object_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 285: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( dinSignatureType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, dinSignatureType->Id.characters, dinSignatureType->Id.charactersLen); - } - } - grammarID = 286; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); - } - grammarID = 287; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 286: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo ); - } - grammarID = 287; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 287: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue ); - } - grammarID = 288; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 288: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if ( dinSignatureType->KeyInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo ); - } - grammarID = 289; - } else if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); - } - grammarID = 289; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 289: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */ - if (dinSignatureType_Object_currArrayIndex < dinSignatureType->Object.arrayLen ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - errn = encode_dinObjectType(stream, &dinSignatureType->Object.array [dinSignatureType_Object_currArrayIndex++]); - } - grammarID = 289; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - - - -int encode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { - errn = writeEXIHeader(stream); - - if(errn == 0) { + + +int encode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { + errn = writeEXIHeader(stream); + + if(errn == 0) { /* DocContent[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010: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:2010:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2010: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:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT_GENERIC] */ if ( exiDoc->AC_EVChargeParameter_isUsed == 1u ) { /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter) */ @@ -10352,19 +10351,18 @@ int encode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) { } else { errn = EXI_ERROR_UNKOWN_EVENT; } - - } - - if(errn == 0) { - /* flush any pending bits */ - errn = encodeFinish(stream); - } - - return errn; -} - - -#endif /* DEPLOY_DIN_CODEC */ - -#endif - + + } + + if(errn == 0) { + /* flush any pending bits */ + errn = encodeFinish(stream); + } + + return errn; +} + +#endif /* DEPLOY_DIN_CODEC */ + +#endif + diff --git a/src/din/dinEXIDatatypesEncoder.h b/src/din/dinEXIDatatypesEncoder.h index ae2cb35..75df579 100644 --- a/src/din/dinEXIDatatypesEncoder.h +++ b/src/din/dinEXIDatatypesEncoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
@@ -41,19 +41,17 @@ #ifdef __cplusplus extern "C" { #endif - - -#include "dinEXIDatatypes.h" - -#if DEPLOY_DIN_CODEC == SUPPORT_YES + +#if DEPLOY_DIN_CODEC == SUPPORT_YES #includeSwitch for sample programs: EXI codec only or for entire V2G example
diff --git a/src/test/main.h b/src/test/main.h index 4912dc2..4bd6874 100644 --- a/src/test/main.h +++ b/src/test/main.h @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * * diff --git a/src/test/main_databinder.c b/src/test/main_databinder.c index 8e0fa3a..f6871d2 100644 --- a/src/test/main_databinder.c +++ b/src/test/main_databinder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * *Code generated by EXIdizer
diff --git a/src/test/main_example.c b/src/test/main_example.c index 3e3e407..b263f9f 100644 --- a/src/test/main_example.c +++ b/src/test/main_example.c @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * * @@ -37,6 +37,12 @@ #include "appHandEXIDatatypesEncoder.h" #include "appHandEXIDatatypesDecoder.h" +#if DEPLOY_DIN_CODEC == SUPPORT_YES +#include "dinEXIDatatypes.h" +#include "dinEXIDatatypesEncoder.h" +#include "dinEXIDatatypesDecoder.h" +#endif /* DEPLOY_DIN_CODEC == SUPPORT_YES */ + #include "v2gEXIDatatypes.h" #include "v2gEXIDatatypesEncoder.h" #include "v2gEXIDatatypesDecoder.h" @@ -99,7 +105,7 @@ static void printDCEVSEStatus(struct v2gDC_EVSEStatusType* status) } printf("\t\tEVSEStatusCode=%d\n", status->EVSEStatusCode); - if(status->EVSENotification==EVSENotificationType_None) { + if(status->EVSENotification==v2gEVSENotificationType_None) { printf("\t\tEVSENotification=None_EVSENotificationType\n"); } printf("\t\tNotificationMaxDelay=%d\n",status->NotificationMaxDelay); @@ -182,8 +188,9 @@ static int appHandshakeHandler(bitstream_t* iStream, bitstream_t* oStream) { /* prepare response handshake response: * it is assumed, we support the 15118 1.0 version :-) */ + init_appHandEXIDocument(&appHandResp); appHandResp.supportedAppProtocolRes_isUsed = 1u; - appHandResp.supportedAppProtocolRes.ResponseCode = responseCodeType_OK_SuccessfulNegotiation; + appHandResp.supportedAppProtocolRes.ResponseCode = appHandresponseCodeType_OK_SuccessfulNegotiation; appHandResp.supportedAppProtocolRes.SchemaID = exiDoc.supportedAppProtocolReq.AppProtocol.array[0].SchemaID; /* signal the protocol by the provided schema id*/ appHandResp.supportedAppProtocolRes.SchemaID_isUsed = 1u; @@ -263,7 +270,7 @@ static int appHandshake() if(decode_appHandExiDocument(&stream2, &handshakeResp) == 0) { printf("EV side: Response of the EVSE \n"); - if(handshakeResp.supportedAppProtocolRes.ResponseCode == responseCodeType_OK_SuccessfulNegotiation) { + if(handshakeResp.supportedAppProtocolRes.ResponseCode == appHandresponseCodeType_OK_SuccessfulNegotiation) { printf("\t\tResponseCode=OK_SuccessfulNegotiation\n"); printf("\t\tSchemaID=%d\n",handshakeResp.supportedAppProtocolRes.SchemaID); } @@ -307,7 +314,7 @@ static int sessionSetup(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exi init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.SessionSetupRes_isUsed = 1u; init_v2gSessionSetupResType(&exiOut->V2G_Message.Body.SessionSetupRes); - exiOut->V2G_Message.Body.SessionSetupRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.SessionSetupRes.ResponseCode = v2gresponseCodeType_OK; exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[0] = 0; exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[1] = 20; exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.charactersLen = 2; @@ -333,7 +340,7 @@ static int serviceDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList_isUsed = 0u; /* we do not provide VAS */ - exiOut->V2G_Message.Body.ServiceDiscoveryRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.ServiceDiscoveryRes.ResponseCode = v2gresponseCodeType_OK; /* result->ChargeService.SupportedEnergyTransferMode = AC_single_phase_core_EnergyTransferModeType; */ @@ -348,21 +355,21 @@ static int serviceDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceName.charactersLen = 5; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceScope_isUsed = 1u; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.FreeService = 1; - exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceCategory = serviceCategoryType_EVCharging; + exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceCategory = v2gserviceCategoryType_EVCharging; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceScope_isUsed = 1u; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceScope.characters[0] = 100; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceScope.characters[1] = '\0'; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceScope.charactersLen = 1; - exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[0] = EnergyTransferModeType_DC_combo_core; - exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[1] = EnergyTransferModeType_AC_single_phase_core; + exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[0] = v2gEnergyTransferModeType_DC_combo_core; + exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[1] = v2gEnergyTransferModeType_AC_single_phase_core; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.arrayLen = 2; - exiOut->V2G_Message.Body.ServiceDiscoveryRes.PaymentOptionList.PaymentOption.array[0] = paymentOptionType_ExternalPayment; /* EVSE handles the payment */ - exiOut->V2G_Message.Body.ServiceDiscoveryRes.PaymentOptionList.PaymentOption.array[1] = paymentOptionType_Contract; + exiOut->V2G_Message.Body.ServiceDiscoveryRes.PaymentOptionList.PaymentOption.array[0] = v2gpaymentOptionType_ExternalPayment; /* EVSE handles the payment */ + exiOut->V2G_Message.Body.ServiceDiscoveryRes.PaymentOptionList.PaymentOption.array[1] = v2gpaymentOptionType_Contract; exiOut->V2G_Message.Body.ServiceDiscoveryRes.PaymentOptionList.PaymentOption.arrayLen = 2; - if(exiIn->V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory==serviceCategoryType_Internet || exiIn->V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory==serviceCategoryType_OtherCustom || exiIn->V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory_isUsed == 0u) { + if(exiIn->V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory==v2gserviceCategoryType_Internet || exiIn->V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory==v2gserviceCategoryType_OtherCustom || exiIn->V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory_isUsed == 0u) { exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.arrayLen = 2; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[0].FreeService=1; @@ -372,7 +379,7 @@ static int serviceDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[0].ServiceName.characters[1]='W'; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[0].ServiceName.characters[2]='W'; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[0].ServiceName.charactersLen = 3; - exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[0].ServiceCategory= serviceCategoryType_Internet; + exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[0].ServiceCategory= v2gserviceCategoryType_Internet; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[0].ServiceScope_isUsed = 0u; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[1].FreeService=0; @@ -384,7 +391,7 @@ static int serviceDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[1].ServiceName.characters[3]='P'; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[1].ServiceName.characters[4]='S'; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[1].ServiceName.charactersLen = 5; - exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[1].ServiceCategory=serviceCategoryType_Internet; + exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[1].ServiceCategory=v2gserviceCategoryType_Internet; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[1].ServiceScope_isUsed = 0u; exiOut->V2G_Message.Body.ServiceDiscoveryRes.ServiceList_isUsed = 1u; @@ -457,10 +464,10 @@ static int serviceDetail(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* ex exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].Name.characters[6] = 'l'; exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue_isUsed = 1u; exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue.Value = 1234; - exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue.Unit = unitSymbolType_m; + exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue.Unit = v2gunitSymbolType_m; exiOut->V2G_Message.Body.ServiceDetailRes.ServiceParameterList.ParameterSet.array[1].Parameter.array[0].physicalValue.Multiplier = 0; - exiOut->V2G_Message.Body.ServiceDetailRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.ServiceDetailRes.ResponseCode = v2gresponseCodeType_OK; return 0; } @@ -474,7 +481,7 @@ static int paymentServiceSelection(struct v2gEXIDocument* exiIn, struct v2gEXIDo printf("\tHeader SessionID="); printBinaryArray(exiIn->V2G_Message.Header.SessionID.bytes, exiIn->V2G_Message.Header.SessionID.bytesLen); - if(exiIn->V2G_Message.Body.PaymentServiceSelectionReq.SelectedPaymentOption == paymentOptionType_ExternalPayment) { + if(exiIn->V2G_Message.Body.PaymentServiceSelectionReq.SelectedPaymentOption == v2gpaymentOptionType_ExternalPayment) { printf("\t\t SelectedPaymentOption=ExternalPayment\n"); } @@ -492,7 +499,7 @@ static int paymentServiceSelection(struct v2gEXIDocument* exiIn, struct v2gEXIDo exiOut->V2G_Message.Body.PaymentServiceSelectionRes_isUsed= 1u; init_v2gPaymentServiceSelectionResType(&exiOut->V2G_Message.Body.PaymentServiceSelectionRes); - exiOut->V2G_Message.Body.ServiceDetailRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.ServiceDetailRes.ResponseCode = v2gresponseCodeType_OK; return 0; } @@ -514,7 +521,7 @@ static int paymentDetails(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* e init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.PaymentDetailsRes_isUsed = 1u; - exiOut->V2G_Message.Body.PaymentDetailsRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.PaymentDetailsRes.ResponseCode = v2gresponseCodeType_OK; exiOut->V2G_Message.Body.PaymentDetailsRes.GenChallenge.bytesLen = 1; exiOut->V2G_Message.Body.PaymentDetailsRes.GenChallenge.bytes[0] = 1; exiOut->V2G_Message.Body.PaymentDetailsRes.EVSETimeStamp = 123456; @@ -541,8 +548,8 @@ static int authorization(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* ex init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.AuthorizationRes_isUsed = 1u; - exiOut->V2G_Message.Body.AuthorizationRes.ResponseCode = responseCodeType_OK; - exiOut->V2G_Message.Body.AuthorizationRes.EVSEProcessing = EVSEProcessingType_Finished; + exiOut->V2G_Message.Body.AuthorizationRes.ResponseCode = v2gresponseCodeType_OK; + exiOut->V2G_Message.Body.AuthorizationRes.EVSEProcessing = v2gEVSEProcessingType_Finished; return 0; } @@ -555,7 +562,7 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID printf("\t\t EVRequestedEnergyTransferType=%d\n", exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq.RequestedEnergyTransferMode); /* check,if DC or AC is requested */ - if(exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq.RequestedEnergyTransferMode == EnergyTransferModeType_DC_core || exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter_isUsed == 1) { + if(exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq.RequestedEnergyTransferMode == v2gEnergyTransferModeType_DC_core || exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter_isUsed == 1) { printf("\t\t MaxEntriesSAScheduleTuple=%d\n", exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq.MaxEntriesSAScheduleTuple); printf("\t\t EVStatus:\n"); printf("\t\t\t EVReady=%d\n", exiIn->V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DC_EVStatus.EVReady); @@ -578,50 +585,50 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes_isUsed = 1u; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.ResponseCode = responseCodeType_OK; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.EVSEProcessing = EVSEProcessingType_Finished; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.ResponseCode = v2gresponseCodeType_OK; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.EVSEProcessing = v2gEVSEProcessingType_Finished; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter_isUsed = 1u; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter_isUsed = 0u; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.EVSEStatusCode = DC_EVSEStatusCodeType_EVSE_Ready; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.EVSEIsolationStatus = isolationLevelType_Valid; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.EVSEStatusCode = v2gDC_EVSEStatusCodeType_EVSE_Ready; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.EVSEIsolationStatus = v2gisolationLevelType_Valid; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.EVSEIsolationStatus_isUsed = 1; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.EVSENotification = EVSENotificationType_None; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.EVSENotification = v2gEVSENotificationType_None; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.DC_EVSEStatus.NotificationMaxDelay = 10; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Value = 50; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumPowerLimit.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumPowerLimit.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumPowerLimit.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumPowerLimit.Value = 20000; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumVoltageLimit.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumVoltageLimit.Unit = unitSymbolType_V; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumVoltageLimit.Unit = v2gunitSymbolType_V; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMaximumVoltageLimit.Value = 400; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumCurrentLimit.Value = 5; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumVoltageLimit.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumVoltageLimit.Unit = unitSymbolType_V; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumVoltageLimit.Unit = v2gunitSymbolType_V; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEMinimumVoltageLimit.Value = 200; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSECurrentRegulationTolerance.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSECurrentRegulationTolerance.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSECurrentRegulationTolerance.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSECurrentRegulationTolerance.Value = 2; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSECurrentRegulationTolerance_isUsed = 1u; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEPeakCurrentRipple.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEPeakCurrentRipple.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEPeakCurrentRipple.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEPeakCurrentRipple.Value = 1; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEEnergyToBeDelivered.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEEnergyToBeDelivered.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEEnergyToBeDelivered.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEEnergyToBeDelivered.Value = 5000; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.DC_EVSEChargeParameter.EVSEEnergyToBeDelivered_isUsed = 1u; @@ -634,14 +641,14 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.arrayLen = 2; /* set up two PMax entries: #1 */ exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Value=20000; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Multiplier =0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval_isUsed = 1u; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval.start=0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval.duration_isUsed = 0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Value=0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Multiplier =0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].RelativeTimeInterval_isUsed = 1u; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].RelativeTimeInterval.start=1200; /* 20 min */ @@ -653,14 +660,14 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID /* #2 */ exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SAScheduleTupleID = 15; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Value = 10000; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Multiplier =0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval.start=0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval_isUsed = 1; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval.duration_isUsed = 0u; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Value=0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Multiplier =1; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[1].RelativeTimeInterval.start=1800; /* 30 min */ exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].PMaxSchedule.PMaxScheduleEntry.array[1].RelativeTimeInterval_isUsed = 1u; @@ -687,8 +694,8 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes_isUsed = 1u; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.ResponseCode = responseCodeType_OK; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.EVSEProcessing = EVSEProcessingType_Finished; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.ResponseCode = v2gresponseCodeType_OK; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.EVSEProcessing = v2gEVSEProcessingType_Finished; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter_isUsed = 1u; @@ -696,15 +703,15 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.AC_EVSEStatus.RCD =1; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.AC_EVSEStatus.EVSENotification = EVSENotificationType_None; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.AC_EVSEStatus.EVSENotification = v2gEVSENotificationType_None; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.AC_EVSEStatus.NotificationMaxDelay=123; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSEMaxCurrent.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSEMaxCurrent.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSEMaxCurrent.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSEMaxCurrent.Value = 100; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSENominalVoltage.Multiplier = 0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSENominalVoltage.Unit = unitSymbolType_V; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSENominalVoltage.Unit = v2gunitSymbolType_V; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.AC_EVSEChargeParameter.EVSENominalVoltage.Value = 300; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.EVSEProcessing = 1; @@ -717,14 +724,14 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID /* set up two PMax entries: #1 */ exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Value=20000; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].PMax.Multiplier =0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval.start=0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval_isUsed = 1u; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[0].RelativeTimeInterval.duration_isUsed =0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Value=0; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].PMax.Multiplier =0; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].RelativeTimeInterval.start=1200; /* 20 min */ exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].PMaxSchedule.PMaxScheduleEntry.array[1].RelativeTimeInterval_isUsed = 1u; @@ -757,7 +764,7 @@ static int chargeParameterDiscovery(struct v2gEXIDocument* exiIn, struct v2gEXID exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].ConsumptionCost.array[0].Cost.array[0].amount=10; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].ConsumptionCost.array[0].Cost.array[0].amountMultiplier=1; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].ConsumptionCost.array[0].Cost.array[0].amountMultiplier_isUsed =1; - exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].ConsumptionCost.array[0].Cost.array[0].costKind= costKindType_RenewableGenerationPercentage; + exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].ConsumptionCost.array[0].Cost.array[0].costKind= v2gcostKindType_RenewableGenerationPercentage; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].ConsumptionCost.array[0].startValue.Value=123; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].ConsumptionCost.array[0].Cost.arrayLen = 1; exiOut->V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[1].SalesTariff.SalesTariffEntry.array[1].EPriceLevel_isUsed =1; @@ -815,11 +822,11 @@ static int powerDelivery(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* ex } } - exiOut->V2G_Message.Body.PowerDeliveryRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.PowerDeliveryRes.ResponseCode = v2gresponseCodeType_OK; exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus.EVSEIsolationStatus =0; exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus.EVSEIsolationStatus_isUsed = 1; - exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus.EVSEStatusCode = DC_EVSEStatusCodeType_EVSE_Ready; - exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus.EVSENotification = EVSENotificationType_None; + exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus.EVSEStatusCode = v2gDC_EVSEStatusCodeType_EVSE_Ready; + exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus.EVSENotification = v2gEVSENotificationType_None; exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus.NotificationMaxDelay = 123; exiOut->V2G_Message.Body.PowerDeliveryRes.DC_EVSEStatus_isUsed = 1; @@ -827,7 +834,7 @@ static int powerDelivery(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* ex } else { - exiOut->V2G_Message.Body.PowerDeliveryRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.PowerDeliveryRes.ResponseCode = v2gresponseCodeType_OK; exiOut->V2G_Message.Body.PowerDeliveryRes.AC_EVSEStatus.RCD=0; exiOut->V2G_Message.Body.PowerDeliveryRes.AC_EVSEStatus.EVSENotification=3; exiOut->V2G_Message.Body.PowerDeliveryRes.AC_EVSEStatus.NotificationMaxDelay=12; @@ -849,17 +856,17 @@ static int chargingStatus(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* e init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.ChargingStatusRes_isUsed = 1u; - exiOut->V2G_Message.Body.ChargingStatusRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.ChargingStatusRes.ResponseCode = v2gresponseCodeType_OK; exiOut->V2G_Message.Body.ChargingStatusRes.EVSEID.characters[0]=12; exiOut->V2G_Message.Body.ChargingStatusRes.EVSEID.charactersLen =1; exiOut->V2G_Message.Body.ChargingStatusRes.AC_EVSEStatus.RCD=1; - exiOut->V2G_Message.Body.ChargingStatusRes.AC_EVSEStatus.EVSENotification = EVSENotificationType_None; + exiOut->V2G_Message.Body.ChargingStatusRes.AC_EVSEStatus.EVSENotification = v2gEVSENotificationType_None; exiOut->V2G_Message.Body.ChargingStatusRes.AC_EVSEStatus.NotificationMaxDelay=123; exiOut->V2G_Message.Body.ChargingStatusRes.ReceiptRequired=1; exiOut->V2G_Message.Body.ChargingStatusRes.ReceiptRequired_isUsed =1; exiOut->V2G_Message.Body.ChargingStatusRes.EVSEMaxCurrent.Multiplier = 2; - exiOut->V2G_Message.Body.ChargingStatusRes.EVSEMaxCurrent.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.ChargingStatusRes.EVSEMaxCurrent.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.ChargingStatusRes.EVSEMaxCurrent.Value = 400; exiOut->V2G_Message.Body.ChargingStatusRes.EVSEMaxCurrent_isUsed =1; @@ -902,10 +909,10 @@ static int meteringReceipt(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.MeteringReceiptRes_isUsed = 1u; - exiOut->V2G_Message.Body.MeteringReceiptRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.MeteringReceiptRes.ResponseCode = v2gresponseCodeType_OK; exiOut->V2G_Message.Body.MeteringReceiptRes.AC_EVSEStatus.RCD=1; - exiOut->V2G_Message.Body.MeteringReceiptRes.AC_EVSEStatus.EVSENotification= EVSENotificationType_None; + exiOut->V2G_Message.Body.MeteringReceiptRes.AC_EVSEStatus.EVSENotification= v2gEVSENotificationType_None; exiOut->V2G_Message.Body.MeteringReceiptRes.AC_EVSEStatus.NotificationMaxDelay=123; return 0; @@ -924,7 +931,7 @@ static int sessionStop(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exiO init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.SessionStopRes_isUsed = 1u; - exiOut->V2G_Message.Body.SessionStopRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.SessionStopRes.ResponseCode = v2gresponseCodeType_OK; return 0; } @@ -944,13 +951,13 @@ static int cableCheck(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exiOu init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.CableCheckRes_isUsed = 1u; - exiOut->V2G_Message.Body.CableCheckRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.CableCheckRes.ResponseCode = v2gresponseCodeType_OK; - exiOut->V2G_Message.Body.CableCheckRes.EVSEProcessing = EVSEProcessingType_Finished; - exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSEIsolationStatus= isolationLevelType_Valid; + exiOut->V2G_Message.Body.CableCheckRes.EVSEProcessing = v2gEVSEProcessingType_Finished; + exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSEIsolationStatus= v2gisolationLevelType_Valid; exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSEIsolationStatus_isUsed = 1u; - exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSEStatusCode = DC_EVSEStatusCodeType_EVSE_Ready; - exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSENotification= EVSENotificationType_None; + exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSEStatusCode = v2gDC_EVSEStatusCodeType_EVSE_Ready; + exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.EVSENotification= v2gEVSENotificationType_None; exiOut->V2G_Message.Body.CableCheckRes.DC_EVSEStatus.NotificationMaxDelay = 1234; return 0; @@ -974,17 +981,17 @@ static int preCharge(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* exiOut init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.PreChargeRes_isUsed = 1u; - exiOut->V2G_Message.Body.PreChargeRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.PreChargeRes.ResponseCode = v2gresponseCodeType_OK; - exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSEIsolationStatus= isolationLevelType_Valid; + exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSEIsolationStatus= v2gisolationLevelType_Valid; exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSEIsolationStatus_isUsed = 1u; - exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSEStatusCode = DC_EVSEStatusCodeType_EVSE_Ready; - exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSENotification = EVSENotificationType_None; + exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSEStatusCode = v2gDC_EVSEStatusCodeType_EVSE_Ready; + exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.EVSENotification = v2gEVSENotificationType_None; exiOut->V2G_Message.Body.PreChargeRes.DC_EVSEStatus.NotificationMaxDelay= 1234; exiOut->V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Multiplier = 0; - exiOut->V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Unit = unitSymbolType_V; + exiOut->V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Unit = v2gunitSymbolType_V; exiOut->V2G_Message.Body.PreChargeRes.EVSEPresentVoltage.Value= 100; return 0; @@ -1017,21 +1024,21 @@ static int currentDemand(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* ex init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.CurrentDemandRes_isUsed = 1u; - exiOut->V2G_Message.Body.CurrentDemandRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.CurrentDemandRes.ResponseCode = v2gresponseCodeType_OK; - exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.EVSEIsolationStatus= isolationLevelType_Valid; + exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.EVSEIsolationStatus= v2gisolationLevelType_Valid; exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.EVSEIsolationStatus_isUsed = 1; - exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.EVSEStatusCode = DC_EVSEStatusCodeType_EVSE_Ready; - exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.EVSENotification= EVSENotificationType_None; + exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.EVSEStatusCode = v2gDC_EVSEStatusCodeType_EVSE_Ready; + exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.EVSENotification= v2gEVSENotificationType_None; exiOut->V2G_Message.Body.CurrentDemandRes.DC_EVSEStatus.NotificationMaxDelay=1234; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentVoltage.Multiplier = 0; - exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentVoltage.Unit = unitSymbolType_V; + exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentVoltage.Unit = v2gunitSymbolType_V; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentVoltage.Value = 400; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentCurrent.Multiplier = 0; - exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentCurrent.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentCurrent.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPresentCurrent.Value = 45; exiOut->V2G_Message.Body.CurrentDemandRes.EVSECurrentLimitAchieved=0; @@ -1039,17 +1046,17 @@ static int currentDemand(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* ex exiOut->V2G_Message.Body.CurrentDemandRes.EVSEPowerLimitAchieved=0; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumVoltageLimit.Multiplier = 0; - exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumVoltageLimit.Unit = unitSymbolType_V; + exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumVoltageLimit.Unit = v2gunitSymbolType_V; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumVoltageLimit.Value = 400; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumVoltageLimit_isUsed = 1u; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumCurrentLimit.Multiplier = 0; - exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumCurrentLimit.Unit = unitSymbolType_A; + exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumCurrentLimit.Unit = v2gunitSymbolType_A; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumCurrentLimit.Value = 50; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumCurrentLimit_isUsed = 1u; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumPowerLimit.Multiplier = 0; - exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumPowerLimit.Unit = unitSymbolType_W; + exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumPowerLimit.Unit = v2gunitSymbolType_W; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumPowerLimit.Value = 20000; exiOut->V2G_Message.Body.CurrentDemandRes.EVSEMaximumPowerLimit_isUsed = 1u; @@ -1093,15 +1100,15 @@ static int weldingDetection(struct v2gEXIDocument* exiIn, struct v2gEXIDocument* init_v2gBodyType(&exiOut->V2G_Message.Body); exiOut->V2G_Message.Body.WeldingDetectionRes_isUsed = 1u; - exiOut->V2G_Message.Body.WeldingDetectionRes.ResponseCode = responseCodeType_OK; + exiOut->V2G_Message.Body.WeldingDetectionRes.ResponseCode = v2gresponseCodeType_OK; - exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.EVSEIsolationStatus= isolationLevelType_Valid; + exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.EVSEIsolationStatus= v2gisolationLevelType_Valid; exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.EVSEIsolationStatus_isUsed = 1; - exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.EVSEStatusCode = DC_EVSEStatusCodeType_EVSE_Ready; - exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.EVSENotification= EVSENotificationType_None; + exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.EVSEStatusCode = v2gDC_EVSEStatusCodeType_EVSE_Ready; + exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.EVSENotification= v2gEVSENotificationType_None; exiOut->V2G_Message.Body.WeldingDetectionRes.DC_EVSEStatus.NotificationMaxDelay=123; exiOut->V2G_Message.Body.WeldingDetectionRes.EVSEPresentVoltage.Value = 1234; - exiOut->V2G_Message.Body.WeldingDetectionRes.EVSEPresentVoltage.Unit = unitSymbolType_V; + exiOut->V2G_Message.Body.WeldingDetectionRes.EVSEPresentVoltage.Unit = v2gunitSymbolType_V; exiOut->V2G_Message.Body.WeldingDetectionRes.EVSEPresentVoltage.Multiplier = 0; return 0; @@ -1270,7 +1277,7 @@ static int ac_charging() init_v2gServiceDiscoveryReqType(&exiIn.V2G_Message.Body.ServiceDiscoveryReq); exiIn.V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory_isUsed = 1u; - exiIn.V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory = serviceCategoryType_Internet; + exiIn.V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory = v2gserviceCategoryType_Internet; exiIn.V2G_Message.Body.ServiceDiscoveryReq.ServiceScope_isUsed = 0u; printf("EV side: call EVSE serviceDiscovery"); @@ -1289,16 +1296,16 @@ static int ac_charging() printf("\t ServiceID=%d\n", exiOut.V2G_Message.Body.ServiceDiscoveryRes.ChargeService.ServiceID); printf("\t ServiceName="); printASCIIString(serviceDiscoveryRes.ChargeService.ServiceName.characters, serviceDiscoveryRes.ChargeService.ServiceName.charactersLen); - if(serviceDiscoveryRes.PaymentOptionList.PaymentOption.array[1] == paymentOptionType_Contract) { + if(serviceDiscoveryRes.PaymentOptionList.PaymentOption.array[1] == v2gpaymentOptionType_Contract) { printf("\t PaymentOption=Contract_paymentOptionType\n"); } if(serviceDiscoveryRes.ChargeService.FreeService==1) { printf("\t ChargeService.FreeService=True\n"); } - if(serviceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[0] == EnergyTransferModeType_DC_combo_core) { + if(serviceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[0] == v2gEnergyTransferModeType_DC_combo_core) { printf("\t EnergyTransferMode=AC_single_DC_core\n"); } - if(serviceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[1] == EnergyTransferModeType_AC_single_phase_core) { + if(serviceDiscoveryRes.ChargeService.SupportedEnergyTransferMode.EnergyTransferMode.array[1] == v2gEnergyTransferModeType_AC_single_phase_core) { printf("\t EnergyTransferMode=AC_single_phase_core_EnergyTransferModeType\n"); } printf("\t Value added service list:\n"); @@ -1307,7 +1314,7 @@ static int ac_charging() printf("\n\t\t ServiceID=%d\n", serviceDiscoveryRes.ServiceList.Service.array[i].ServiceID); printf("\t\t ServiceName="); printASCIIString(serviceDiscoveryRes.ServiceList.Service.array[i].ServiceName.characters, exiOut.V2G_Message.Body.ServiceDiscoveryRes.ServiceList.Service.array[i].ServiceName.charactersLen ); - if(serviceDiscoveryRes.ServiceList.Service.array[i].ServiceCategory == serviceCategoryType_Internet) { + if(serviceDiscoveryRes.ServiceList.Service.array[i].ServiceCategory == v2gserviceCategoryType_Internet) { printf("\t\t ServiceCategory=Internet\n"); } if(serviceDiscoveryRes.ServiceList.Service.array[i].FreeService==1) { @@ -1386,7 +1393,7 @@ static int ac_charging() init_v2gPaymentServiceSelectionReqType(&exiIn.V2G_Message.Body.PaymentServiceSelectionReq); - exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedPaymentOption = paymentOptionType_ExternalPayment; + exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedPaymentOption = v2gpaymentOptionType_ExternalPayment; exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedServiceList.SelectedService.arrayLen = 2; exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedServiceList.SelectedService.array[0].ServiceID = serviceDiscoveryRes.ChargeService.ServiceID; /* charge server ID */ exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedServiceList.SelectedService.array[0].ParameterSetID_isUsed = 0u; /* is not used */ @@ -1504,7 +1511,7 @@ static int ac_charging() printBinaryArray(exiOut.V2G_Message.Header.SessionID.bytes, exiOut.V2G_Message.Header.SessionID.bytesLen); printf("\t ResponseCode=%d\n", exiOut.V2G_Message.Body.AuthorizationRes.ResponseCode); - if(exiOut.V2G_Message.Body.AuthorizationRes.EVSEProcessing == EVSEProcessingType_Finished) { + if(exiOut.V2G_Message.Body.AuthorizationRes.EVSEProcessing == v2gEVSEProcessingType_Finished) { printf("\t EVSEProcessing=Finished\n"); } } else { @@ -1525,26 +1532,26 @@ static int ac_charging() init_v2gChargeParameterDiscoveryReqType(&exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq); /* we use here AC based charging parameters */ - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.RequestedEnergyTransferMode = EnergyTransferModeType_AC_single_phase_core; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.RequestedEnergyTransferMode = v2gEnergyTransferModeType_AC_single_phase_core; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.MaxEntriesSAScheduleTuple = 1234; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter_isUsed = 1u; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.DepartureTime = 12345; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EAmount.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EAmount.Unit = unitSymbolType_W; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EAmount.Unit = v2gunitSymbolType_W; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EAmount.Value = 100; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxCurrent.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxCurrent.Unit = unitSymbolType_A; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxCurrent.Unit = v2gunitSymbolType_A; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxCurrent.Value = 200; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxVoltage.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxVoltage.Unit = unitSymbolType_V; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxVoltage.Unit = v2gunitSymbolType_V; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMaxVoltage.Value = 400; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMinCurrent.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMinCurrent.Unit = unitSymbolType_A; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMinCurrent.Unit = v2gunitSymbolType_A; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.AC_EVChargeParameter.EVMinCurrent.Value = 500; printf("EV side: call EVSE chargeParameterDiscovery"); @@ -1585,7 +1592,7 @@ static int ac_charging() exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile_isUsed = 0; exiIn.V2G_Message.Body.PowerDeliveryReq.DC_EVPowerDeliveryParameter_isUsed = 0; /* only used for DC charging */ - exiIn.V2G_Message.Body.PowerDeliveryReq.ChargeProgress = chargeProgressType_Start; + exiIn.V2G_Message.Body.PowerDeliveryReq.ChargeProgress = v2gchargeProgressType_Start; exiIn.V2G_Message.Body.PowerDeliveryReq.SAScheduleTupleID = exiOut.V2G_Message.Body.ChargeParameterDiscoveryRes.SAScheduleList.SAScheduleTuple.array[0].SAScheduleTupleID; printf("EV side: call EVSE powerDelivery \n"); @@ -1823,7 +1830,7 @@ static int dc_charging() { init_v2gServiceDiscoveryReqType(&exiIn.V2G_Message.Body.ServiceDiscoveryReq); exiIn.V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory_isUsed = 1u; - exiIn.V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory = serviceCategoryType_EVCharging; + exiIn.V2G_Message.Body.ServiceDiscoveryReq.ServiceCategory = v2gserviceCategoryType_EVCharging; printf("EV side: call EVSE serviceDiscovery"); @@ -1864,7 +1871,7 @@ static int dc_charging() { init_v2gPaymentServiceSelectionReqType(&exiIn.V2G_Message.Body.PaymentServiceSelectionReq); - exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedPaymentOption = paymentOptionType_ExternalPayment; + exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedPaymentOption = v2gpaymentOptionType_ExternalPayment; exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedServiceList.SelectedService.arrayLen = 1; /* only one service was selected */ exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedServiceList.SelectedService.array[0].ServiceID = serviceDiscoveryRes.ChargeService.ServiceID; /* charge server ID */ exiIn.V2G_Message.Body.PaymentServiceSelectionReq.SelectedServiceList.SelectedService.array[0].ParameterSetID_isUsed = 0u; /* is not used */ @@ -1916,7 +1923,7 @@ static int dc_charging() { printBinaryArray(exiOut.V2G_Message.Header.SessionID.bytes, exiOut.V2G_Message.Header.SessionID.bytesLen); printf("\t ResponseCode=%d\n", exiOut.V2G_Message.Body.AuthorizationRes.ResponseCode); - if(exiOut.V2G_Message.Body.AuthorizationRes.EVSEProcessing == EVSEProcessingType_Finished) { + if(exiOut.V2G_Message.Body.AuthorizationRes.EVSEProcessing == v2gEVSEProcessingType_Finished) { printf("\t EVSEProcessing=Finished\n"); } } else { @@ -1940,32 +1947,32 @@ static int dc_charging() { exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter_isUsed = 1u; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DC_EVStatus.EVRESSSOC = 89; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DC_EVStatus.EVReady = 1; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DC_EVStatus.EVErrorCode = DC_EVErrorCodeType_NO_ERROR; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DC_EVStatus.EVErrorCode = v2gDC_EVErrorCodeType_NO_ERROR; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DepartureTime_isUsed = 1u; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.DepartureTime = 123456789; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumCurrentLimit.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumCurrentLimit.Unit = unitSymbolType_A; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumCurrentLimit.Unit = v2gunitSymbolType_A; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumCurrentLimit.Value = 60; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumPowerLimit_isUsed = 1u; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumPowerLimit.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumPowerLimit.Unit = unitSymbolType_W; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumPowerLimit.Unit = v2gunitSymbolType_W; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumPowerLimit.Value = 20000; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumVoltageLimit.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumVoltageLimit.Unit = unitSymbolType_V; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumVoltageLimit.Unit = v2gunitSymbolType_V; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVMaximumVoltageLimit.Value = 420; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyCapacity_isUsed = 1u; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyCapacity.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyCapacity.Unit = unitSymbolType_W; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyCapacity.Unit = v2gunitSymbolType_W; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyCapacity.Value = 15000; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyRequest_isUsed = 1u; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyRequest.Multiplier = 0; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyRequest.Unit = unitSymbolType_W; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyRequest.Unit = v2gunitSymbolType_W; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.EVEnergyRequest.Value = 5000; @@ -1976,7 +1983,7 @@ static int dc_charging() { exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter.BulkSOC = 80; - exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.RequestedEnergyTransferMode = EnergyTransferModeType_DC_core; + exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.RequestedEnergyTransferMode = v2gEnergyTransferModeType_DC_core; exiIn.V2G_Message.Body.ChargeParameterDiscoveryReq.DC_EVChargeParameter_isUsed = 1u; @@ -2057,7 +2064,7 @@ static int dc_charging() { printBinaryArray(exiOut.V2G_Message.Header.SessionID.bytes, exiOut.V2G_Message.Header.SessionID.bytesLen); printf("\t ResponseCode=%d\n", exiOut.V2G_Message.Body.CableCheckRes.ResponseCode); - if(exiOut.V2G_Message.Body.CableCheckRes.EVSEProcessing==EVSEProcessingType_Finished) { + if(exiOut.V2G_Message.Body.CableCheckRes.EVSEProcessing==v2gEVSEProcessingType_Finished) { printf("\tEVSEProcessing=Finished\n"); } @@ -2084,11 +2091,11 @@ static int dc_charging() { exiIn.V2G_Message.Body.PreChargeReq.DC_EVStatus.EVRESSSOC = 12; exiIn.V2G_Message.Body.PreChargeReq.EVTargetCurrent.Multiplier = 0; - exiIn.V2G_Message.Body.PreChargeReq.EVTargetCurrent.Unit = unitSymbolType_A; + exiIn.V2G_Message.Body.PreChargeReq.EVTargetCurrent.Unit = v2gunitSymbolType_A; exiIn.V2G_Message.Body.PreChargeReq.EVTargetCurrent.Value = 100; exiIn.V2G_Message.Body.PreChargeReq.EVTargetVoltage.Multiplier = 0; - exiIn.V2G_Message.Body.PreChargeReq.EVTargetVoltage.Unit = unitSymbolType_V; + exiIn.V2G_Message.Body.PreChargeReq.EVTargetVoltage.Unit = v2gunitSymbolType_V; exiIn.V2G_Message.Body.PreChargeReq.EVTargetVoltage.Value = 200; printf("EV side: call EVSE preCharge \n"); @@ -2130,7 +2137,7 @@ static int dc_charging() { exiIn.V2G_Message.Body.PowerDeliveryReq.DC_EVPowerDeliveryParameter.ChargingComplete = 1; exiIn.V2G_Message.Body.PowerDeliveryReq.DC_EVPowerDeliveryParameter_isUsed = 1u; /* DC parameters are send */ - exiIn.V2G_Message.Body.PowerDeliveryReq.ChargeProgress = chargeProgressType_Start; + exiIn.V2G_Message.Body.PowerDeliveryReq.ChargeProgress = v2gchargeProgressType_Start; /* we are using a charging profile */ @@ -2141,13 +2148,13 @@ static int dc_charging() { /* set up 3 entries */ exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.arrayLen=3; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[0].ChargingProfileEntryMaxPower.Value=0; - exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[0].ChargingProfileEntryMaxPower.Unit = unitSymbolType_W; + exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[0].ChargingProfileEntryMaxPower.Unit = v2gunitSymbolType_W; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[0].ChargingProfileEntryMaxPower.Multiplier=2; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[0].ChargingProfileEntryStart=0; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[0].ChargingProfileEntryMaxNumberOfPhasesInUse=1; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[0].ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed=1; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[1].ChargingProfileEntryMaxPower.Value=20000; - exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[1].ChargingProfileEntryMaxPower.Unit = unitSymbolType_W; + exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[1].ChargingProfileEntryMaxPower.Unit = v2gunitSymbolType_W; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[1].ChargingProfileEntryMaxPower.Multiplier = 1; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[1].ChargingProfileEntryMaxNumberOfPhasesInUse=3; exiIn.V2G_Message.Body.PowerDeliveryReq.ChargingProfile.ProfileEntry.array[1].ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed=1; @@ -2195,21 +2202,21 @@ static int dc_charging() { exiIn.V2G_Message.Body.CurrentDemandReq.DC_EVStatus.EVErrorCode = 1; exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Multiplier = 0; - exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Unit = unitSymbolType_A; + exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Unit = v2gunitSymbolType_A; exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Value = 100; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumVoltageLimit.Multiplier = 0; - exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumVoltageLimit.Unit = unitSymbolType_V; + exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumVoltageLimit.Unit = v2gunitSymbolType_V; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumVoltageLimit.Value = 420; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumVoltageLimit_isUsed = 1u; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumPowerLimit.Multiplier = 0; - exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumPowerLimit.Unit = unitSymbolType_W; + exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumPowerLimit.Unit = v2gunitSymbolType_W; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumPowerLimit.Value = 20000; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumPowerLimit_isUsed = 1u; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumCurrentLimit.Multiplier = 0; - exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumCurrentLimit.Unit = unitSymbolType_A; + exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumCurrentLimit.Unit = v2gunitSymbolType_A; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumCurrentLimit.Value = 60; exiIn.V2G_Message.Body.CurrentDemandReq.EVMaximumCurrentLimit_isUsed = 1u; @@ -2219,18 +2226,18 @@ static int dc_charging() { exiIn.V2G_Message.Body.CurrentDemandReq.ChargingComplete = 1; exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToFullSoC.Multiplier = 0; - exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToFullSoC.Unit = unitSymbolType_s; + exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToFullSoC.Unit = v2gunitSymbolType_s; exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToFullSoC.Value = 300; /* 5 min*/ exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToFullSoC_isUsed = 1u; exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToBulkSoC.Multiplier = 0; - exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToBulkSoC.Unit = unitSymbolType_s; + exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToBulkSoC.Unit = v2gunitSymbolType_s; exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToBulkSoC.Value = 120; /* 3 min */ exiIn.V2G_Message.Body.CurrentDemandReq.RemainingTimeToBulkSoC_isUsed = 1u; exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Multiplier = 0; - exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Unit = unitSymbolType_V; + exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Unit = v2gunitSymbolType_V; exiIn.V2G_Message.Body.CurrentDemandReq.EVTargetVoltage.Value = 400; @@ -2309,11 +2316,120 @@ static int dc_charging() { } + +#if DEPLOY_DIN_CODEC == SUPPORT_YES + +static int din_test() { + int errn = 0; + + struct dinEXIDocument exiDin1; + struct dinEXIDocument exiDin2; + + bitstream_t stream1; + bitstream_t stream2; + uint16_t pos1 = 0; + uint16_t pos2 = 0; + + stream1.size = BUFFER_SIZE; + stream1.data = buffer1; + stream1.pos = &pos1; + + stream2.size = BUFFER_SIZE; + stream2.data = buffer2; + stream2.pos = &pos2; + + /* SetupSessionReq */ + /* BMW: 80 9A 00 11 D0 20 00 03 C1 FC 30 00 43 F8 00 */ + buffer1[0] = 0x80; + buffer1[1] = 0x9A; + buffer1[2] = 0x00; + buffer1[3] = 0x11; + buffer1[4] = 0xD0; + buffer1[5] = 0x20; + buffer1[6] = 0x00; + buffer1[7] = 0x03; + buffer1[8] = 0xC1; + buffer1[9] = 0xFC; + buffer1[10] = 0x30; + buffer1[11] = 0x00; + buffer1[12] = 0x43; + buffer1[13] = 0xF8; + buffer1[14] = 0x00; + + errn = decode_dinExiDocument(&stream1, &exiDin1); + + if(errn != 0) { + printf("\n\nDIN test error %d!\n", errn); + return errn; + } else if (pos1 != 15) { + printf("\n\nDIN warning. not all bytes read!\n"); + errn = -1; + return errn; + } + + + /* SetupSessionReq */ + /* Chevy: 80 9A 02 00 00 00 00 00 00 00 00 11 D0 18 00 60 8C 44 09 94 00 */ + buffer2[0] = 0x80; + buffer2[1] = 0x9A; + buffer2[2] = 0x02; + buffer2[3] = 0x00; + buffer2[4] = 0x00; + buffer2[5] = 0x00; + buffer2[6] = 0x00; + buffer2[7] = 0x00; + buffer2[8] = 0x00; + buffer2[9] = 0x00; + buffer2[10] = 0x00; + buffer2[11] = 0x11; + buffer2[12] = 0xD0; + buffer2[13] = 0x18; + buffer2[14] = 0x00; + buffer2[15] = 0x60; + buffer2[16] = 0x8C; + buffer2[17] = 0x44; + buffer2[18] = 0x09; + buffer2[19] = 0x94; + buffer2[20] = 0x00; + + errn = decode_dinExiDocument(&stream2, &exiDin2); + + if(errn != 0) { + printf("\n\nDIN test error %d!\n", errn); + return errn; + } else if (pos2 != 21) { + printf("\n\nDIN warning. not all bytes read!\n"); + errn = -1; + return errn; + } + + + if(errn == 0) { + printf("DIN test passed\n"); + } else { + printf("DIN test error %d!\n", errn); + } + + return errn; +} +#endif /* DEPLOY_DIN_CODEC == SUPPORT_YES */ + + #define ASK_FOR_USER_INPUT 0 int main_example(int argc, char *argv[]) { int errn = 0; +#if DEPLOY_DIN_CODEC == SUPPORT_YES + printf("+++ Start simple DIN test +++\n"); + errn = din_test(); + printf("+++ Terminate simple DIN test +++\n\n"); + if(errn != 0) { + printf("\nDIN test error %d!\n", errn); + return errn; + } +#endif /* DEPLOY_DIN_CODEC == SUPPORT_YES */ + printf("+++ Start application handshake protocol example +++\n\n"); errn = appHandshake(); printf("+++ Terminate application handshake protocol example +++\n\n"); diff --git a/src/transport/v2gtp.c b/src/transport/v2gtp.c index ac24b55..9cddf12 100644 --- a/src/transport/v2gtp.c +++ b/src/transport/v2gtp.c @@ -20,7 +20,7 @@ * * @author Sebastian.Kaebisch@siemens.com * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * ********************************************************************/ diff --git a/src/transport/v2gtp.h b/src/transport/v2gtp.h index 728a701..7daf83f 100644 --- a/src/transport/v2gtp.h +++ b/src/transport/v2gtp.h @@ -19,7 +19,7 @@ /******************************************************************* * * @author Sebastian.Kaebisch@siemens.com - * @version 0.9.1 + * @version 0.9.2 * @contact Joerg.Heuer@siemens.com * ********************************************************************/